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;  
}

1 Answer 1

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

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .