The login service exposes SalesForce login directly, when not using FH AAA Authentication.
Endpoint | /cloud/login |
HTTP Method | POST |
{
"username": "user1",
"password": "password1"
}
{
"status": "TODO - accesstoken or something returned??"
}
List SalesForce Accounts
Endpoint | /cloud/listAccounts |
HTTP Method | POST |
{
"accessToken": "",
"instanceUrl": ""
}
{
"accounts": ["TODO"]
}
Endpoint | /cloud/getAccountDetails |
HTTP Method | POST |
{
"accountId": "",
"auth": {
"instanceUrl": "",
"accessToken": ""
}
}
{
"account": ["TODO"]
}
Endpoint | /cloud/listCases |
HTTP Method | POST |
{
"accessToken": "",
"instanceUrl": ""
}
{
"cases": ["TODO"]
}
Endpoint | /cloud/getCaseDetails |
HTTP Method | POST |
{
"accountId": "",
"auth": {
"instanceUrl": "",
"accessToken": ""
}
}
{
"account": ["TODO"]
}
Endpoint | /cloud/listCampaigns |
HTTP Method | POST |
{
"accessToken": "",
"instanceUrl": ""
}
{
"Campaigns": ["TODO"]
}
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:
-
Log into salesforce
-
Click username - > Developer Console (pops up)
-
In dev console popup, Debug -> Open Annon Execute Window
-
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;
-
Set up environment variables for salesforce topic polling user, INCLUDING security token - process.env.SF_TOPIC_USERNAME, process.env.SF_TOPIC_PASSWORD
-
Register for this notification in node-salesforce
More info: http://wiki.developerforce.com/page/Getting_Started_with_the_Force.com_Streaming_API
All the tests are in the "test/" directory. The cloud app is using mocha as the test runner.
npm run serve
npm run unit
or
npm run test
npm run coverage