function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
salesforce sfdxsalesforce 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;
       
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];
    
    }