Skip to main content

Posts

Showing posts from January, 2016

Salesforce REST API - Part II

We have created a Connected App in Part I , so now we need to make requests through the rest api. So as I mentioned earlier we need grant_type , client_id , client_secret , username , password parameters to authenticate with the salesforce in order to call to the endpoint https://login.salesforce.com/services/oauth2/token. And that request should be a POST request. What will happen here is once we send that POST request with the parameters if it is a successful authentication it will return a access token.This access token is same as the session id. After that each and every request we need to attach the access token in the header. Behind the seen salesforce validate the access token and if it is validate it will returning the request data. if the validate fails salesforce returning 401 unauthorized error.  As you know session has expire time. As same as salesforce access token has expire time.You can change access token settings by clicking the Connected App's

Salesforce REST API

This post describe about the salesforce rest api and using salesforce rest api . Salesforce implements the OAuth to authenticate soap and rest calls with the client. So I will describe with the simple steps, how to create salesforce app that expose outside to authenticate and call rest methods. First you need to create a salesforce developer account if you don't have an developer account or sandbox account. If you don't have an developer account go with the following link and create an account. It's free.   https://developer.salesforce.com/signup . Once you create the developer account go to https://login.salesforce.com/ and login with your credentials.     Navigate to setup and type app and you will be able to find Apps section and click the link. So now you will be able to find Connected Apps section and click New. What we doing here is creating a connected app and that app will exposing to outside to authenticate and call rest api calls. So you can insert C