You need to sign in to do that
Don't have an account?

RestRessource not found
Hello,
I'm trying the RestRessource functionality in Apex and I'm facing a "service not found" every time. Here's how I do it :
First, I create a simple Apex class that return "Hello World" on a GET request.
If any of you have a solution !
I'm trying the RestRessource functionality in Apex and I'm facing a "service not found" every time. Here's how I do it :
First, I create a simple Apex class that return "Hello World" on a GET request.
@RestResource(urlMapping='/test/*') global with sharing class ApexRestTest { @HttpGet global static String getMethod() { return 'Hello World'; } }Then after saving I go to the workbench connect to the right Organization as Administrator and in the "utilities > REST explorer" I perform this request :
- GET
- /services/apexrest/test/123
[ { "errorCode" : "NOT_FOUND", "message" : "Could not find a match for URL" } ]On the trailhead it just looks as easy as I did so I don't understand what's wrong.
If any of you have a solution !
If you have a namespace defined in your salesforce org, you need to define it with request URI as /services/apexrest/<namespace>/test/
Hope you find this useful.
Regards
Pankaj Shakya