You need to sign in to do that
Don't have an account?
asadim2
Simple REST class won't work (Could not find a match for URL ....)
Here's the Apex REST class:
@RestResource(urlMapping='/abc/def/*') global with sharing class TheRESTclass { @HttpGet global static String doGet(RestRequest req, RestResponse res) { return 'hello'; } }
From the Apigee Salesforce console, I call the following URL (using OAuth authentication):
https://na7.salesforce.com/services/apexrest/abc/def
I've also tried it with the namespace in there:
https://na7.salesforce.com/services/apexrest/namespace/abc/def
But I keep getting this error:
"message": "Could not find a match for URL /namespace/abc/def", "errorCode": "NOT_FOUND"
I've looked at multiple tutorials and they all guided me in the same direction. So I don't know what I could be possibly missing. Do I need to comfigure Remote Site Settings or do any other type of configuration?
Thanks in advance.
Actually I figured this out. If my package name is "MyPackage", then the URL for the resource must be:
https://{instance}.salesforce.com/services/apexrest/MyPackage/events
The namespace component of the URL is case sensitive, so, this URL doesn't work:
https://{instance}.salesforce.com/services/apexrest/mypackage/events
I'm giving myself create for a solution on this one ;)
All Answers
asdim2, did you ever find a solution to this? I've run into a similar issue. I've got an APEX REST class with the following signature:
I developed the class in a non-namespaced Developer Edition org and it worked fine when I accessed it via the URL: https://naX.salesforce.com/services/apexrest/event/{someid}. When I migrated the code to a namespaced Developer Edition org in preparation for packaging I got the error you described. I tried accessing the resource using the following URL: https://naX.salesforce.com/services/apexrest/{mynamespace}/event/{someid} and got the same result. Any ideas?
If I recall correctly, it took some time (like a day) for the service to get published. Don't know why, but when I tested it the next day it worked.
Actually I figured this out. If my package name is "MyPackage", then the URL for the resource must be:
https://{instance}.salesforce.com/services/apexrest/MyPackage/events
The namespace component of the URL is case sensitive, so, this URL doesn't work:
https://{instance}.salesforce.com/services/apexrest/mypackage/events
I'm giving myself create for a solution on this one ;)
Example it would be:
https://na15.salesforce.com/services/apexrest/your_namespace/apexrest/abc/def where "your_namespace" is the namespace of your org
This will ensure it will work in customer orgs where my package is deployed.
GET :https://eu5.salesforce.com/services/apexrest/appsearch. The 404 error is: [
{
"errorCode": "NOT_FOUND",
"message": "Could not find a match for URL"
}