Salesforce client for an Apex RESTful web service

An example about how to consume a Salesforce api rest, in particular:

/services/apexrest/

The example shows how to authenticate using username and password to get the access token and then how to do a request to this Salesforce web service:

@RestResource(urlMapping='/hellorest')
global class HelloRest {

    @HttpPost
    global static String echo(String name) {
        String echo = 'Hi, '+name;
        System.debug('Echo: '+echo);
        return echo;
    }
}

See the code from Github https://github.com/andrescanavesi/salesforce-apex-rest

Photo by Franck V. on Unsplash

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s