Salesforce Module
Introduction
The Salesforce module lets you connect to Salesforce and retrieve/set data. The module contains several models representing those from your Salesforce installation (e.g. "Account"), which allow you to fetch, create, modify or delete data directly in and from Salesforce.
Configuration
Consumer Key |
OAuth Consumer Key of your Salesforce App (see https://developer.salesforce.com/page/Getting_Started_with_the_Force.com_REST_API) |
Consumer Secret |
OAuth Consumer Secret of your Salesforce App (see https://developer.salesforce.com/page/Getting_Started_with_the_Force.com_REST_API) |
Backend
The Salesforce module provides a corresponding model for each needed Salesforce entity, to retrieve, write, update or delete data on it. The basic setup contains an Account model for manipulating Salesforce accounts.
Module setup
To connect to your Salesforce instance, you first have to create an connector app. Create a app as follows:
-
Open Salesforce setup (found in the menu beyond your login name on the upper right)
-
Select Application setup -> Create -> Applications on the left menu
-
Create new Connected Application using the button
-
Provide an app name and your email address in the first form part
-
Set the callback URL to https://<YOUR_BASE_URL>/yambas/rest/modules/Salesforce/spec/authcode_callback
-
You must use https here!
-
substitute <YOUR_BASE_URL> with the URL where ApiOmat is installed
-
-
Add all OAuth rights to the app
-
Hit save
Use
To get started using Salesforce data, the customer or user has to authenticate first. This can be done through the MyModule section in Dashboard or via REST.
You can authenticate application-wide using a customer as authentication base, or let each user authenticate themself with their salesforce account. In the last case, you can omit the customerName and password parameter in the following example:
cURL
curl -k https:
//<YOURHOST>/yambas/rest/modules/Salesforce/<YOURAPPNAME>/spec/oauth/<YOURAPPNAME> -d customerName=<CUSTOMERNAME> -d password=<CUSTOMERPASSWORD>
The call will redirect to an URL starting with https://login.salesforce.com/?ec= , a webpage of salesforce, where a user must authenticate against salesforce via OAuth. If successfull, the dashboard of ApiOmat is opened and Salesforce is connected properly.
Limitations
Due to the Salesforce app restrictions, using this module is only possible in Salesforce editions with API access.