Try WSO2 Cloud for Free
Sign in

All docs This doc

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In the Export Salesforce Account Details to Microsoft Dynamics CRM   scenario, you  work  scenario, you work with the Salesforce REST connector, which requires you to get a client ID and secret pair from Salesforce. If you do not have this now, do the following:

  1. Create a developer account for Salesforce via via https://developer.salesforce.com/signup.
  2. Navigate to Setup -> Create -> Apps and in the Connected Apps section, click New to create a new connected application.
  3. To create a new app, fill the basic information, click Enable OAuth Settings  to to open the API section, and  add the scope and the callback. Once done, save the configurations. You can see some example values in the following screenshot:

  4. Note your Consumer Key and under API (Enable OAuth Settings).
  5. Replace the <your_client_id> and <yourand <your_redirect_uri> of the following URL with the values you created earlier and view the URL using a web browser.

    Code Block
    https://login.salesforce.com/services/oauth2/authorize?response_type=code&client_id=<your_client_id>&redirect_uri=<your_redirect_uri>
  6. Approve the application to access your salesforce account and note that the the browser will redirect you to the call-back URL (redirect URL):
    https://app.com/oauth_callback?code=aWe...c4w%3D%3D
  7. From the call-back URL, extract the authorization code.

  8. Send a direct POST request to the authorization server using the following request. Be sure to change the values here to the actual values that you got earlier.

    Code Block
    https://login.salesforce.com/services/oauth2/token?code=aWe...c4w==&grant_type=authorization_code&client_id=<your_client_id>&client_secret=<your_client_secret>&redirect_uri=<your_redirect_uri>&format=json

    Tip

    In the above request, you can set the format as urlencoded, json or xml to get the response in one of the three formats.

  9. From the response that you get, extract the accessToken to access Salesforce via the created app. You also get a refreshToken to renew the accessToken when it expires.