1

I would like to test a Get endpoint in Workbench via the rest Explorer. However I'm getting a services not found error when executing. Any suggestions on what I need to change? Below is the endpoint I'm entering /services/data/v40.0/FEApplicationDataById/V1

Here is my Rest Class:

@RestResource(urlMapping='/FEApplicationDataById/V1')
global class FEApplicationDataById {
@HTTPGet
global static JSONData getFEApplicationData () {
    RestRequest req =  RestContext.request;
    RestResponse res = RestContext.response;
    res.addHeader('Accept', 'application/json');
    req.headers.get('pidm');
    req.headers.get('idStringList');
    String pidm  = req.params.get('pidm');
    String idStringList = req.params.get('idStringList');
    System.debug('PIDM='+pidm);
    //calls the populateFEAppDataById method to do json population.       
    JSONData feData = populateFEAppDataById(pidm, idStringList);

    return feData;  
}
2

You have to use following:

https://yourInstance.salesforce.com/services/apexrest/FEApplicationDataById/V1

Workbench conveniently takes care of the ...yourInstance.salesforce.com... part so in the Rest Explorer input box you just need to change /services/data/... to /services/apexrest/... when trying to access your Custom Apex REST resources.

For more information, refer Apex Web Services

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.