Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • 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": "Obtain Security Token (Developer)",
"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": "API Limits",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access-token}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{instance-url}}/services/data/{{version}}/limits",
"host": [
"{{instance-url}}"
],
"path": [
"services",
"data",
"{{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/{{version}}/sobjects/Account/0011U000006ee9iQAA",
"host": [
"{{instance-url}}"
],
"path": [
"services",
"data",
"{{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/{{version}}/sobjects/Account/0011U000006ee9iQAA?fields=Name,Phone,Website",
"host": [
"{{instance-url}}"
],
"path": [
"services",
"data",
"{{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/{{version}}/composite/batch",
"host": [
"{{instance-url}}"
],
"path": [
"services",
"data",
"{{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/{{version}}/composite",
"host": [
"{{instance-url}}"
],
"path": [
"services",
"data",
"{{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/{{version}}/query/?q=SELECT Id, Name, Account.Id, Account.Name FROM Contact",
"host": [
"{{instance-url}}"
],
"path": [
"services",
"data",
"{{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/{{version}}/sobjects/Lead/External_Id__c/21456",
"host": [
"{{instance-url}}"
],
"path": [
"services",
"data",
"{{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