NAV
cURL

Introduction

Welcome to the Saasli API! You can use this API to interface with your Saasli environment. Please contact Saasli to be provisioned an API Key.

Event Endpoints

/Event

curl --request POST \
  --url '' \
  --header 'content-type: application/json' \
  --header 'x-api-key: 1234567890ABCDEFGHI' \
  --data '{\n    "client_id" : "ABCDEFG1234567",\n    "sf_object_id" : "Contact",\n    "sf_field_id" : "unique_field__c",\n    "sf_field_value" : "ABC123456",\n    "event" : {\n        "event_name" : "Logged In",\n        "event_timestamp" : 1451606400\n    }\n}'

This endpoint logs a single event against a single Salesforce object (either an Account or a Contact).

HTTP Request

POST https://api.saasli.com/v1/event

Headers

Name Value Required?
Content-Type application/json Yes
x-api-key 1234567890ABCDEFGHI Yes

Sample Body

{
    "client_id" : "ABCDEFG1234567",
    "sf_object_id" : "Contact",
    "sf_field_id" : "unique_field__c",
    "sf_field_value" : "ABC123456",
    "event" : {
        "event_name" : "Logged In",
        "event_timestamp" : 1451606400
    }
}

Body

Name Data Type Description Required?
client_id string The unique identifier of the Saasli environment the request is destined for. This will be provisioned to you. Yes
sf_object_id string This must be either ‘Account’ or 'Contact’. This specifies the Salesforce object that triggered the event. Yes
sf_field_id string The API name of the Salesforce field that uniquely identifies the Account or Contact that triggered the event. Yes
sf_field_value string The value stored by the identifying Salesforce field, sf_field_id. Yes
event_name string The name of the event that was performed by the specified Account or Contact. Yes
event_timestamp number The UNIX timestamp that specifies the time at which the event was performed. Yes

/Events

curl --request POST \
  --url '' \
  --header 'content-type: application/json' \
  --header 'x-api-key: 1234567890ABCDEFGHI' \
  --data '{\n    "client_id" : "ABCDEFG1234567",\n    "sf_object_id" : "Contact",\n    "sf_field_id" : "unique_field__c",\n    "events" : [\n        {\n            "sf_field_value" : "ABC123456",\n            "event" : {\n                "event_name" : "Logged In",\n                "event_timestamp" : 1451606400\n            }\n        }\n    ]\n}'

This endpoint logs multiple events against multiple Salesforce objects (either Accounts or Contacts).

HTTP Request

POST <Endpoint to be provisioned>

Headers

Name Value Required?
Content-Type application/json Yes
x-api-key 1234567890ABCDEFGHI Yes

Sample Body

{
    "client_id" : "ABCDEFG1234567",
    "sf_object_id" : "Account",
    "sf_field_id" : "Name",
    "sf_lookup_id" : "Account__c",
    "events" : [
        {
            "sf_field_value" : "Acme 2",
            "event" : {
                "event_name" : "Logged In",
                "event_timestamp" : 1451606400
            }
        },
        {
            "sf_field_value" : "New Account",
            "event" : {
                "event_id" : 123,
                "event_name" : "Logged Out",
                "event_timestamp" : 1451616400,
                "event_values" : {
                  "Product__c" : "Ford"
                }
            }
        },
        {
            "sf_field_value" : "Acme 2",
            "event" : {
                "event_name" : "Try New Event Name",
                "event_timestamp" : 1451606400,
                "event_values" : {
                  "Product__c" : "Chevy"
                }
            }
        }
    ]
}

Body

Name Data Type Description Required?
client_id string The unique identifier of the Saasli environment the request is destined for. This will be provisioned to you. Yes
sf_object_id string This must be either 'Account’ or 'Contact’. This specifies the Salesforce object that triggered the event. Yes
sf_field_id string The API name of the Salesforce field that uniquely identifies the Account or Contact that triggered the event. Yes
sf_lookup_id string The API name of the lookup field on the events object that will reference the triggering object. Yes
sf_field_value string The value stored by the identifying Salesforce field, sf_field_id. Yes
event_name string The name of the event that was performed by the specified Account or Contact. Yes
event_timestamp number The UNIX timestamp that specifies the time at which the event was performed. Yes
event_id string A unique id of the event occurence. Will be generated automatically if this is omitted. Useful for deduplication of events as any duplicate ids will be 'upserted’. No
event_values object Field API Name to value mappings that should also be added to the record. Useful if storing aggregate information. The data type must match the type defined in Salesforce. No

Contact Endpoints

/Contact

curl --request POST \
  --url '' \
  --header 'content-type: application/json' \
  --header 'x-api-key: 1234567890ABCDEFGHI' \
  --data '{\n    "client_id" : "ABCDEFG1234567",\n    "sf_account_field_id" : "Id",\n    "sf_field_id" : "unique_field__c",\n    "contact" : {\n        "sf_account_field_value" : "00158000006mkd1AAA",\n        "sf_field_value" : "ABC123456",\n        "LastName" : "Jones",\n\n        "Name" : "Sam",\n        "Phone" : "+1 123 123 1234",\n        "Custom_Field_API_Name__c" : "Value"\n    }\n}'

This endpoint creates, or updates, a Contact within Salesforce.

If a Contact cannot be found in Salesforce that matches the idenifier you specify (sf_field_id), a new Contact will be created with all the attributes defined in the contact object in the body of the request.

If a Contact is found in Salesforce that matches the identifier, that Contact will be updated with all the attributes defined in the contact object in the body of the request.

HTTP Request

POST https://api.saasli.com/v1/contact/{account_id_field}/{contact_id_field}

Headers

Name Value Required?
Content-Type application/json Yes
x-api-key 1234567890ABCDEFGHI Yes

URL Parameters

Name Description Required?
account_id_field The full API name of the Salesforce field that will be used to identify the account. That field must also exist in the account object defined in the body Yes
contact_id_field The full API name of the Salesforce field that will be used to identify the contact. That field must also exist in the contact object defined in the body Yes

Sample Body

{
    "client_id" : "ad2d965b-57d9-4943-a879-c2a33d9a857b",
    "contact" : {
        "LastName" : "Jones",
        "FirstName" : "Sam",
        "Phone" : "+1 123 123 1234",
        "Custom_Field_API_Name__c" : "Value"
        etc.
    }
}

Body

Name Data Type Description Required?
client_id string The unique identifier of the Saasli environment the request is destined for. This will be provisioned to you. Yes
contact object A key/value representation of the Salesforce field API name and it’s desired value. Yes
LastName string The last name of the contact. This is a required Salesforce field. Yes

/Contacts

curl --request POST \
  --url https://hjfielpxwj.execute-api.us-east-1.amazonaws.com/dev/contact/Id/Phone \
  --header 'cache-control: no-cache' \
  --header 'content-type: application/json' \
  --data '{\n    "client_id" : "saasli",\n    "account" : {\n     "Id" : "0011a00000CXH5xAAH" \n    },\n    "contact" : {\n        "LastName" : "Waites",\n        "FirstName" : "Tom",\n        "Phone" : "+1 123 123 1234"\n    }\n}'

This endpoint creates, or updates, multiple Contacts within Salesforce.

If a Contact cannot be found in Salesforce that matches the idenifier you specify (contact_id_field), a new Contact will be created with all the attributes defined in the contacts object in the body of the request.

If a Contact is found in Salesforce that matches the identifier, that Contact will be updated with all the attributes defined in the contacts object in the body of the request.

HTTP Request

POST <Endpoint to be provisioned>

Headers

Name Value Required?
Content-Type application/json Yes
x-api-key 1234567890ABCDEFGHI Yes

Sample Body

{
    "client_id" : "ABCDEFG1234567",
    "sf_account_field_id" : "Id",
    "sf_field_id" : "unique_field__c",
    "contacts" : [
        {
            "sf_account_field_value" : "00158000006mkd1AAA",
            "sf_field_value" : "ABC123456",
            "LastName" : "Jones",

            "FirstName" : "Sam",
            "Phone" : "+1 123 123 1234",
            "Custom_Field_API_Name__c" : "Value"
            etc.
        }
    ]
}

Body

Name Data Type Description Required?
client_id string The unique identifier of the Saasli environment the request is destined for. This will be provisioned to you. Yes
sf_account_field_id string The API name of the Salesforce Account field that uniquely identifies the Account of the Contact. Yes
sf_field_id string The API name of the Salesforce Contact field that uniquely identifies the Contact. Yes
contacts object The object in the request that contains the array of contact data. Yes
sf_account_field_value string The value stored by the identifying Salesforce Account field, sf_account_field_id. Yes
sf_field_value string The value stored by the identifying Salesforce Contact field, sf_field_id. Yes
LastName string The last name of the contact. This is a required Salesforce field. Yes

Account Endpoints

/Account

curl --request POST \
  --url '' \
  --header 'content-type: application/json' \
  --header 'x-api-key: 1234567890ABCDEFGHI' \
  --data '{\n    "client_id" : "ABCDEFG1234567",\n    "sf_field_id" : "unique_field__c",\n    "sf_field_value" : "ABC123456",\n    "account" : {\n        "Name" : "ACME",\n\n        "Website" : "https://www.companywebsite.com",\n        "Custom_Field_API_Name__c" : "Value"\n    }\n}'

This endpoint creates, or updates, an Account within Salesforce.

If an Account cannot be found in Salesforce that matches the idenifier you specify (account_id_field), a new Account will be created with all the attributes defined in the account object in the body of the request.

If an Account is found in Salesforce that does match the identifier, that Account will be updated with all the attributes defined in the account object in the body of the request.

HTTP Request

POST https://api.saasli.com/v1/account/{account_id_field}

Headers

Name Value Required?
Content-Type application/json Yes
x-api-key 1234567890ABCDEFGHI Yes

URL Parameters

Name Description Required?
account_id_field The full API name of the Salesforce field that will be used to identify the account. That field must also exist in the account object defined in the body Yes

Sample Body

{
    "client_id" : "ad2d965b-57d9-4943-a879-c2a33d9a857b",
    "account" : {
        "Name" : "ACME",
        "Id" : "0011a00000DlaOMAAZ"
    }
}

Body

Name Data Type Description Required?
client_id string The unique identifier of the Saasli environment the request is destined for. This will be provisioned to you. Yes
account object A key/value representation of the Salesforce field API name and it’s desired value. Yes

/Accounts

curl --request POST \
  --url https://hjfielpxwj.execute-api.us-east-1.amazonaws.com/dev/account/Id \
  --header 'cache-control: no-cache' \
  --header 'content-type: application/json' \
  --data '{\n    "client_id" : "ad2d965b-57d9-4943-a879-c2a33d9a857b",\n    "account" : {\n        "Name" : "ACME",\n        "Id" : "0011a00000DlaOMAAZ"\n    }\n}'

This endpoint creates, or updates, multiple Accounts within Salesforce.

If an Account cannot be found in Salesforce that matches the idenifier you specify (sf_field_id), a new Account will be created with all the attributes defined in the accounts object in the body of the request.

If an Account is found in Salesforce that does match the identifier, that Account will be updated with all the attributes defined in the accounts object in the body of the request.

HTTP Request

POST <Endpoint to be provisioned>

Headers

Name Value Required?
Content-Type application/json Yes
x-api-key 1234567890ABCDEFGHI Yes

Sample Body

{
    "client_id" : "ABCDEFG1234567",
    "sf_field_id" : "unique_field__c",
    "accounts" : [
      {
        "sf_field_value" : "ABC123456",
        "Name" : "ACME",

        "Website" : "https://www.companywebsite.com",
        "Custom_Field_API_Name__c" : "Value"
        etc.
      }
    ]
}

Body

Name Data Type Description Required?
client_id string The unique identifier of the Saasli environment the request is destined for. This will be provisioned to you. Yes
sf_field_id string The API name of the Salesforce Account field that uniquely identifies the Account. Yes
sf_field_value string The value stored by the identifying Salesforce Account field, sf_field_id. Yes
Name string The name of the account. This is a required Salesforce field. Yes