...
Table of Contents | ||||
---|---|---|---|---|
|
This document provides the details on the steps of how to configure Credit Checker via a custom portal either outside or within Salesforce. We will be covering the below steps in the entire document. Please follow them to get a seamless experience of integrating Credit Checker with your portal.
...
...
Table of Contents | ||||
---|---|---|---|---|
|
Set up a Connected App
Once you have your developer account set up you’ll want to set up a Connected App.
...
The Refresh token is to be used to retrieve a valid access token (e.g. when the current access token expires). You can change the expiry settings on this but you can also set this never to expire, only when it is revoked.
...
Get OAuth Token
To make the initial authorization request for a user to grant your app access to their data (this is where your user is initially directed to a Saleforce.com authorization endpoint and logs in) you’d make the following request. The ClientID in the below call will be your consumer ID from the connected app. The redirect_url will be the Callback URL.
...
You’ll use this as the value for your code parameter when you make a request to Salesforce’s token endpoint to receive your Access and Refresh Token.
Example request:
Code Block |
---|
curl login.salesforce.com/services/oauth2/token?grant_type=authorization_code&redirect_uri=https://www.yourappname.com/api/callback&client_id=YOUR_CONSUMER_ID&client_secret=YOUR_CONSUMER_SECRET&code=aWekysIEeqM9PiThEfm0Cnr6MoLIfwWyRJcqOqHdF8f9INokharAS09ia7UNP |
Example Response:
Code Block |
---|
{ "access_token": "YOUR_ACCESS_TOKEN", "refresh_token": "YOUR_REFRESH_TOKEN", "signature": "signature", "scope": "refresh_token api id", "instance_url": "https://instance.salesforce.com", "id": "https://login.salesforce.com/id/id, "token_type": "Bearer", "issued_at": "timestamp" } |
...
Due to that, you’ll want to keep your access token up to date by making a call to the token endpoint and changing the grant_type to ‘refresh_token’ along with including the refresh token you had received in the previous call.
Example call:
curl https://login.salesforce.com/services/oauth2/token?=YOUR_REFRESH_TOKENgrant_type=refresh_token&client_id=YOUR_CONSUMER__ID&client_secret=YOUR_CONSUMER__SECRET&refresh_token
Example response:
Code Block |
---|
curl { "access_token": "REFRESHED_ACCESS_TOKEN", "signature": "signature", "scope": "refresh_token id api", "instance_url": "https://INSTANCE.salesforce.com", "id": "https://login.salesforce.com/id/idE", "token_type": "Bearer", "issued_at": "timestamp" } |
...
you can then make the below call to create a Credit Report.
Example request
Code Block |
---|
curl https://INSTANCE.salesforce.com/services/data/v42.0/sobjects/ creditchecker_Credit_Report__c -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"creditchecker__Applicants_First_Name__c" : "Johnny", " creditchecker__Applicants_Last_Name__c " : "Appleseed", “creditchecker__Current_Line__c “:”220 Locust Ave”, “creditchecker__Current_StateCode__c”:”MO”, “creditchecker__Current_City__c “:”Anthill”, “creditchecker__Current_Zip_Code__c “:”65488”, “creditchecker__SSN__c “:”000000001”, “creditchecker__Current_Country__c “:”United States”}' |
...