0

Here is my ( i have tested with workbench and it does work) URL to call :

/services/apexrest/ContactUpdatetService.SetContactInactive

my json:

{
"contactId":"1234",
}

Can I just call it by doing something like this?

*salesforceurl*/services/apexrest/ContactUpdatetService.SetContactInactive?contactId=1234
  • 1
    It depends on how your apex webservice is defined. Please edit your question to show us the class. – Derek F Mar 20 at 21:42
1

You can't do so "automatically." You can, however, check RestContext.request.params to get the value:

String param = RestContext.request.params.get('contactId');

This requires some modification to your Apex code.

| improve this answer | |
  • would i need string param on my apex class to read my url when trying to do this via url: *salesforceurl*/services/apexrest/ContactUpdatetService.SetContactInactive?contactId=1234 – Lauren Truby Mar 20 at 21:56
  • @LaurenTruby Not sure what you're asking? – sfdcfox Mar 20 at 21:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.