Skip to main content
Version: 1.1.0

Hubspot

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": "06e4449a-a0fa-483d-9ee4-36da4bc8783c",
"name": "Hubspot – 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(\"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(\"[hubspot] 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;",
"let accountRemoteId = jsonData.account.remoteId;",
"console.log('HAS ACCOUNT REMOTE ID',accountRemoteId)",
"postman.setEnvironmentVariable(\"accountId\", accountId);",
"postman.setEnvironmentVariable(\"accountRemoteId\", accountRemoteId);"
],
"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(\"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(\"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(\"[hubspot] 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": "",
"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(\"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(\"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\": \"ACCOUNTING\",\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": "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;",
"console.log('Has remote id: ',contactRemoteId);",
"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(\"[hubspot] 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(\"[hubspot] 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(\"[hubspot] 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(\"[hubspot] 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(\"[hubspot] 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 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(\"[hubspot] 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(\"[hubspot] 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();",
"console.log(jsonData);",
"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 \"noteAccount\": \"{{accountId}}\"\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(\"[hubspot] 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(\"[hubspot] 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(\"[hubspot] 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(\"[hubspot] 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(\"[hubspot] 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(\"[hubspot] 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(\"[hubspot] 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(\"[hubspot] 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(\"[hubspot] 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(\"[hubspot] 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(\"[hubspot] 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(\"[hubspot] 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(\"[hubspot] 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(\"[hubspot] 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": "List Users",
"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(\"users are listed correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('users');",
" pm.expect(jsonData.users[0]).to.not.be.null;",
" pm.expect(jsonData.users[0]).to.have.property('remoteId');",
" pm.expect(jsonData.users[0]).to.have.property('userLastName');",
" pm.expect(jsonData.users[0]).to.have.property('isActive');",
" pm.expect(jsonData.users[0]).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.users[0]).to.have.property('userEmail');",
" pm.expect(jsonData.users[0]).to.have.property('userFirstName');",
" pm.expect(jsonData.users[0]).to.have.property('createdTimestamp');",
" pm.expect(jsonData.users[0]).to.have.property('id');",
"});",
"",
"var jsonData = pm.response.json();",
"console.log(jsonData);",
"let userId = jsonData.users[0].id;",
"postman.setEnvironmentVariable(\"userId\", userId);"
],
"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/users?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "users"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get User 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(\"[hubspot] 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(\"[hubspott] 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/users/count?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "users", "count"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get User",
"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(\"[hubspot] 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(\"[hubspot] users is returned correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('user');",
" pm.expect(jsonData.user).to.not.be.null;",
" pm.expect(jsonData.user).to.have.property('remoteId');",
" pm.expect(jsonData.user).to.have.property('userLastName');",
" pm.expect(jsonData.user).to.have.property('isActive');",
" pm.expect(jsonData.user).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.user).to.have.property('userEmail');",
" pm.expect(jsonData.user).to.have.property('userFirstName');",
" pm.expect(jsonData.user).to.have.property('createdTimestamp');",
" pm.expect(jsonData.user).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/users/{{userId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "crm", "users", "{{userId}}"],
"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(\"[hubspot] 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(\"[hubspot] 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(\"[hubspot] 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');",
"});",
""
],
"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(\"[hubspot] 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(\"[hubspot] opportunity is returned 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(\"[hubspot] 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(\"[hubspot] 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": []
},
{
"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": []
}
],
"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"
}
]
}