Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kyleballard/7a60b4f087834ae834d7ed16b0647e7d to your computer and use it in GitHub Desktop.
Save kyleballard/7a60b4f087834ae834d7ed16b0647e7d to your computer and use it in GitHub Desktop.
Salesforce postman collection for ballardsoftware.com
{
"info": {
"_postman_id": "21ee81f8-30b6-4ba5-ae8d-a645fc6a6d0d",
"name": "Salesforce (Ballardsoftware.com)",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Bulk API 2.0",
"item": [
{
"name": "List Jobs",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access-token}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{instance-url}}/services/data/v{{version}}/jobs/ingest",
"host": [
"{{instance-url}}"
],
"path": [
"services",
"data",
"v{{version}}",
"jobs",
"ingest"
]
}
},
"response": []
},
{
"name": "Create Job",
"event": [
{
"listen": "test",
"script": {
"id": "e0c4cd65-5810-4fb2-909f-831b78b590d3",
"exec": [
"var jsonData = JSON.parse(responseBody);\r",
"pm.environment.set(\"job-id\", jsonData.id);"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access-token}}",
"type": "text"
},
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"object\" : \"Lead\",\r\n \"externalIdFieldName\" : \"External_Id__c\",\r\n \"contentType\" : \"CSV\",\r\n \"operation\" : \"upsert\",\r\n \"lineEnding\": \"CRLF\"\r\n}"
},
"url": {
"raw": "{{instance-url}}/services/data/v{{version}}/jobs/ingest",
"host": [
"{{instance-url}}"
],
"path": [
"services",
"data",
"v{{version}}",
"jobs",
"ingest"
]
}
},
"response": []
},
{
"name": "Job Status",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access-token}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{instance-url}}/services/data/v{{version}}/jobs/ingest/{{job-id}}",
"host": [
"{{instance-url}}"
],
"path": [
"services",
"data",
"v{{version}}",
"jobs",
"ingest",
"{{job-id}}"
]
}
},
"response": []
},
{
"name": "Upload Job Data",
"request": {
"method": "PUT",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access-token}}",
"type": "text"
},
{
"key": "Content-Type",
"value": "text/csv",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "External_Id__c,Company,LastName,FirstName,Email\r\n500A1,Gates,Microsoft,Bill,bill@microsoft.com\r\n500A2,Apple,Cook,Tim,tim@apple.com\r\n500A3,Amazon,Bezos,Jeff,jeff@amazon.com"
},
"url": {
"raw": "{{instance-url}}/services/data/v{{version}}/jobs/ingest/{{job-id}}/batches",
"host": [
"{{instance-url}}"
],
"path": [
"services",
"data",
"v{{version}}",
"jobs",
"ingest",
"{{job-id}}",
"batches"
]
}
},
"response": []
},
{
"name": "Update Job State",
"request": {
"method": "PATCH",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access-token}}",
"type": "text"
},
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"state\" : \"UploadComplete\"\r\n}"
},
"url": {
"raw": "{{instance-url}}/services/data/v{{version}}/jobs/ingest/{{job-id}}",
"host": [
"{{instance-url}}"
],
"path": [
"services",
"data",
"v{{version}}",
"jobs",
"ingest",
"{{job-id}}"
]
}
},
"response": []
},
{
"name": "Job Results (Successful records)",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access-token}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{instance-url}}/services/data/v{{version}}/jobs/ingest/{{job-id}}/successfulResults/",
"host": [
"{{instance-url}}"
],
"path": [
"services",
"data",
"v{{version}}",
"jobs",
"ingest",
"{{job-id}}",
"successfulResults",
""
]
}
},
"response": []
},
{
"name": "Job Results (Failed records)",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access-token}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{instance-url}}/services/data/v{{version}}/jobs/ingest/{{job-id}}/failedResults/",
"host": [
"{{instance-url}}"
],
"path": [
"services",
"data",
"v{{version}}",
"jobs",
"ingest",
"{{job-id}}",
"failedResults",
""
]
}
},
"response": []
}
]
},
{
"name": "Streaming API",
"item": [
{
"name": "Create Push Topic",
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access-token}}",
"type": "text"
},
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"Name\" : \"Chicago_Leads\",\r\n \"Query\" : \"SELECT Id, FirstName, LastName, Industry FROM Lead WHERE City = 'Chicago'\",\r\n \"ApiVersion\": {{version}},\r\n \"NotifyForOperationCreate\" : true,\r\n \"NotifyForOperationUpdate\" : true,\r\n \"NotifyForOperationUndelete\" : true,\r\n \"NotifyForOperationDelete\" : true,\r\n \"NotifyForFields\" : \"Select\"\r\n}"
},
"url": {
"raw": "{{instance-url}}/services/data/v{{version}}/sobjects/PushTopic/",
"host": [
"{{instance-url}}"
],
"path": [
"services",
"data",
"v{{version}}",
"sobjects",
"PushTopic",
""
]
}
},
"response": []
},
{
"name": "List Push Topics",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access-token}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{instance-url}}/services/data/v{{version}}/query/?q=SELECT Id, Name FROM PushTopic",
"host": [
"{{instance-url}}"
],
"path": [
"services",
"data",
"v{{version}}",
"query",
""
],
"query": [
{
"key": "q",
"value": "SELECT Id, Name FROM PushTopic"
}
]
}
},
"response": []
},
{
"name": "Delete Push Topic",
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access-token}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{instance-url}}/services/data/v{{version}}/sobjects/PushTopic/0IF1U000000oQIJWA2/",
"host": [
"{{instance-url}}"
],
"path": [
"services",
"data",
"v{{version}}",
"sobjects",
"PushTopic",
"0IF1U000000oQIJWA2",
""
]
}
},
"response": []
}
]
},
{
"name": "OAuth Token (Password flow)",
"event": [
{
"listen": "test",
"script": {
"id": "e530e0ad-6ae7-4ccc-9ad4-ecdce521b488",
"exec": [
"var jsonData = JSON.parse(responseBody);\r",
"pm.environment.set(\"access-token\", jsonData.access_token);\r",
"pm.environment.set(\"instance-url\", jsonData.instance_url)"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/x-www-form-urlencoded"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "grant_type",
"value": "password",
"type": "text"
},
{
"key": "client_id",
"value": "{{client-id}}",
"type": "text"
},
{
"key": "client_secret",
"value": "{{client-secret}}",
"type": "text"
},
{
"key": "username",
"value": "{{username}}",
"type": "text"
},
{
"key": "password",
"value": "{{password}}{{security-token}}",
"type": "text"
}
]
},
"url": {
"raw": "https://login.salesforce.com/services/oauth2/token",
"protocol": "https",
"host": [
"login",
"salesforce",
"com"
],
"path": [
"services",
"oauth2",
"token"
]
}
},
"response": []
},
{
"name": "OAuth Token (Web Server flow)",
"event": [
{
"listen": "test",
"script": {
"id": "e530e0ad-6ae7-4ccc-9ad4-ecdce521b488",
"exec": [
"var jsonData = JSON.parse(responseBody);\r",
"pm.environment.set(\"access-token\", jsonData.access_token);\r",
"pm.environment.set(\"instance-url\", jsonData.instance_url)"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/x-www-form-urlencoded",
"type": "text"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "grant_type",
"value": "{{grant-type}}",
"type": "text"
},
{
"key": "client_id",
"value": "{{client-id}}",
"type": "text"
},
{
"key": "client_secret",
"value": "{{client-secret}}",
"type": "text"
},
{
"key": "username",
"value": "{{username}}",
"type": "text"
},
{
"key": "password",
"value": "{{password}}{{security-token}}",
"type": "text"
}
]
},
"url": {
"raw": "https://login.salesforce.com/services/oauth2/token",
"protocol": "https",
"host": [
"login",
"salesforce",
"com"
],
"path": [
"services",
"oauth2",
"token"
]
}
},
"response": []
},
{
"name": "List API Versions",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access-token}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{instance-url}}/services/data/",
"host": [
"{{instance-url}}"
],
"path": [
"services",
"data",
""
]
}
},
"response": []
},
{
"name": "List API Limits",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access-token}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{instance-url}}/services/data/v{{version}}/limits",
"host": [
"{{instance-url}}"
],
"path": [
"services",
"data",
"v{{version}}",
"limits"
]
}
},
"response": []
},
{
"name": "Basic Object Query",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access-token}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{instance-url}}/services/data/v{{version}}/sobjects/Account/0011U000006ee9iQAA",
"host": [
"{{instance-url}}"
],
"path": [
"services",
"data",
"v{{version}}",
"sobjects",
"Account",
"0011U000006ee9iQAA"
]
}
},
"response": []
},
{
"name": "Basic Object Query (Field filtering)",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access-token}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{instance-url}}/services/data/v{{version}}/sobjects/Account/0011U000006ee9iQAA?fields=Name,Phone,Website",
"host": [
"{{instance-url}}"
],
"path": [
"services",
"data",
"v{{version}}",
"sobjects",
"Account",
"0011U000006ee9iQAA"
],
"query": [
{
"key": "fields",
"value": "Name,Phone,Website"
}
]
}
},
"response": []
},
{
"name": "Batch Query",
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access-token}}",
"type": "text"
},
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"batchRequests\": [\n {\n \"method\": \"GET\",\n \"url\": \"{{version}}/limits\"\n },\n {\n \"method\": \"GET\",\n \"url\": \"{{version}}/sobjects/Account/0011U000006ee9iQAA\"\n }\n ]\n}"
},
"url": {
"raw": "{{instance-url}}/services/data/v{{version}}/composite/batch",
"host": [
"{{instance-url}}"
],
"path": [
"services",
"data",
"v{{version}}",
"composite",
"batch"
]
}
},
"response": []
},
{
"name": "Composite Query",
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access-token}}",
"type": "text"
},
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n\"compositeRequest\" : [{\n \"method\" : \"GET\",\n \"url\" : \"/services/data/{{version}}/sobjects/Account/0011U000006ee9iQAA/?fields=Id,Name,Website\",\n \"referenceId\" : \"refAccount\"\n },{\n \"method\" : \"GET\",\n \"url\" : \"/services/data/{{version}}/query/?q=Select Id,Name FROM Contact WHERE Account.Id = '@{refAccount.Id}'\",\n \"referenceId\" : \"refContacts\"\n }]\n}"
},
"url": {
"raw": "{{instance-url}}/services/data/v{{version}}/composite",
"host": [
"{{instance-url}}"
],
"path": [
"services",
"data",
"v{{version}}",
"composite"
]
}
},
"response": []
},
{
"name": "SOQL Query",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access-token}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{instance-url}}/services/data/v{{version}}/query/?q=SELECT Id, Name, Account.Id, Account.Name FROM Contact",
"host": [
"{{instance-url}}"
],
"path": [
"services",
"data",
"v{{version}}",
"query",
""
],
"query": [
{
"key": "q",
"value": "SELECT Id, Name, Account.Id, Account.Name FROM Contact"
}
]
}
},
"response": []
},
{
"name": "External Id Query",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access-token}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{instance-url}}/services/data/v{{version}}/sobjects/Lead/External_Id__c/21456",
"host": [
"{{instance-url}}"
],
"path": [
"services",
"data",
"v{{version}}",
"sobjects",
"Lead",
"External_Id__c",
"21456"
]
}
},
"response": []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment