Sales Person Endpoint Reference
Sales Persons are related to Lead records by using the Sync Leads endpoint and passing the externalSalesPersonId attribute.
Sales Persons are related to Opportunity records by using the Sync Opportunities endpoint and passing the externalSalesPersonId attribute.
Sales Persons are related to Company records by using the Sync Companies endpoint and passing the externalSalesPersonId attribute.
Sales Person records are only editable via the API.
Describe
Describing Sales Person records follows the standard pattern for lead database objects.
1 |
GET /rest/v1/salespersons/describe.json |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
{ "requestId":"185d6#14b51985ff0", "success":true, "result":[ { "name":"SalesPerson", "createdAt":"2015-02-03T22:36:23Z", "updatedAt":"2015-02-03T22:36:24Z", "idField":"id", "dedupeFields":[ "externalSalesPersonId" ], "searchableFields":[ [ "email" ], [ "id" ], [ "externalSalesPersonId" ] ], "fields":[ { "name":"id", "displayName":"Marketo Id", "dataType":"integer", "updateable":false }, { "name":"createdAt", "displayName":"Created At", "dataType":"datetime", "updateable":false }, { "name":"updatedAt", "displayName":"Updated At", "dataType":"datetime", "updateable":false }, { "name":"email", "displayName":"Email", "dataType":"string", "length":255, "updateable":false }, { "name":"externalSalesPersonId", "displayName":"External Sales Person Id", "dataType":"string", "length":255, "updateable":false } ] } ] } |
By default, the idField of Sales Persons is “id” and the dedupeFields is just “externalSalesPersonId.”
Query
Sales Persons using the standard query pattern for simple keys. This example shows the user’s email being used as the externalSalesPersonId. By default the query will return all fields that are populated for the returned records.
1 |
GET /rest/v1/salespersons.json?filterType=dedupeFields&filterValues=david@test.com,sam@test.com |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
{ "requestId":"e42b#14272d07d78", "success":true, "result":[ { "seq":0, "id":53453, "externalSalesPersonId":"sam@test.com", "createdAt":"2015-02-03T22:36:23Z", "updatedAt":"2015-02-03T22:36:23Z" }, { "seq":1, "id":53454, "externalSalesPersonId":"david@test.com", "createdAt":"2015-02-03T22:36:23Z", "updatedAt":"2015-02-03T22:36:23Z" } ] } |
Create and Update
The pattern for updates is standard.
1 |
POST /rest/v1/salespersons.json |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
{ "action":"createOrUpdate", "dedupeBy":"dedupeFields", "input":[ { "externalSalesPersonId":"sam@test.com", "email":"sam@test.com", "firstName":"Sam", "lastName":"Sanosin" }, { "externalSalesPersonId":"david@test.com", "email":"david@test.com", "firstName":"David", "lastName":"Aulassak" } ] } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
{ "requestId":"e42b#14272d07d78", "success":true, "result":[ { "seq":0, "status": "updated", "id":45232 }, { "seq":1, "status": "created", "id":45236 } ] } |
Delete
The pattern for deletes is standard.
Deletion of Sales Persons are not allowed when “in use”. In this case the Sales Person is skipped. Examples:
- When Sales Person is associated with active Leads
- When Sales Person is associated with a Company that has been deleted
1 |
POST /rest/v1/salespersons/delete.json |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
{ "deleteBy":"dedupeFields", "input":[ { "externalSalesPersonId":"sam@test.com" }, { "externalSalesPersonId":"david@test.com" }, { "externalSalesPersonId":"raj@test.com" } ] } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
{ "requestId":"e42b#14272d07d78", "success":true, "result":[ { "seq":0, "id":56343, "status": "deleted" }, { "seq":1, "id":53453, "status": "deleted" }, { "seq":2, "status": "skipped" "reasons":[ { "code":"1013", "message":"Record not found" } ] } ] } |
Timeouts
- Sales Person Endpoints have a timeout of 30s unless noted below
- Sync Sales Persons: 60s
- Delete Sales Persons: 60s