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
Kam.ax1015Kam.ax1015 

Calling REST Controller using cCurl or VisualForce page

Hello,

 

I have created a REST controller

@RestResource(urlMapping='/DealController/*')
global class DealRestResource {
...
}

 

When I call itas following, 

 

curl -k -H "Authorization: OAuth 00D50000000Isbl!ARYAQPcQ3MM9F1VigkIS6HJ_6MMP2lboHGgqljtuj.Eo2WlDELUzjIZwMySlcQK7Lsk0d_" -d @acc.json "https://na3.salesforce.com/services/apexrest/DealController/"

 

I get an error "[{"message":"Could not find a match for URL /DealController/","errorCode":"NOT_F
OUND"}]"

 

Also what would be the URL if I have to call it from Apex page itself.

 

Thanks,

Kam

Best Answer chosen by Admin (Salesforce Developers) 
dkadordkador

Are you in a namespaced developer org?  If so, you must include your namespace prefix in the url.  So you'd make your request to:

 

/services/apexrest/my_namespace/DealController

 

All Answers

dkadordkador

Are you in a namespaced developer org?  If so, you must include your namespace prefix in the url.  So you'd make your request to:

 

/services/apexrest/my_namespace/DealController

 

This was selected as the best answer
Kam.ax1015Kam.ax1015

Thank you so much. That resolved the issue.