SalesForce Connector API

Dependency Status

Group SalesForce Connector API

Login

The login service exposes SalesForce login directly, when not using FH AAA Authentication.

Endpoint /cloud/login
HTTP Method POST

Request (application/json)

Body
{
  "username": "user1",
  "password": "password1"
}

Response 200 (application/json)

Body
{
  "status": "TODO - accesstoken or something returned??"
}

List Accounts

List SalesForce Accounts

Endpoint /cloud/listAccounts
HTTP Method POST

Request (application/json)

Body
{
  "accessToken": "",
  "instanceUrl": "" 
}

Response 200 (application/json)

Body
{
  "accounts": ["TODO"]
}

Get Account Details

Endpoint /cloud/getAccountDetails
HTTP Method POST

Request (application/json)

Body
{
  "accountId": "",
  "auth": {
    "instanceUrl": "",
    "accessToken": ""
  }
}

Response 200 (application/json)

Body
{
  "account": ["TODO"]
}

List Cases

Endpoint /cloud/listCases
HTTP Method POST

Request (application/json)

Body
{
  "accessToken": "",
  "instanceUrl": "" 
}

Response 200 (application/json)

Body
{
  "cases": ["TODO"]
}

Get Case Details

Endpoint /cloud/getCaseDetails
HTTP Method POST

Request (application/json)

Body
{
  "accountId": "",
  "auth": {
    "instanceUrl": "",
    "accessToken": ""
  }
}

Response 200 (application/json)

Body
{
  "account": ["TODO"]
}

List Campaigns

Endpoint /cloud/listCampaigns
HTTP Method POST

Request (application/json)

Body
{
  "accessToken": "",
  "instanceUrl": "" 
}

Response 200 (application/json)

Body
{
  "Campaigns": ["TODO"]
}

Group Push Topics

Registering a new Salesforce Push Topic to listen for. Part of the salesforce connector is the ability to set up Push Notifications based on an existing topic defined by a developer in Salesforce. To define such a topic - in this example, changes to the Account object:

  1. Log into salesforce

  2. Click username - > Developer Console (pops up)

  3. In dev console popup, Debug -> Open Annon Execute Window

  4. Enter this code, and click execute - you have registered a push topic. Change query to alter data that comes back.

    PushTopic pushTopic = new PushTopic();
    pushTopic.Name = 'AccountChanges2';
    pushTopic.Query = 'SELECT Id, Name FROM Account';
    pushTopic.ApiVersion = 29.0;
    pushTopic.NotifyForOperationCreate = true;
    pushTopic.NotifyForOperationUpdate = true;
    pushTopic.NotifyForOperationUndelete = true;
    pushTopic.NotifyForOperationDelete = true;
    pushTopic.NotifyForFields = 'All';
    insert pushTopic;
  5. Set up environment variables for salesforce topic polling user, INCLUDING security token - process.env.SF_TOPIC_USERNAME, process.env.SF_TOPIC_PASSWORD

  6. Register for this notification in node-salesforce

More info: http://wiki.developerforce.com/page/Getting_Started_with_the_Force.com_Streaming_API

Tests

All the tests are in the "test/" directory. The cloud app is using mocha as the test runner.

Unit tests

npm run serve
npm run unit

or

npm run test

Unit coverage

npm run coverage