Skip to main content
Version: 2.0.0

Salesforce CRM

You'll need to provide the following variables in your postman collection:

VariableDescriptionExample
API_VERSIONRepresents the version of the Alloy Unified API you intend to make calls to. API versions are dated and new versions are released quarterly (in March, June, September, and December).2023-12
connectionIdThe Id of the connection. Call the GET List Connections endpoint to find a connectionId.
apiKeyYour API key. Never share this with anyone.


JSON
{
"info": {
"_postman_id": "953db772-fe40-4faf-acd3-c77182579d41",
"name": "Salesforce CRM – Alloy UAPI",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "10048813",
"_collection_link": ""
},
"item": [
{
"name": "Create Account",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"[salesforce crm] response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"[salesforce crm] accounts is created correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('account');",
" pm.expect(jsonData.account).to.not.be.null;",
" pm.expect(jsonData.account).to.have.property('website');",
" pm.expect(jsonData.account).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.account).to.have.property('industry');",
" pm.expect(jsonData.account).to.have.property('addresses');",
" pm.expect(jsonData.account).to.have.property('phoneNumbers');",
" pm.expect(jsonData.account).to.have.property('remoteId');",
" pm.expect(jsonData.account).to.have.property('lastActivityAt');",
" pm.expect(jsonData.account).to.have.property('accountOwner');",
" pm.expect(jsonData.account).to.have.property('accountName');",
" pm.expect(jsonData.account).to.have.property('numberOfEmployees');",
" pm.expect(jsonData.account).to.have.property('description');",
" pm.expect(jsonData.account).to.have.property('createdTimestamp');",
" pm.expect(jsonData.account).to.have.property('id');",
"});",
"",
"",
"var jsonData = pm.response.json();",
"let accountId = jsonData.account.id;",
"postman.setEnvironmentVariable(\"accountId\", accountId);"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"accountName\": \"Mojica\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/accounts?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "accounts"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "List Accounts",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"[salesforce crm] response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"accounts are listed correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('accounts');",
" pm.expect(jsonData.accounts[0]).to.not.be.null;",
" pm.expect(jsonData.accounts[0]).to.have.property('website');",
" pm.expect(jsonData.accounts[0]).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.accounts[0]).to.have.property('industry');",
" pm.expect(jsonData.accounts[0]).to.have.property('addresses');",
" pm.expect(jsonData.accounts[0]).to.have.property('phoneNumbers');",
" pm.expect(jsonData.accounts[0]).to.have.property('remoteId');",
" pm.expect(jsonData.accounts[0]).to.have.property('lastActivityAt');",
" pm.expect(jsonData.accounts[0]).to.have.property('accountOwner');",
" pm.expect(jsonData.accounts[0]).to.have.property('accountName');",
" pm.expect(jsonData.accounts[0]).to.have.property('numberOfEmployees');",
" pm.expect(jsonData.accounts[0]).to.have.property('description');",
" pm.expect(jsonData.accounts[0]).to.have.property('createdTimestamp');",
" pm.expect(jsonData.accounts[0]).to.have.property('id');",
"});",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/accounts?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "accounts"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Account Count",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"[salesforce crm] response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"accounts count is returned\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('count');",
" pm.expect(jsonData.count).to.be.a(\"number\");",
"});",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/accounts/count?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "accounts", "count"],
"query": [
{
"key": "page",
"value": "eyJpdGVtSWQiOnsiUyI6IjEyMCJ9LCJkYXRhQnVja2V0Ijp7IlMiOiI2MmIyYWM5ZGI4NWYzMjAwMTQzMDU5Y2YvYWNjb3VudCJ9fQ==",
"disabled": true
},
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Account",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"[salesforce crm] accounts is returned correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('account');",
" pm.expect(jsonData.account).to.not.be.null;",
" pm.expect(jsonData.account).to.have.property('website');",
" pm.expect(jsonData.account).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.account).to.have.property('industry');",
" pm.expect(jsonData.account).to.have.property('addresses');",
" pm.expect(jsonData.account).to.have.property('phoneNumbers');",
" pm.expect(jsonData.account).to.have.property('remoteId');",
" pm.expect(jsonData.account).to.have.property('lastActivityAt');",
" pm.expect(jsonData.account).to.have.property('accountOwner');",
" pm.expect(jsonData.account).to.have.property('accountName');",
" pm.expect(jsonData.account).to.have.property('numberOfEmployees');",
" pm.expect(jsonData.account).to.have.property('description');",
" pm.expect(jsonData.account).to.have.property('createdTimestamp');",
" pm.expect(jsonData.account).to.have.property('id');",
"});",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/accounts/{{accountId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": [
"{{API_VERSION}}",
"one",
"crm",
"accounts",
"{{accountId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Update Account",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"[salesforce crm] accounts is updated correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('account');",
" pm.expect(jsonData.account).to.not.be.null;",
" pm.expect(jsonData.account).to.have.property('website');",
" pm.expect(jsonData.account).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.account).to.have.property('industry');",
" pm.expect(jsonData.account).to.have.property('addresses');",
" pm.expect(jsonData.account).to.have.property('phoneNumbers');",
" pm.expect(jsonData.account).to.have.property('remoteId');",
" pm.expect(jsonData.account).to.have.property('lastActivityAt');",
" pm.expect(jsonData.account).to.have.property('accountOwner');",
" pm.expect(jsonData.account).to.have.property('accountName');",
" pm.expect(jsonData.account).to.have.property('numberOfEmployees');",
" pm.expect(jsonData.account).to.have.property('description');",
" pm.expect(jsonData.account).to.have.property('createdTimestamp');",
" pm.expect(jsonData.account).to.have.property('id');",
"});",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "PUT",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"industry\": \"Government/Military\",\n \"description\": \"Hello\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/accounts/{{accountId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": [
"{{API_VERSION}}",
"one",
"crm",
"accounts",
"{{accountId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Delete Account",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"account deleted correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('message');",
" pm.expect(jsonData.message).to.be.a(\"string\")",
"});",
"",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/accounts/{{accountId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": [
"{{API_VERSION}}",
"one",
"crm",
"accounts",
"{{accountId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Create Contact",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"contact is created correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('contact');",
" pm.expect(jsonData.contact).to.not.be.null;",
" pm.expect(jsonData.contact).to.have.property('remoteId');",
" pm.expect(jsonData.contact).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.contact).to.have.property('lastActivityAt');",
" pm.expect(jsonData.contact).to.have.property('emailAddresses');",
" pm.expect(jsonData.contact.emailAddresses).is.a('array');",
" pm.expect(jsonData.contact).to.have.property('lastName');",
" pm.expect(jsonData.contact).to.have.property('account');",
" pm.expect(jsonData.contact).to.have.property('addresses');",
" pm.expect(jsonData.contact).to.have.property('phoneNumbers');",
" pm.expect(jsonData.contact).to.have.property('createdTimestamp');",
" pm.expect(jsonData.contact).to.have.property('firstName');",
" pm.expect(jsonData.contact).to.have.property('id');",
"});",
"",
"var jsonData = pm.response.json();",
"let contactId = jsonData.contact.id;",
"let contactRemoteId = jsonData.contact.remoteId;",
"postman.setEnvironmentVariable(\"contactId\", contactId);",
"postman.setEnvironmentVariable(\"contactRemoteId\", contactRemoteId);"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"firstName\": \"Gregg\",\n \"lastName\": \"Mojica\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/contacts/?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "contacts", ""],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "List Contacts",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"contacts are listed correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('contacts');",
" pm.expect(jsonData.contacts[0]).to.not.be.null;",
" pm.expect(jsonData.contacts[0]).to.have.property('remoteId');",
" pm.expect(jsonData.contacts[0]).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.contacts[0]).to.have.property('lastActivityAt');",
" pm.expect(jsonData.contacts[0]).to.have.property('emailAddresses');",
" pm.expect(jsonData.contacts[0].emailAddresses).is.a('array');",
" pm.expect(jsonData.contacts[0]).to.have.property('lastName');",
" pm.expect(jsonData.contacts[0]).to.have.property('account');",
" pm.expect(jsonData.contacts[0]).to.have.property('addresses');",
" pm.expect(jsonData.contacts[0]).to.have.property('phoneNumbers');",
" pm.expect(jsonData.contacts[0]).to.have.property('createdTimestamp');",
" pm.expect(jsonData.contacts[0]).to.have.property('firstName');",
" pm.expect(jsonData.contacts[0]).to.have.property('id');",
"});",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/contacts/?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "contacts", ""],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Contact Count",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"contacts count is returned\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('count');",
" pm.expect(jsonData.count).to.be.a(\"number\");",
"});",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/contacts/count?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "contacts", "count"],
"query": [
{
"key": "page",
"value": "eyJpdGVtSWQiOnsiUyI6IjEyMCJ9LCJkYXRhQnVja2V0Ijp7IlMiOiI2MmIyYWM5ZGI4NWYzMjAwMTQzMDU5Y2YvYWNjb3VudCJ9fQ==",
"disabled": true
},
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Contact",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"contact is returned correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('contact');",
" pm.expect(jsonData.contact).to.not.be.null;",
" pm.expect(jsonData.contact).to.have.property('remoteId');",
" pm.expect(jsonData.contact).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.contact).to.have.property('lastActivityAt');",
" pm.expect(jsonData.contact).to.have.property('emailAddresses');",
" pm.expect(jsonData.contact.emailAddresses).is.a('array');",
" pm.expect(jsonData.contact).to.have.property('lastName');",
" pm.expect(jsonData.contact).to.have.property('account');",
" pm.expect(jsonData.contact).to.have.property('addresses');",
" pm.expect(jsonData.contact).to.have.property('phoneNumbers');",
" pm.expect(jsonData.contact).to.have.property('createdTimestamp');",
" pm.expect(jsonData.contact).to.have.property('firstName');",
" pm.expect(jsonData.contact).to.have.property('id');",
"});",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/contacts/{{contactId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": [
"{{API_VERSION}}",
"one",
"crm",
"contacts",
"{{contactId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Update Contact",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"contact is updated correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('contact');",
" pm.expect(jsonData.contact).to.not.be.null;",
" pm.expect(jsonData.contact).to.have.property('remoteId');",
" pm.expect(jsonData.contact).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.contact).to.have.property('lastActivityAt');",
" pm.expect(jsonData.contact).to.have.property('emailAddresses');",
" pm.expect(jsonData.contact.emailAddresses).is.a('array');",
" pm.expect(jsonData.contact).to.have.property('lastName');",
" pm.expect(jsonData.contact).to.have.property('account');",
" pm.expect(jsonData.contact).to.have.property('addresses');",
" pm.expect(jsonData.contact).to.have.property('phoneNumbers');",
" pm.expect(jsonData.contact).to.have.property('createdTimestamp');",
" pm.expect(jsonData.contact).to.have.property('firstName');",
" pm.expect(jsonData.contact).to.have.property('id');",
"});",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "PUT",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"addresses\": [\n {\n \"country\": \"United States\",\n \"street1\": \"6649 N Blue Gum St\",\n \"state\": \"LA\",\n \"city\": \"New Orleans\",\n \"addressType\": \"mailing\",\n \"postalCode\": \"70116\"\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/contacts/{{contactId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": [
"{{API_VERSION}}",
"one",
"crm",
"contacts",
"{{contactId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Delete Contact",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"contact deleted correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('message');",
" pm.expect(jsonData.message).to.be.a(\"string\")",
"});",
"",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/contacts/{{contactId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": [
"{{API_VERSION}}",
"one",
"crm",
"contacts",
"{{contactId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Create Lead",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"lead is created correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('lead');",
" pm.expect(jsonData.lead).to.not.be.null;",
" pm.expect(jsonData.lead).to.have.property('lastName');",
" pm.expect(jsonData.lead).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.lead).to.have.property('leadOwner');",
" pm.expect(jsonData.lead).to.have.property('addresses');",
" pm.expect(jsonData.lead).to.have.property('phoneNumbers');",
" pm.expect(jsonData.lead).to.have.property('leadTitle');",
" pm.expect(jsonData.lead).to.have.property('firstName');",
" pm.expect(jsonData.lead).to.have.property('leadSource');",
" pm.expect(jsonData.lead).to.have.property('remoteId');",
" pm.expect(jsonData.lead).to.have.property('company');",
" pm.expect(jsonData.lead).to.have.property('emailAddresses');",
" pm.expect(jsonData.lead).to.have.property('createdTimestamp');",
" pm.expect(jsonData.lead).to.have.property('id');",
"});",
"",
"var jsonData = pm.response.json();",
"let leadId = jsonData.lead.id;",
"postman.setEnvironmentVariable(\"leadId\", leadId);"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"lastName\": \"Mojica\",\n \"company\": \"Alloy\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/leads?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "leads"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "List Leads",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"leads are listed correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('leads');",
" pm.expect(jsonData.leads[0]).to.not.be.null;",
" pm.expect(jsonData.leads[0]).to.have.property('lastName');",
" pm.expect(jsonData.leads[0]).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.leads[0]).to.have.property('leadOwner');",
" pm.expect(jsonData.leads[0]).to.have.property('addresses');",
" pm.expect(jsonData.leads[0]).to.have.property('phoneNumbers');",
" pm.expect(jsonData.leads[0]).to.have.property('leadTitle');",
" pm.expect(jsonData.leads[0]).to.have.property('firstName');",
" pm.expect(jsonData.leads[0]).to.have.property('leadSource');",
" pm.expect(jsonData.leads[0]).to.have.property('remoteId');",
" pm.expect(jsonData.leads[0]).to.have.property('company');",
" pm.expect(jsonData.leads[0]).to.have.property('emailAddresses');",
" pm.expect(jsonData.leads[0]).to.have.property('createdTimestamp');",
" pm.expect(jsonData.leads[0]).to.have.property('id');",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/leads?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "leads"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Lead Count",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"lead count is returned\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('count');",
" pm.expect(jsonData.count).to.be.a(\"number\");",
"});",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/leads/count?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "leads", "count"],
"query": [
{
"key": "page",
"value": "eyJpdGVtSWQiOnsiUyI6IjEyMCJ9LCJkYXRhQnVja2V0Ijp7IlMiOiI2MmIyYWM5ZGI4NWYzMjAwMTQzMDU5Y2YvYWNjb3VudCJ9fQ==",
"disabled": true
},
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Lead",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"lead is returned correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('lead');",
" pm.expect(jsonData.lead).to.not.be.null;",
" pm.expect(jsonData.lead).to.have.property('lastName');",
" pm.expect(jsonData.lead).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.lead).to.have.property('leadOwner');",
" pm.expect(jsonData.lead).to.have.property('addresses');",
" pm.expect(jsonData.lead).to.have.property('phoneNumbers');",
" pm.expect(jsonData.lead).to.have.property('leadTitle');",
" pm.expect(jsonData.lead).to.have.property('firstName');",
" pm.expect(jsonData.lead).to.have.property('leadSource');",
" pm.expect(jsonData.lead).to.have.property('remoteId');",
" pm.expect(jsonData.lead).to.have.property('company');",
" pm.expect(jsonData.lead).to.have.property('emailAddresses');",
" pm.expect(jsonData.lead).to.have.property('createdTimestamp');",
" pm.expect(jsonData.lead).to.have.property('id');",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/leads/{{leadId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "leads", "{{leadId}}"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Update Lead",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"leads are updated correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('lead');",
" pm.expect(jsonData.lead).to.not.be.null;",
" pm.expect(jsonData.lead).to.have.property('lastName');",
" pm.expect(jsonData.lead).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.lead).to.have.property('leadOwner');",
" pm.expect(jsonData.lead).to.have.property('addresses');",
" pm.expect(jsonData.lead).to.have.property('phoneNumbers');",
" pm.expect(jsonData.lead).to.have.property('leadTitle');",
" pm.expect(jsonData.lead).to.have.property('firstName');",
" pm.expect(jsonData.lead).to.have.property('leadSource');",
" pm.expect(jsonData.lead).to.have.property('remoteId');",
" pm.expect(jsonData.lead).to.have.property('company');",
" pm.expect(jsonData.lead).to.have.property('emailAddresses');",
" pm.expect(jsonData.lead).to.have.property('createdTimestamp');",
" pm.expect(jsonData.lead).to.have.property('id');",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "PUT",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"addresses\": [\n {\n \"country\": \"United States\",\n \"street1\": \"6649 N Blue Gum St\",\n \"state\": \"LA\",\n \"city\": \"New Orleans\",\n \"addressType\": \"main\",\n \"postalCode\": \"70116\"\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/leads/{{leadId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "leads", "{{leadId}}"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Delete Lead",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"lead deleted correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('message');",
" pm.expect(jsonData.message).to.be.a(\"string\")",
"});",
"",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/leads/{{leadId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "leads", "{{leadId}}"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Create Contact for Note",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"contact is created correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('contact');",
" pm.expect(jsonData.contact).to.not.be.null;",
" pm.expect(jsonData.contact).to.have.property('remoteId');",
" pm.expect(jsonData.contact).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.contact).to.have.property('lastActivityAt');",
" pm.expect(jsonData.contact).to.have.property('emailAddresses');",
" pm.expect(jsonData.contact.emailAddresses).is.a('array');",
" pm.expect(jsonData.contact).to.have.property('lastName');",
" pm.expect(jsonData.contact).to.have.property('account');",
" pm.expect(jsonData.contact).to.have.property('addresses');",
" pm.expect(jsonData.contact).to.have.property('phoneNumbers');",
" pm.expect(jsonData.contact).to.have.property('createdTimestamp');",
" pm.expect(jsonData.contact).to.have.property('firstName');",
" pm.expect(jsonData.contact).to.have.property('id');",
"});",
"",
"var jsonData = pm.response.json();",
"let contactId = jsonData.contact.id;",
"postman.setEnvironmentVariable(\"contactId\", contactId);"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"firstName\": \"Gregg\",\n \"lastName\": \"Mojica\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/contacts/?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "contacts", ""],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Create Note",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"note is created correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('note');",
" pm.expect(jsonData.note).to.not.be.null;",
" pm.expect(jsonData.note).to.have.property('noteOwner');",
" pm.expect(jsonData.note).to.have.property('remoteId');",
" pm.expect(jsonData.note).to.have.property('noteContent');",
" pm.expect(jsonData.note).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.note).to.have.property('noteAccount');",
" pm.expect(jsonData.note).to.have.property('createdTimestamp');",
" pm.expect(jsonData.note).to.have.property('id');",
"});",
"",
"var jsonData = pm.response.json();",
"let noteId = jsonData.note.id;",
"postman.setEnvironmentVariable(\"noteId\", noteId);"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"noteContent\": \"From UAPI\",\n \"noteTitle\": \"test\",\n \"noteContact\": \"{{contactId}}\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/notes?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "notes"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "List Notes",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"notes are listed correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('notes');",
" pm.expect(jsonData.notes[0]).to.not.be.null;",
" pm.expect(jsonData.notes[0]).to.have.property('noteOwner');",
" pm.expect(jsonData.notes[0]).to.have.property('remoteId');",
" pm.expect(jsonData.notes[0]).to.have.property('noteContent');",
" pm.expect(jsonData.notes[0]).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.notes[0]).to.have.property('noteAccount');",
" pm.expect(jsonData.notes[0]).to.have.property('createdTimestamp');",
" pm.expect(jsonData.notes[0]).to.have.property('id');",
"});",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/notes?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "notes"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Note Count",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"notes count is returned\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('count');",
" pm.expect(jsonData.count).to.be.a(\"number\");",
"});",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/notes/count?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "notes", "count"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Note",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"note is returned correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('note');",
" pm.expect(jsonData.note).to.not.be.null;",
" pm.expect(jsonData.note).to.have.property('noteOwner');",
" pm.expect(jsonData.note).to.have.property('remoteId');",
" pm.expect(jsonData.note).to.have.property('noteContent');",
" pm.expect(jsonData.note).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.note).to.have.property('noteAccount');",
" pm.expect(jsonData.note).to.have.property('createdTimestamp');",
" pm.expect(jsonData.note).to.have.property('id');",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/notes/{{noteId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "notes", "{{noteId}}"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Update Note",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"note is updated correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('note');",
" pm.expect(jsonData.note).to.not.be.null;",
" pm.expect(jsonData.note).to.have.property('noteOwner');",
" pm.expect(jsonData.note).to.have.property('remoteId');",
" pm.expect(jsonData.note).to.have.property('noteContent');",
" pm.expect(jsonData.note).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.note).to.have.property('noteAccount');",
" pm.expect(jsonData.note).to.have.property('createdTimestamp');",
" pm.expect(jsonData.note).to.have.property('id');",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "PUT",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"noteContent\": \"From UAPI Updated Again\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/notes/{{noteId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "notes", "{{noteId}}"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Delete Note",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"note deleted correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('message');",
" pm.expect(jsonData.message).to.be.a(\"string\")",
"});",
"",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/notes/{{noteId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "notes", "{{noteId}}"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Create Task",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"task is created correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('task');",
" pm.expect(jsonData.task).to.not.be.null;",
" pm.expect(jsonData.task).to.have.property('remoteId');",
" pm.expect(jsonData.task).to.have.property('taskContent');",
" pm.expect(jsonData.task).to.have.property('taskSubject');",
" pm.expect(jsonData.task).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.task).to.have.property('taskStatus');",
" pm.expect(jsonData.task).to.have.property('dueDate');",
" pm.expect(jsonData.task).to.have.property('taskOwner');",
" pm.expect(jsonData.task).to.have.property('createdTimestamp');",
" pm.expect(jsonData.task).to.have.property('id');",
"});",
"",
"var jsonData = pm.response.json();",
"let taskId = jsonData.task.id;",
"postman.setEnvironmentVariable(\"taskId\", taskId);"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"taskSubject\": \"Mappings\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/tasks?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "tasks"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "List Tasks",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"tasks are listed correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('tasks');",
" pm.expect(jsonData.tasks[0]).to.not.be.null;",
" pm.expect(jsonData.tasks[0]).to.have.property('remoteId');",
" pm.expect(jsonData.tasks[0]).to.have.property('taskContent');",
" pm.expect(jsonData.tasks[0]).to.have.property('taskSubject');",
" pm.expect(jsonData.tasks[0]).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.tasks[0]).to.have.property('taskStatus');",
" pm.expect(jsonData.tasks[0]).to.have.property('dueDate');",
" pm.expect(jsonData.tasks[0]).to.have.property('taskOwner');",
" pm.expect(jsonData.tasks[0]).to.have.property('createdTimestamp');",
" pm.expect(jsonData.tasks[0]).to.have.property('id');",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/tasks?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "tasks"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Task Count",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"task count is returned\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('count');",
" pm.expect(jsonData.count).to.be.a(\"number\");",
"});",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/tasks/count?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "tasks", "count"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Task",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"tasks is returned correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('task');",
" pm.expect(jsonData.task).to.not.be.null;",
" pm.expect(jsonData.task).to.have.property('remoteId');",
" pm.expect(jsonData.task).to.have.property('taskContent');",
" pm.expect(jsonData.task).to.have.property('taskSubject');",
" pm.expect(jsonData.task).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.task).to.have.property('taskStatus');",
" pm.expect(jsonData.task).to.have.property('dueDate');",
" pm.expect(jsonData.task).to.have.property('taskOwner');",
" pm.expect(jsonData.task).to.have.property('createdTimestamp');",
" pm.expect(jsonData.task).to.have.property('id');",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/tasks/{{taskId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "tasks", "{{taskId}}"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Update Task",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"task is updated correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('task');",
" pm.expect(jsonData.task).to.not.be.null;",
" pm.expect(jsonData.task).to.have.property('remoteId');",
" pm.expect(jsonData.task).to.have.property('taskContent');",
" pm.expect(jsonData.task).to.have.property('taskSubject');",
" pm.expect(jsonData.task).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.task).to.have.property('taskStatus');",
" pm.expect(jsonData.task).to.have.property('dueDate');",
" pm.expect(jsonData.task).to.have.property('taskOwner');",
" pm.expect(jsonData.task).to.have.property('createdTimestamp');",
" pm.expect(jsonData.task).to.have.property('id');",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "PUT",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"taskContent\": \"Task Content\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/tasks/{{taskId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "tasks", "{{taskId}}"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Delete Task",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"task deleted correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('message');",
" pm.expect(jsonData.message).to.be.a(\"string\")",
"});",
"",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/tasks/{{taskId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "tasks", "{{taskId}}"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Create Opportunity",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"opportunity is created correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('opportunity');",
" pm.expect(jsonData.opportunity).to.not.be.null;",
" pm.expect(jsonData.opportunity).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.opportunity).to.have.property('opportunityStage');",
" pm.expect(jsonData.opportunity).to.have.property('opportunityOwner');",
" pm.expect(jsonData.opportunity).to.have.property('remoteId');",
" pm.expect(jsonData.opportunity).to.have.property('opportunityName');",
" pm.expect(jsonData.opportunity).to.have.property('lastActivityAt');",
" pm.expect(jsonData.opportunity).to.have.property('amount');",
" pm.expect(jsonData.opportunity).to.have.property('closeDate');",
" pm.expect(jsonData.opportunity).to.have.property('createdTimestamp');",
" pm.expect(jsonData.opportunity).to.have.property('opportunityAccount');",
" pm.expect(jsonData.opportunity).to.have.property('opportunityDescription');",
" pm.expect(jsonData.opportunity).to.have.property('id');",
"});",
"",
"var jsonData = pm.response.json();",
"let opportunityId = jsonData.opportunity.id;",
"postman.setEnvironmentVariable(\"opportunityId\", opportunityId);"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"opportunityName\": \"UAPI 1\",\n \"opportunityStage\": \"appointmentscheduled\",\n \"closeDate\": \"2023-11-17\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/opportunities?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "opportunities"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "List Opportunities",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"opportunities are listed correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('opportunities');",
" pm.expect(jsonData.opportunities[0]).to.not.be.null;",
" pm.expect(jsonData.opportunities[0]).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.opportunities[0]).to.have.property('opportunityStage');",
" pm.expect(jsonData.opportunities[0]).to.have.property('opportunityOwner');",
" pm.expect(jsonData.opportunities[0]).to.have.property('remoteId');",
" pm.expect(jsonData.opportunities[0]).to.have.property('opportunityName');",
" pm.expect(jsonData.opportunities[0]).to.have.property('lastActivityAt');",
" pm.expect(jsonData.opportunities[0]).to.have.property('amount');",
" pm.expect(jsonData.opportunities[0]).to.have.property('closeDate');",
" pm.expect(jsonData.opportunities[0]).to.have.property('createdTimestamp');",
" pm.expect(jsonData.opportunities[0]).to.have.property('opportunityAccount');",
" pm.expect(jsonData.opportunities[0]).to.have.property('opportunityDescription');",
" pm.expect(jsonData.opportunities[0]).to.have.property('id');",
"});",
"",
"var jsonData = pm.response.json();",
"let opportunityId = jsonData.opportunities[0].id;",
"postman.setEnvironmentVariable(\"opportunityId\", opportunityId);"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/opportunities?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "opportunities"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Opportunity Count",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"opportunity count is returned\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('count');",
" pm.expect(jsonData.count).to.be.a(\"number\");",
"});",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/opportunities/count?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "opportunities", "count"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Opportunity",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"opportunity is created correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('opportunity');",
" pm.expect(jsonData.opportunity).to.not.be.null;",
" pm.expect(jsonData.opportunity).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.opportunity).to.have.property('opportunityStage');",
" pm.expect(jsonData.opportunity).to.have.property('opportunityOwner');",
" pm.expect(jsonData.opportunity).to.have.property('remoteId');",
" pm.expect(jsonData.opportunity).to.have.property('opportunityName');",
" pm.expect(jsonData.opportunity).to.have.property('lastActivityAt');",
" pm.expect(jsonData.opportunity).to.have.property('amount');",
" pm.expect(jsonData.opportunity).to.have.property('closeDate');",
" pm.expect(jsonData.opportunity).to.have.property('createdTimestamp');",
" pm.expect(jsonData.opportunity).to.have.property('opportunityAccount');",
" pm.expect(jsonData.opportunity).to.have.property('opportunityDescription');",
" pm.expect(jsonData.opportunity).to.have.property('id');",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/opportunities/{{opportunityId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": [
"{{API_VERSION}}",
"one",
"crm",
"opportunities",
"{{opportunityId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Update Opportunity",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"opportunity is updated correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('opportunity');",
" pm.expect(jsonData.opportunity).to.not.be.null;",
" pm.expect(jsonData.opportunity).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.opportunity).to.have.property('opportunityStage');",
" pm.expect(jsonData.opportunity).to.have.property('opportunityOwner');",
" pm.expect(jsonData.opportunity).to.have.property('remoteId');",
" pm.expect(jsonData.opportunity).to.have.property('opportunityName');",
" pm.expect(jsonData.opportunity).to.have.property('lastActivityAt');",
" pm.expect(jsonData.opportunity).to.have.property('amount');",
" pm.expect(jsonData.opportunity).to.have.property('closeDate');",
" pm.expect(jsonData.opportunity).to.have.property('createdTimestamp');",
" pm.expect(jsonData.opportunity).to.have.property('opportunityAccount');",
" pm.expect(jsonData.opportunity).to.have.property('opportunityDescription');",
" pm.expect(jsonData.opportunity).to.have.property('id');",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "PUT",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"opportunityName\": \"UAPI 2\",\n \"opportunityStage\": \"appointmentscheduled\",\n \"closeDate\": \"2023-11-17\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/opportunities/{{opportunityId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": [
"{{API_VERSION}}",
"one",
"crm",
"opportunities",
"{{opportunityId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Delete Opportunity",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"opportunity deleted correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('message');",
" pm.expect(jsonData.message).to.be.a(\"string\")",
"});",
"",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/crm/opportunities/{{opportunityId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": [
"{{API_VERSION}}",
"one",
"crm",
"opportunities",
"{{opportunityId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
}
],
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "",
"type": "string"
}
]
},
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [""]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [""]
}
}
],
"variable": [
{
"key": "api_base_url",
"value": "http://localhost:4040",
"type": "string"
},
{
"key": "embedded_api_base_url",
"value": "http://localhost:1234",
"type": "string"
}
]
}