You need to sign in to do that
Don't have an account?
salesforce sfdx
REST api GET with Multiple Parameters from the url best way
How to add to get the serviceId and Taxid values form the url:
what is the options to add, and how to get the multiple params :
Option:1
@RestResource(urlMapping='/Revenues/accountId={acctId}&serviceId={svcId}&TaxId={TaxId}');
OR
Option:2
@RestResource(urlMapping='/Revenues/accountId/*/serviceId/*/TaxId/');
Option:3
@RestResource (urlMapping='/DeviceObjserviceendpoint/*')
global class DeviceObj_Rest_Service {
// @HttpGet
global static void doGet() {
String result = '';
RestRequest request = RestContext.request;
List<Account> accs = [Select Id, Status__c from Account where Id = :accountId && <serviceidvalue> && <Taxidvalue> LIMIT 1];
}
what is the options to add, and how to get the multiple params :
Option:1
@RestResource(urlMapping='/Revenues/accountId={acctId}&serviceId={svcId}&TaxId={TaxId}');
OR
Option:2
@RestResource(urlMapping='/Revenues/accountId/*/serviceId/*/TaxId/');
Option:3
@RestResource (urlMapping='/DeviceObjserviceendpoint/*')
global class DeviceObj_Rest_Service {
// @HttpGet
global static void doGet() {
String result = '';
RestRequest request = RestContext.request;
String accountId = request.requestURI.substringAfter( '/DeviceObjserviceendpoint/' ); String accountId = ??? //how to get the value of Serviceid String TaxId = ??? //how to get the value of TaxId
List<Account> accs = [Select Id, Status__c from Account where Id = :accountId && <serviceidvalue> && <Taxidvalue> LIMIT 1];
}