diff --git a/extract/index.js b/extract/index.js index 44d9379..4f464f9 100644 --- a/extract/index.js +++ b/extract/index.js @@ -50,21 +50,37 @@ function createPostmanOutput(data){ description: "", item: [] } - categoryData.forEach(function(item){ - var code = item.code.replace(/^\#.*\n/m,"").replace(/^\$ /, "").replace(/-d'$/m, "-d '").replace(/:Bearer/gm, ": Bearer").replace(/:application/gm, ": application"); - var curl = parse(code); + if (!item.code.match(/curl/)) return; + var code = item.code.replace(/^\#.*\n/m,"").replace(/^\$ /, "").replace(/-d'$/m, "-d '").replace(/:Bearer/gm, ": Bearer").replace(/:application/gm, ": application").replace(/curl \\/gm, "curl "); + if(code.match(/-d\s*$/m)){ + code = code.replace(/-d\s*$/m, "-d '"); + code += "'"; + code = code.replace(/-d ''/m,""); + } + var curl = null; + var extra = ""; + try + { + curl = parse(code); + } + catch(e){ + } + if(!curl){ console.error("=======================================================================================\n" + - "ERROR: Can't parse curl for " + category + ": " + item.header + (item.subheader ? " (" + item.subheader + ")": "") +"\n" + - "---------------------------------------------------------------------------------------\n", - item.code); + "ERROR: Can't parse curl for " + category + ": " + item.header + (item.subheader ? " (" + item.subheader + ")": "") +"\n" + + "---------------------------------------------------------------------------------------\n", + ); + console.error("original code\n", item.code); + console.error("sanitized code\name", code); } else{ postmanCategoryOutput.item.push(createPostmanEntry(item, curl)); } }); - postmanItems.push(postmanCategoryOutput); + if(postmanCategoryOutput.item.length > 0) + postmanItems.push(postmanCategoryOutput); } return { "variables": [], @@ -91,7 +107,10 @@ function createPostmanEntry(item, curl){ } var name = item.header; if(item.subheader) { - name += " (" + item.subheader + ")"; + item.subheader = item.subheader.replace(/Request & Response\s*/g, ""); + if(item.subheader){ + name += " (" + item.subheader + ")"; + } } var entry = { "name": name, @@ -173,6 +192,11 @@ function convertDeveloperWebsiteHTMLToJson(body){ return entries; } +function createPostmanCollection(input, output){ + var postmanOutput = createPostmanOutput(readJsonFromFile(input)); + writeJSONToFile(postmanOutput,output); +} + //////////////////////////////////////////////////////////////////// // look for all code blocks in this section/item @@ -257,21 +281,27 @@ function findBlock(text, type, start_text, end_text, start_position) // Do the download and extraction console.log(`Downloading dev docs: ${URL}....`); -request.get(URL, function (error, response, body) { - error = false; - if(error){ - console.error("ERROR: Could not download page", error); - } - else { - // body = readFile(outputTempDevDocsHTML) - writeToFile(body, outputTempDevDocsHTML); - if (response.statusCode != 200){ - console.warn("WARNING: Expected response code of 200 but got " + response.statusCode + ". Data may not be properly returned but will try parsing anyway"); + +const do_download = false; +if(do_download){ + request.get(URL, function (error, response, body) { + error = false; + if(error){ + console.error("ERROR: Could not download page", error); } - var entries = convertDeveloperWebsiteHTMLToJson(body); - writeJSONToFile(entries, outputTempDevDocsToJsonFile); - var postmanOutput = createPostmanOutput(readJsonFromFile(outputTempDevDocsToJsonFile)); - writeJSONToFile(postmanOutput,outputFinalPostmanFile); - } -}); + else { + writeToFile(body, outputTempDevDocsHTML); + if (response.statusCode != 200){ + console.warn("WARNING: Expected response code of 200 but got " + response.statusCode + ". Data may not be properly returned but will try parsing anyway"); + } + var entries = convertDeveloperWebsiteHTMLToJson(body); + writeJSONToFile(entries, outputTempDevDocsToJsonFile); + createPostmanCollection(outputTempDevDocsToJsonFile, outputFinalPostmanFile); + } + }); +} +else{ + createPostmanCollection(outputTempDevDocsToJsonFile, outputFinalPostmanFile); +} + diff --git a/intercom-postman-collection.json b/intercom-postman-collection.json index 23fa2e6..cd9d702 100644 --- a/intercom-postman-collection.json +++ b/intercom-postman-collection.json @@ -1,20 +1,20 @@ { "variables": [], "info": { - "name": "Intercom API (v 1.4)", + "name": "Intercom API (v 2.0)", "description": "A collection of examples of how to interact with the various endpoints of the Intercom API based on https://developers.intercom.com/reference", "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" }, "item": [ { - "name": "Users", + "name": "Common Structures", "description": "", "item": [ { - "name": "Create or Update User (Create or Update Users)", + "name": "Pagination (Cursor) (Initial)", "request": { - "url": "https://api.intercom.io/users", - "method": "POST", + "url": "https://api.intercom.io/contacts?per_page=5", + "method": "GET", "header": [ { "key": "Authorization", @@ -25,26 +25,23 @@ "key": "Accept", "value": "application/json", "description": "" - }, - { - "key": "Content-Type", - "value": "application/json", - "description": "" } ], - "description": "", - "body": { - "mode": "raw", - "raw": "\n{\n \"user_id\": \"25\",\n \"email\": \"wash@serenity.io\",\n \"name\": \"Hoban Washburne\",\n \"phone\": \"555671243\",\n \"signed_up_at\": 1392731331,\n \"custom_attributes\": {\n \"paid_subscriber\" : true,\n \"monthly_spend\": 155.5,\n \"team_mates\": 9,\n \"last_order_at\":1475569818\n },\n \"companies\": [\n {\n \"company_id\" : \"366\",\n \"name\" : \"Serenity\",\n \"monthly_spend\" : 500\n }\n ]\n}" - } + "description": "" }, "response": [] - }, + } + ] + }, + { + "name": "Contacts", + "description": "", + "item": [ { - "name": "View a User (ID)", + "name": "Create a contact", "request": { - "url": "https://api.intercom.io/users/5714dd359a3fd47136000001", - "method": "GET", + "url": "https://api.intercom.io/contacts", + "method": "POST", "header": [ { "key": "Authorization", @@ -55,37 +52,25 @@ "key": "Accept", "value": "application/json", "description": "" - } - ], - "description": "" - }, - "response": [] - }, - { - "name": "View a User (User ID)", - "request": { - "url": "https://api.intercom.io/users?user_id=25", - "method": "GET", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{AccessToken}}", - "description": "" }, { - "key": "Accept", - "value": "application/json", + "key": "Content-Type", + "value": "application/x-www-form-urlencoded", "description": "" } ], - "description": "" + "description": "", + "body": { + "mode": "raw", + "raw": "\n{\n\t\"role\": \"user\",\n\t\"external_id\": \"25\",\n\t\"email\": \"wash@serenity.io\",\n\t\"phone\": \"+1123456789\",\n\t\"name\": \"Hoban Washburn\",\n\t\"avatar\": \"https://example.org/128Wash.jpg\",\n\t\"last_seen_at\": 1571069751,\n\t\"signed_up_at\": 1571069751,\n\t\"owner_id\": 127,\n\t\"unsubscribed_from_emails\": false,\n\t\"custom_attributes\": {\n\t\t\"paid_subscriber\": true,\n\t\t\"monthly_spend\": 155.5,\n\t\t\"team_mates\": 1\n\t}\n}\n" + } }, "response": [] }, { - "name": "View a User (Email)", + "name": "Retrieve a contact", "request": { - "url": "https://api.intercom.io/users?email=wash%40serenity.io", + "url": "https://api.intercom.io/contacts/", "method": "GET", "header": [ { @@ -104,10 +89,10 @@ "response": [] }, { - "name": "Updating the Last Seen Time (Update for Last Seen Time)", + "name": "Update a contact", "request": { - "url": "https://api.intercom.io/users", - "method": "POST", + "url": "https://api.intercom.io/contacts/", + "method": "PUT", "header": [ { "key": "Authorization", @@ -121,23 +106,23 @@ }, { "key": "Content-Type", - "value": "application/json", + "value": "application/x-www-form-urlencoded", "description": "" } ], "description": "", "body": { "mode": "raw", - "raw": "\n{\n \"user_id\": \"25\",\n \"last_request_at\": 1480076371\n}" + "raw": "\n{\n\t\"role\": \"user\",\n\t\"external_id\": \"25\",\n\t\"email\": \"wash@serenity.io\",\n\t\"phone\": \"+1123456789\",\n\t\"name\": \"Hoban Washburn\",\n\t\"avatar\": \"https://example.org/128Wash.jpg\",\n\t\"last_seen_at\": 1571069751,\n\t\"signed_up_at\": 1571069751,\n\t\"owner_id\": 127,\n\t\"unsubscribed_from_emails\": false,\n\t\"custom_attributes\": {\n\t\t\"paid_subscriber\": true,\n\t\t\"monthly_spend\": 155.5,\n\t\t\"team_mates\": 1\n\t}\n}\n" } }, "response": [] }, { - "name": "Companies and Users (Associate a Company with a User)", + "name": "Delete a contact", "request": { - "url": "https://api.intercom.io/users", - "method": "POST", + "url": "https://api.intercom.io/contacts/", + "method": "DELETE", "header": [ { "key": "Authorization", @@ -148,25 +133,16 @@ "key": "Accept", "value": "application/json", "description": "" - }, - { - "key": "Content-Type", - "value": "application/json", - "description": "" } ], - "description": "", - "body": { - "mode": "raw", - "raw": "\n{\n \"id\": \"531ee472cce572a6ec000005\",\n \"companies\": [\n {\n \"company_id\" : \"366\",\n \"name\" : \"Serenity\"\n }\n ]\n}" - } + "description": "" }, "response": [] }, { - "name": "Companies and Users (Remove a User from a Company)", + "name": "Merge two contacts", "request": { - "url": "https://api.intercom.io/users", + "url": "https://api.intercom.io/contacts/merge", "method": "POST", "header": [ { @@ -181,43 +157,22 @@ }, { "key": "Content-Type", - "value": "application/json", + "value": "application/x-www-form-urlencoded", "description": "" } ], "description": "", "body": { "mode": "raw", - "raw": "\n{\n \"id\": \"531ee472cce572a6ec000005\",\n \"companies\": [\n {\n \"company_id\" : \"3\",\n \"remove\" : true\n }\n ]\n}" + "raw": "\n{\n \"from\": \"5d70dd30de4efd54f42fd526\",\n \"into\": \"5ba682d23d7cf92bef87bfd4\"\n}\n" } }, "response": [] }, { - "name": "List Users (List Users Example)", - "request": { - "url": "https://api.intercom.io/users", - "method": "GET", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{AccessToken}}", - "description": "" - }, - { - "key": "Accept", - "value": "application/json", - "description": "" - } - ], - "description": "" - }, - "response": [] - }, - { - "name": "List by Email (List Users by Email)", + "name": "List all contacts", "request": { - "url": "https://api.intercom.io/users?email=test@test.com", + "url": "https://api.intercom.io/contacts", "method": "GET", "header": [ { @@ -229,11 +184,6 @@ "key": "Accept", "value": "application/json", "description": "" - }, - { - "key": "Intercom-Version", - "value": "1.1", - "description": "" } ], "description": "" @@ -241,9 +191,9 @@ "response": [] }, { - "name": "List by Tag, Segment, Company (Tag)", + "name": "List attached companies", "request": { - "url": "https://api.intercom.io/users?tag_id=3142", + "url": "https://api.intercom.io/contacts//companies", "method": "GET", "header": [ { @@ -262,9 +212,9 @@ "response": [] }, { - "name": "List by Tag, Segment, Company (Segment)", + "name": "List attached tags", "request": { - "url": "https://api.intercom.io/users?segment_id=5926", + "url": "https://api.intercom.io/contacts//tags", "method": "GET", "header": [ { @@ -281,11 +231,17 @@ "description": "" }, "response": [] - }, + } + ] + }, + { + "name": "Visitors", + "description": "", + "item": [ { - "name": "Scroll over all users", + "name": "Retrieve a visitor (ID)", "request": { - "url": "https://api.intercom.io/users/scroll?scroll_param=562bc29f-ea55-4823-aaaf-f3faadceaa59", + "url": "https://api.intercom.io/visitors?user_id=16e690c0-485a-4e87-ae98-a326e788a4f7", "method": "GET", "header": [ { @@ -304,10 +260,10 @@ "response": [] }, { - "name": "Archive a user (ID Archive)", + "name": "Update a visitor", "request": { - "url": "https://api.intercom.io/users/5321a20f72cdbb4192000013", - "method": "DELETE", + "url": "https://api.intercom.io/visitors", + "method": "PUT", "header": [ { "key": "Authorization", @@ -318,37 +274,25 @@ "key": "Accept", "value": "application/json", "description": "" - } - ], - "description": "" - }, - "response": [] - }, - { - "name": "Archive a user (User ID Archive)", - "request": { - "url": "https://api.intercom.io/users?user_id=25", - "method": "DELETE", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{AccessToken}}", - "description": "" }, { - "key": "Accept", + "key": "Content-Type", "value": "application/json", "description": "" } ], - "description": "" + "description": "", + "body": { + "mode": "raw", + "raw": "\n{\n \"user_id\": \"124\",\n \"name\": \"Winston Smith\",\n \"custom_attributes\": {\n \"paid_subscriber\" : true,\n \"monthly_spend\": 155.5,\n \"team_mates\": 9\n }\n}" + } }, "response": [] }, { - "name": "Archive a user (User Email Archive)", + "name": "Delete a visitor", "request": { - "url": "https://api.intercom.io/users?email=wash%40serenity.io", + "url": "https://api.intercom.io/visitors/", "method": "DELETE", "header": [ { @@ -367,9 +311,9 @@ "response": [] }, { - "name": "Permanently delete a user (Permanently delete users)", + "name": "Convert a visitor", "request": { - "url": "https://api.intercom.io/user_delete_requests", + "url": "https://api.intercom.io/visitors/convert", "method": "POST", "header": [ { @@ -391,7 +335,7 @@ "description": "", "body": { "mode": "raw", - "raw": "\n{\n \"intercom_user_id\": \"530370b477ad7120001d\"\n}" + "raw": "\n{\n \"visitor\": {\n \"user_id\": \"8a88a590-e1c3-41e2-a502-e0649dbf721c\"\n },\n \"user\": {\n \"email\": \"winstonsmith@truth.org\"\n },\n \"type\": \"user\"\n}" } }, "response": [] @@ -399,13 +343,13 @@ ] }, { - "name": "Leads", + "name": "Companies", "description": "", "item": [ { - "name": "Create Lead", + "name": "Create or update a company", "request": { - "url": "https://api.intercom.io/contacts", + "url": "https://api.intercom.io/companies", "method": "POST", "header": [ { @@ -427,15 +371,36 @@ "description": "", "body": { "mode": "raw", - "raw": "\n{\n \"phone\": \"123987456\",\n \"email\": \"winstonsmith@truth.org\",\n \"name\": \"Winston Smith\"\n}" + "raw": "\n{\n \"name\": \"Blue Sun\",\n \"plan\": \"Paid\",\n \"company_id\": \"6\",\n \"remote_created_at\": 1394531169,\n \"size\": 750,\n \"website\": \"http://www.example.com\",\n \"industry\": \"Manufacturing\",\n \"custom_attributes\": {\n \"paid_subscriber\" : true,\n \"team_mates\": 0,\n \"monthly_spend\": 155.98\n }\n}" } }, "response": [] }, { - "name": "Update Lead", + "name": "Retrieve a company", "request": { - "url": "https://api.intercom.io/contacts", + "url": "https://api.intercom.io/companies?company_id=141", + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{AccessToken}}", + "description": "" + }, + { + "key": "Accept", + "value": "application/json", + "description": "" + } + ], + "description": "" + }, + "response": [] + }, + { + "name": "Attach a contact", + "request": { + "url": "https://api.intercom.io/contacts//companies", "method": "POST", "header": [ { @@ -450,23 +415,23 @@ }, { "key": "Content-Type", - "value": "application/json", + "value": "application/x-www-form-urlencoded", "description": "" } ], "description": "", "body": { "mode": "raw", - "raw": "\n{\n \"id\": \"5811f6bbe6b4704ddfa84ac0\",\n \"user_id\": \"77177570-cf5d-4f1a-bc75-75202af47d4f\",\n \"phone\": \"123987456\",\n \"email\": \"obrien@truth.org\",\n \"name\": \"OBrien\",\n \"custom_attributes\": {\n \"paid_subscriber\" : true,\n \"monthly_spend\": 155.5,\n \"team_mates\": 9\n }\n}" + "raw": "\n{\n\t\"id\": \"56cde0cc3deab1bd8c000100\"\n}\n" } }, "response": [] }, { - "name": "View a Lead (ID)", + "name": "Detach a contact", "request": { - "url": "https://api.intercom.io/contacts?user_id=77177570-cf5d-4f1a-bc75-75202af47d4f", - "method": "GET", + "url": "https://api.intercom.io/contacts//companies", + "method": "DELETE", "header": [ { "key": "Authorization", @@ -484,9 +449,9 @@ "response": [] }, { - "name": "List Leads", + "name": "List all companies (List companies)", "request": { - "url": "https://api.intercom.io/contacts", + "url": "https://api.intercom.io/companies", "method": "GET", "header": [ { @@ -505,9 +470,9 @@ "response": [] }, { - "name": "List by Email", + "name": "Scroll over all companies", "request": { - "url": "https://api.intercom.io/contacts?email=obrien@truth.org", + "url": "https://api.intercom.io/companies/scroll?scroll_param=562bc29f-ea55-4823-aaaf-f3faadceaa59", "method": "GET", "header": [ { @@ -526,9 +491,9 @@ "response": [] }, { - "name": "List by Phone", + "name": "List attached contacts", "request": { - "url": "https://api.intercom.io/contacts?phone=00353875551234", + "url": "https://api.intercom.io/companies//contacts", "method": "GET", "header": [ { @@ -545,12 +510,18 @@ "description": "" }, "response": [] - }, + } + ] + }, + { + "name": "Data Attributes", + "description": "", + "item": [ { - "name": "Delete a Lead (ID Delete)", + "name": "Create a data attribute (Requests & Response)", "request": { - "url": "https://api.intercom.io/contacts/5811f6bbe6b4704ddfa84ac0", - "method": "DELETE", + "url": "https://api.intercom.io/data_attributes", + "method": "POST", "header": [ { "key": "Authorization", @@ -561,17 +532,26 @@ "key": "Accept", "value": "application/json", "description": "" + }, + { + "key": "Content-Type", + "value": "application/json", + "description": "" } ], - "description": "" + "description": "", + "body": { + "mode": "raw", + "raw": "\n{\n \"name\": \"list_cda\",\n \"description\": \"You are either alive or dead\",\n \"data_type\": \"options\",\n \"company\": false,\n \"options\": [\n {\"value\": \"alive\"},\n {\"value\": \"dead\"}\n ]\n}" + } }, "response": [] }, { - "name": "Convert a Lead (Lead Convert)", + "name": "Update a data attribute", "request": { - "url": "https://api.intercom.io/contacts/convert", - "method": "POST", + "url": "https://api.intercom.io/data_attributes/163728", + "method": "PUT", "header": [ { "key": "Authorization", @@ -592,15 +572,15 @@ "description": "", "body": { "mode": "raw", - "raw": "\n{\n \"contact\": {\n \"user_id\": \"8a88a590-e1c3-41e2-a502-e0649dbf721c\"\n },\n \"user\": {\n \"email\": \"winstonsmith@truth.org\"\n }\n}" + "raw": "\n{\n \"description\": \"You are either great or bad\",\n \"options\": [\n {\"value\": \"great\"},\n {\"value\": \"bad\"}\n ]\n}" } }, "response": [] }, { - "name": "Scroll over all leads", + "name": "List all data attributes", "request": { - "url": "https://api.intercom.io/contacts/scroll?scroll_param=562bc29f-ea55-4823-aaaf-f3faadceaa59", + "url": "https://api.intercom.io/data_attributes?model=contact", "method": "GET", "header": [ { @@ -621,14 +601,14 @@ ] }, { - "name": "Visitors", + "name": "Data Events", "description": "", "item": [ { - "name": "View a Visitor (ID)", + "name": "The data event model (Event Object)", "request": { - "url": "https://api.intercom.io/visitors?user_id=16e690c0-485a-4e87-ae98-a326e788a4f7", - "method": "GET", + "url": "https://api.intercom.io/events", + "method": "POST", "header": [ { "key": "Authorization", @@ -636,31 +616,30 @@ "description": "" }, { - "key": "Accept", + "key": "Content-Type", "value": "application/json", "description": "" } ], - "description": "" + "description": "", + "body": { + "mode": "raw", + "raw": "\n{\n \"event_name\" : \"invited-friend\",\n \"created_at\": 1389913941,\n \"user_id\": \"314159\",\n \"metadata\": {\n \"invitee_email\": \"pi@example.org\",\n \"invite_code\": \"ADDAFRIEND\"\n }\n}" + } }, "response": [] }, { - "name": "Update a Visitor", + "name": "Submit a data event (Submit an Event)", "request": { - "url": "https://api.intercom.io/visitors", - "method": "PUT", + "url": "https://api.intercom.io/events", + "method": "POST", "header": [ { "key": "Authorization", "value": "Bearer {{AccessToken}}", "description": "" }, - { - "key": "Accept", - "value": "application/json", - "description": "" - }, { "key": "Content-Type", "value": "application/json", @@ -670,16 +649,16 @@ "description": "", "body": { "mode": "raw", - "raw": "\n{\n \"user_id\": \"124\",\n \"name\": \"Winston Smith\",\n \"custom_attributes\": {\n \"paid_subscriber\" : true,\n \"monthly_spend\": 155.5,\n \"team_mates\": 9\n }\n}" + "raw": "\n{\n \"event_name\" : \"placed-order\",\n \"created_at\": 1389913941,\n \"user_id\": \"314159\",\n \"metadata\": {\n \"order_date\": 1392036272,\n \"stripe_invoice\": \"inv_3434343434\",\n \"order_number\": {\n \"value\":\"3434-3434\",\n \"url\": \"https://example.org/orders/3434-3434\"\n },\n \"price\": {\n \"currency\":\"usd\",\n \"amount\": 2999\n }\n }\n}" } }, "response": [] }, { - "name": "Delete a visitor (ID Delete)", + "name": "List all data events (List all customer events)", "request": { - "url": "https://api.intercom.io/visitors/5321a20f72cdbb4192000013", - "method": "DELETE", + "url": "https://api.intercom.io/events?type=user&user_id=314159", + "method": "GET", "header": [ { "key": "Authorization", @@ -695,11 +674,17 @@ "description": "" }, "response": [] - }, + } + ] + }, + { + "name": "Tags", + "description": "", + "item": [ { - "name": "Convert a Visitor to a Lead (Lead Convert)", + "name": "Create or update a tag", "request": { - "url": "https://api.intercom.io/visitors/convert", + "url": "https://api.intercom.io/tags", "method": "POST", "header": [ { @@ -721,16 +706,16 @@ "description": "", "body": { "mode": "raw", - "raw": "\n{\n \"visitor\": {\n \"user_id\": \"8a88a590-e1c3-41e2-a502-e0649dbf721c\"\n },\n \"type\": \"lead\"\n}" + "raw": "\n{\n \"name\": \"Independent\"\n}" } }, "response": [] }, { - "name": "Convert a Visitor to a User", + "name": "Delete a tag (Delete Tag)", "request": { - "url": "https://api.intercom.io/visitors/convert", - "method": "POST", + "url": "https://api.intercom.io/tags/17513", + "method": "DELETE", "header": [ { "key": "Authorization", @@ -741,31 +726,16 @@ "key": "Accept", "value": "application/json", "description": "" - }, - { - "key": "Content-Type", - "value": "application/json", - "description": "" } ], - "description": "", - "body": { - "mode": "raw", - "raw": "\n{\n \"visitor\": {\n \"user_id\": \"8a88a590-e1c3-41e2-a502-e0649dbf721c\"\n },\n \"user\": {\n \"email\": \"winstonsmith@truth.org\"\n },\n \"type\": \"user\"\n}" - } + "description": "" }, "response": [] - } - ] - }, - { - "name": "Companies", - "description": "", - "item": [ + }, { - "name": "Create or Update Company", + "name": "Attach a contact", "request": { - "url": "https://api.intercom.io/companies", + "url": "https://api.intercom.io/contacts//tags", "method": "POST", "header": [ { @@ -780,23 +750,23 @@ }, { "key": "Content-Type", - "value": "application/json", + "value": "application/x-www-form-urlencoded", "description": "" } ], "description": "", "body": { "mode": "raw", - "raw": "\n{\n \"name\": \"Blue Sun\",\n \"plan\": \"Paid\",\n \"company_id\": \"6\",\n \"remote_created_at\": 1394531169,\n \"size\": 750,\n \"website\": \"http://www.example.com\",\n \"industry\": \"Manufacturing\",\n \"custom_attributes\": {\n \"paid_subscriber\" : true,\n \"team_mates\": 0,\n \"monthly_spend\": 155.98\n }\n}" + "raw": "\n{\n\t\"id\": \"2084335\"\n}" } }, "response": [] }, { - "name": "View a Company (View Request and Response)", + "name": "Attach a conversation", "request": { - "url": "https://api.intercom.io/companies?company_id=141", - "method": "GET", + "url": "https://api.intercom.io/conversations//tags", + "method": "POST", "header": [ { "key": "Authorization", @@ -807,17 +777,26 @@ "key": "Accept", "value": "application/json", "description": "" + }, + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded", + "description": "" } ], - "description": "" + "description": "", + "body": { + "mode": "raw", + "raw": "\n{\n \"id\": \"2084335\",\n \"admin\": \"123\"\n}\n" + } }, "response": [] }, { - "name": "List Companies (List companies)", + "name": "Tag companies", "request": { - "url": "https://api.intercom.io/companies", - "method": "GET", + "url": "https://api.intercom.io/tags", + "method": "POST", "header": [ { "key": "Authorization", @@ -828,17 +807,26 @@ "key": "Accept", "value": "application/json", "description": "" - } + }, + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } ], - "description": "" + "description": "", + "body": { + "mode": "raw", + "raw": "\n{\n \"name\": \"Independent\",\n \"companies\": [\n {\n \"id\" : \"53427b7ecce5722303000003\"\n }\n ]\n}" + } }, "response": [] }, { - "name": "List by Tag or Segment (List by tag)", + "name": "Detach a contact", "request": { - "url": "https://api.intercom.io/companies?tag_id=17", - "method": "GET", + "url": "https://api.intercom.io/contacts//tags", + "method": "DELETE", "header": [ { "key": "Authorization", @@ -849,17 +837,26 @@ "key": "Accept", "value": "application/json", "description": "" + }, + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded", + "description": "" } ], - "description": "" + "description": "", + "body": { + "mode": "raw", + "raw": "\n{\n\t\"id\": \"2084335\"\n}\n" + } }, "response": [] }, { - "name": "List Company Users (ID)", + "name": "Detach a conversation", "request": { - "url": "https://api.intercom.io/companies/5310dabd598c9a0a7e000005/users", - "method": "GET", + "url": "https://api.intercom.io/conversations//tags/", + "method": "DELETE", "header": [ { "key": "Authorization", @@ -877,10 +874,10 @@ "response": [] }, { - "name": "List Company Users (Company ID)", + "name": "Untag companies", "request": { - "url": "https://api.intercom.io/companies?company_id=22&type=user", - "method": "GET", + "url": "https://api.intercom.io/tags", + "method": "POST", "header": [ { "key": "Authorization", @@ -891,16 +888,25 @@ "key": "Accept", "value": "application/json", "description": "" + }, + { + "key": "Content-Type", + "value": "application/json", + "description": "" } ], - "description": "" + "description": "", + "body": { + "mode": "raw", + "raw": "\n{\n \"name\": \"Independent\",\n \"companies\": [\n {\n \"id\" : \"53427b7ecce5722303000003\",\n \"untag\": true\n },\n {\n \"user_id\" : \"22\"\n }\n ]\n}" + } }, "response": [] }, { - "name": "Scroll over all companies", + "name": "List all tags (List Tag)", "request": { - "url": "https://api.intercom.io/companies/scroll?scroll_param=562bc29f-ea55-4823-aaaf-f3faadceaa59", + "url": "https://api.intercom.io/tags", "method": "GET", "header": [ { @@ -921,14 +927,14 @@ ] }, { - "name": "Data Attributes", + "name": "Notes", "description": "", "item": [ { - "name": "List Data Attributes (List all data attributes)", + "name": "Create a note", "request": { - "url": "https://api.intercom.io/data_attributes", - "method": "GET", + "url": "https://api.intercom.io/contacts//note", + "method": "POST", "header": [ { "key": "Authorization", @@ -939,16 +945,25 @@ "key": "Accept", "value": "application/json", "description": "" + }, + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded", + "description": "" } ], - "description": "" + "description": "", + "body": { + "mode": "raw", + "raw": "\n{\n \"body\": \"Shiny\",\n \"admin_id\": \"12345\"\n}\n" + } }, "response": [] }, { - "name": "List Data Attributes (List company data attributes)", + "name": "Retrieve a note", "request": { - "url": "https://api.intercom.io/data_attributes?model=company", + "url": "https://api.intercom.io/notes/", "method": "GET", "header": [ { @@ -967,9 +982,9 @@ "response": [] }, { - "name": "List Data Attributes (List all data attributes including archived)", + "name": "List all notes", "request": { - "url": "https://api.intercom.io/data_attributes?include_archived=true", + "url": "https://api.intercom.io/contacts//notes", "method": "GET", "header": [ { @@ -990,14 +1005,14 @@ ] }, { - "name": "Data Events", + "name": "Segments", "description": "", "item": [ { - "name": "Submitting Events (Submit an Event)", + "name": "Retrieve a segment", "request": { - "url": "https://api.intercom.io/events", - "method": "POST", + "url": "https://api.intercom.io/segments/53203e244cba153d39000062", + "method": "GET", "header": [ { "key": "Authorization", @@ -1005,24 +1020,20 @@ "description": "" }, { - "key": "Content-Type", + "key": "Accept", "value": "application/json", "description": "" } ], - "description": "", - "body": { - "mode": "raw", - "raw": "\n{\n \"event_name\" : \"invited-friend\",\n \"created_at\": 1391691571,\n \"user_id\" : \"314159\"\n}" - } + "description": "" }, "response": [] }, { - "name": "Event Model (Event Object)", + "name": "List all segments", "request": { - "url": "https://api.intercom.io/events", - "method": "POST", + "url": "https://api.intercom.io/segments", + "method": "GET", "header": [ { "key": "Authorization", @@ -1030,23 +1041,25 @@ "description": "" }, { - "key": "Content-Type", + "key": "Accept", "value": "application/json", "description": "" } ], - "description": "", - "body": { - "mode": "raw", - "raw": "\n{\n \"event_name\" : \"invited-friend\",\n \"created_at\": 1389913941,\n \"user_id\": \"314159\",\n \"metadata\": {\n \"invitee_email\": \"pi@example.org\",\n \"invite_code\": \"ADDAFRIEND\"\n }\n}" - } + "description": "" }, "response": [] - }, + } + ] + }, + { + "name": "Conversations", + "description": "", + "item": [ { - "name": "Event Metadata Types (Event Metadata Types)", + "name": "Create a conversation", "request": { - "url": "https://api.intercom.io/events", + "url": "https://api.intercom.io/conversations", "method": "POST", "header": [ { @@ -1054,6 +1067,11 @@ "value": "Bearer {{AccessToken}}", "description": "" }, + { + "key": "Accept", + "value": "application/json", + "description": "" + }, { "key": "Content-Type", "value": "application/json", @@ -1063,15 +1081,15 @@ "description": "", "body": { "mode": "raw", - "raw": "\n{\n \"event_name\" : \"placed-order\",\n \"created_at\": 1389913941,\n \"user_id\": \"314159\",\n \"metadata\": {\n \"order_date\": 1392036272,\n \"stripe_invoice\": \"inv_3434343434\",\n \"order_number\": {\n \"value\":\"3434-3434\",\n \"url\": \"https://example.org/orders/3434-3434\"\n },\n \"price\": {\n \"currency\":\"usd\",\n \"amount\": 2999\n }\n }\n}" + "raw": "\n{\n \"from\": {\n \"type\": \"user\",\n \"id\": \"536e564f316c83104c000020\"\n },\n \"body\": \"Hey\"\n}" } }, "response": [] }, { - "name": "List Events (List all customer events)", + "name": "Retrieve a conversation", "request": { - "url": "https://api.intercom.io/events?type=user&user_id=314159", + "url": "https://api.intercom.io/conversations/", "method": "GET", "header": [ { @@ -1090,10 +1108,10 @@ "response": [] }, { - "name": "View User Event Summaries (Get summary count of user events)", + "name": "Update a conversation", "request": { - "url": "https://api.intercom.io/events?type=user&user_id=314159&summary=true", - "method": "GET", + "url": "https://api.intercom.io/conversations/", + "method": "PUT", "header": [ { "key": "Authorization", @@ -1104,44 +1122,26 @@ "key": "Accept", "value": "application/json", "description": "" - } - ], - "description": "" - }, - "response": [] - } - ] - }, - { - "name": "Admins", - "description": "", - "item": [ - { - "name": "List Admins (List Admins)", - "request": { - "url": "https://api.intercom.io/admins", - "method": "GET", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{AccessToken}}", - "description": "" }, { - "key": "Accept", + "key": "Content-Type", "value": "application/json", "description": "" } ], - "description": "" + "description": "", + "body": { + "mode": "raw", + "raw": "\n{\n \"read\": true\n}" + } }, "response": [] }, { - "name": "View an Admin (Retrieve a single admin)", + "name": "Reply to a conversation ((Contact Reply))", "request": { - "url": "https://api.intercom.io/admins/493881", - "method": "GET", + "url": "https://api.intercom.io/conversations/{id/last}/reply", + "method": "POST", "header": [ { "key": "Authorization", @@ -1152,17 +1152,26 @@ "key": "Accept", "value": "application/json", "description": "" + }, + { + "key": "Content-Type", + "value": "application/json", + "description": "" } ], - "description": "" + "description": "", + "body": { + "mode": "raw", + "raw": "\n{\n \"message_type\": \"comment\",\n \"type\": \"user\",\n \"intercom_user_id\": \"536e564f316c83104c000020\",\n \"body\": \"Thanks again :)\"\n}" + } }, "response": [] }, { - "name": "Set admin away mode", + "name": "Reply to a conversation ((Admin Reply - Note))", "request": { - "url": "https://api.intercom.io/admins/814860/away", - "method": "PUT", + "url": "https://api.intercom.io/conversations/{id/last}/reply", + "method": "POST", "header": [ { "key": "Authorization", @@ -1183,16 +1192,16 @@ "description": "", "body": { "mode": "raw", - "raw": "\n{\n \"away_mode_enabled\": true,\n \"away_mode_reassign\": false\n\n}" + "raw": "\n{\n \"message_type\": \"note\",\n \"type\": \"admin\",\n \"admin_id\": \"814860\",\n \"body\": \"

An Unordered HTML List

  • Coffee
  • Tea
  • Milk

An Ordered HTML List

  1. Coffee
  2. Tea
  3. Milk
\",\n}\n" } }, "response": [] }, { - "name": "View admin activity logs", + "name": "Assign a conversation ((Assigning to Admin))", "request": { - "url": "https://api.intercom.io/admins/activity_logs?created_at_after=489222000&created_at_before=685695600", - "method": "GET", + "url": "https://api.intercom.io/conversations/{id}/parts", + "method": "POST", "header": [ { "key": "Authorization", @@ -1210,21 +1219,19 @@ "description": "" } ], - "description": "" + "description": "", + "body": { + "mode": "raw", + "raw": "\n{\n \"type\": \"admin\",\n \"admin_id\": \"814860\",\n \"assignee_id\": \"530165\",\n \"message_type\": \"assignment\",\n \"body\": \"Reassigning for X reason.\",\n}" + } }, "response": [] - } - ] - }, - { - "name": "Teams", - "description": "", - "item": [ + }, { - "name": "List Teams (List Teams)", + "name": "Assign a conversation ((Auto Assignment))", "request": { - "url": "https://api.intercom.io/teams", - "method": "GET", + "url": "https://api.intercom.io/conversations/{id}/run_assignment_rules", + "method": "POST", "header": [ { "key": "Authorization", @@ -1235,25 +1242,9 @@ "key": "Accept", "value": "application/json", "description": "" - } - ], - "description": "" - }, - "response": [] - }, - { - "name": "View a Team (Retrieve a single team)", - "request": { - "url": "https://api.intercom.io/teams/2744328", - "method": "GET", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{AccessToken}}", - "description": "" }, { - "key": "Accept", + "key": "Content-Type", "value": "application/json", "description": "" } @@ -1261,17 +1252,11 @@ "description": "" }, "response": [] - } - ] - }, - { - "name": "Tags", - "description": "", - "item": [ + }, { - "name": "Create and Update Tags", + "name": "Snooze a conversation", "request": { - "url": "https://api.intercom.io/tags", + "url": "https://api.intercom.io/conversations//reply", "method": "POST", "header": [ { @@ -1293,15 +1278,15 @@ "description": "", "body": { "mode": "raw", - "raw": "\n{\n \"name\": \"Independent\"\n}" + "raw": "\n{\n \"message_type\":\"snoozed\",\n \"admin_id\": \"724860\",\n \"snoozed_until\":\"1501512795\"\n}" } }, "response": [] }, { - "name": "Create and Update Tags", + "name": "Close a conversation", "request": { - "url": "https://api.intercom.io/tags", + "url": "https://api.intercom.io/conversations//parts", "method": "POST", "header": [ { @@ -1323,15 +1308,15 @@ "description": "", "body": { "mode": "raw", - "raw": "\n{\n \"id\": \"17513\",\n \"name\": \"Independent\"\n}" + "raw": "\n{ \n \"message_type\": \"close\",\n \"type\": \"admin\",\n \"admin_id\": 5784329,\n \"body\": \"Closed conversation because of X.\"\n}" } }, "response": [] }, { - "name": "Tag or Untag Users, Companies & Leads (Contacts) (Tag)", + "name": "Open a conversation", "request": { - "url": "https://api.intercom.io/tags", + "url": "https://api.intercom.io/conversations//parts", "method": "POST", "header": [ { @@ -1353,15 +1338,15 @@ "description": "", "body": { "mode": "raw", - "raw": "\n{\n \"name\": \"Independent\",\n \"users\": [\n {\n \"id\" : \"53427b7ecce5722303000003\"\n },\n {\n \"user_id\" : \"22\"\n },\n {\n \"email\" : \"a@b.com\"\n }\n ]\n}" + "raw": "\n{\n \"message_type\":\"open\",\n \"admin_id\": \"724860\"\n}" } }, "response": [] }, { - "name": "Tag or Untag Users, Companies & Leads (Contacts) (Tag)", + "name": "Attach a contact", "request": { - "url": "https://api.intercom.io/tags", + "url": "https://api.intercom.io/conversations//customers", "method": "POST", "header": [ { @@ -1383,15 +1368,15 @@ "description": "", "body": { "mode": "raw", - "raw": "\n{\n \"name\": \"Independent\",\n \"users\": [\n {\n \"id\" : \"53427b7ecce5722303000003\",\n \"untag\": true\n },\n {\n \"user_id\" : \"22\"\n }\n ]\n}" + "raw": "\n{\n \"admin_id\": \"781236\",\n \"customer\": {\n \"intercom_user_id\": \"58c1c78946a0aa9ef45b098a\"\n }\n}" } }, "response": [] }, { - "name": "Delete a Tag (Delete Tag)", + "name": "Detach a contact", "request": { - "url": "https://api.intercom.io/tags/17513", + "url": "https://api.intercom.io/conversations//customers/", "method": "DELETE", "header": [ { @@ -1403,16 +1388,25 @@ "key": "Accept", "value": "application/json", "description": "" + }, + { + "key": "Content-Type", + "value": "application/json", + "description": "" } ], - "description": "" + "description": "", + "body": { + "mode": "raw", + "raw": "\n{\n \"admin_id\": \"781345\"\n}" + } }, "response": [] }, { - "name": "List Tags for an App (List Tag)", + "name": "List all conversations", "request": { - "url": "https://api.intercom.io/tags", + "url": "https://api.intercom.io/conversations?order=desc&sort=updated_at", "method": "GET", "header": [ { @@ -1433,14 +1427,14 @@ ] }, { - "name": "Segments", + "name": "Messages", "description": "", "item": [ { - "name": "List Segments", + "name": "Create a message", "request": { - "url": "https://api.intercom.io/segments", - "method": "GET", + "url": "https://api.intercom.io/messages", + "method": "POST", "header": [ { "key": "Authorization", @@ -1451,17 +1445,32 @@ "key": "Accept", "value": "application/json", "description": "" + }, + { + "key": "Content-Type", + "value": "application/json", + "description": "" } ], - "description": "" + "description": "", + "body": { + "mode": "raw", + "raw": "\n{\n \"message_type\": \"email\",\n \"subject\": \"Hey\",\n \"body\": \"Ponies, cute small horses or something more sinister?\",\n \"template\": \"plain\",\n \"from\": {\n \"type\": \"admin\",\n \"id\": \"394051\"\n },\n \"to\": {\n \"type\": \"user\",\n \"id\": \"536e564f316c83104c000020\"\n }\n}" + } }, "response": [] - }, + } + ] + }, + { + "name": "Exports - Message Data", + "description": "", + "item": [ { - "name": "List Segments", + "name": "Creating an export job", "request": { - "url": "https://api.intercom.io/segments?include_count=true", - "method": "GET", + "url": "https://api.intercom.io/export/messages/data", + "method": "POST", "header": [ { "key": "Authorization", @@ -1472,16 +1481,25 @@ "key": "Accept", "value": "application/json", "description": "" + }, + { + "key": "Content-Type", + "value": "application/json", + "description": "" } ], - "description": "" + "description": "", + "body": { + "mode": "raw", + "raw": "\n{\n \"created_at_after\": 1527811200,\n \"created_at_before\": 1530316800,\n}" + } }, "response": [] }, { - "name": "View a Segment", + "name": "Retrieve a job status", "request": { - "url": "https://api.intercom.io/segments/53203e244cba153d39000062", + "url": "https://api.intercom.io/export/messages/data/v5xsp8c19ji0s82", "method": "GET", "header": [ { @@ -1500,9 +1518,9 @@ "response": [] }, { - "name": "View a Segment", + "name": "Retrieve the exported data", "request": { - "url": "https://api.intercom.io/segments/58a707924f6651b07b94376c?include_count=true", + "url": "https://api.intercom.io/download/messages/data/xyz1234", "method": "GET", "header": [ { @@ -1511,8 +1529,7 @@ "description": "" }, { - "key": "Accept", - "value": "application/json", + "key": "‘Accept:", "description": "" } ], @@ -1523,14 +1540,35 @@ ] }, { - "name": "Notes", + "name": "Admins", "description": "", "item": [ { - "name": "Create a Note", + "name": "Retrieve an admin", "request": { - "url": "https://api.intercom.io/notes", - "method": "POST", + "url": "https://api.intercom.io/admins/493881", + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{AccessToken}}", + "description": "" + }, + { + "key": "Accept", + "value": "application/json", + "description": "" + } + ], + "description": "" + }, + "response": [] + }, + { + "name": "Set away an admin", + "request": { + "url": "https://api.intercom.io/admins/814860/away", + "method": "PUT", "header": [ { "key": "Authorization", @@ -1551,15 +1589,15 @@ "description": "", "body": { "mode": "raw", - "raw": "\n{\n \"admin_id\" : \"21\",\n \"body\": \"Text for my note\",\n \"user\": {\n \"id\" : \"5310d8e8598c9a0b24000005\"\n }\n}" + "raw": "\n{\n \"away_mode_enabled\": true,\n \"away_mode_reassign\": false\n\n}" } }, "response": [] }, { - "name": "List Notes for a User (User ID)", + "name": "List all activity logs", "request": { - "url": "https://api.intercom.io/notes?user_id=25", + "url": "https://api.intercom.io/admins/activity_logs?created_at_after=489222000&created_at_before=685695600", "method": "GET", "header": [ { @@ -1571,6 +1609,11 @@ "key": "Accept", "value": "application/json", "description": "" + }, + { + "key": "Content-Type", + "value": "application/json", + "description": "" } ], "description": "" @@ -1578,9 +1621,9 @@ "response": [] }, { - "name": "List Notes for a User (Email)", + "name": "List all admins", "request": { - "url": "https://api.intercom.io/notes?email=jayne%40serenity.io", + "url": "https://api.intercom.io/admins", "method": "GET", "header": [ { @@ -1597,11 +1640,17 @@ "description": "" }, "response": [] - }, + } + ] + }, + { + "name": "Teams", + "description": "", + "item": [ { - "name": "List Notes for a User (ID)", + "name": "Retrieve a team", "request": { - "url": "https://api.intercom.io/notes?id=5310d8e8598c9a0b24000005", + "url": "https://api.intercom.io/teams/2744328", "method": "GET", "header": [ { @@ -1620,9 +1669,9 @@ "response": [] }, { - "name": "View a Note", + "name": "List all teams (*Example )", "request": { - "url": "https://api.intercom.io/notes/2", + "url": "https://api.intercom.io/teams", "method": "GET", "header": [ { @@ -1752,582 +1801,6 @@ "response": [] } ] - }, - { - "name": "Conversations", - "description": "", - "item": [ - { - "name": "Admin Initiated Conversation (Email From Admin)", - "request": { - "url": "https://api.intercom.io/messages", - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{AccessToken}}", - "description": "" - }, - { - "key": "Accept", - "value": "application/json", - "description": "" - }, - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "description": "", - "body": { - "mode": "raw", - "raw": "\n{\n \"message_type\": \"email\",\n \"subject\": \"Hey\",\n \"body\": \"Ponies, cute small horses or something more sinister?\",\n \"template\": \"plain\",\n \"from\": {\n \"type\": \"admin\",\n \"id\": \"394051\"\n },\n \"to\": {\n \"type\": \"user\",\n \"id\": \"536e564f316c83104c000020\"\n }\n}" - } - }, - "response": [] - }, - { - "name": "User or Lead Initiated Conversation (User Initiated Message)", - "request": { - "url": "https://api.intercom.io/messages", - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{AccessToken}}", - "description": "" - }, - { - "key": "Accept", - "value": "application/json", - "description": "" - }, - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "description": "", - "body": { - "mode": "raw", - "raw": "\n{\n \"from\": {\n \"type\": \"user\",\n \"id\": \"536e564f316c83104c000020\"\n },\n \"body\": \"Hey\"\n}" - } - }, - "response": [] - }, - { - "name": "Get a Single Conversation (Get a Single Conversation)", - "request": { - "url": "https://api.intercom.io/conversations/147", - "method": "GET", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{AccessToken}}", - "description": "" - }, - { - "key": "Accept", - "value": "application/json", - "description": "" - } - ], - "description": "" - }, - "response": [] - }, - { - "name": "List Conversations (List Open Conversations for a Particular Admin)", - "request": { - "url": "https://api.intercom.io/conversations?type=admin&admin_id=25&open=true", - "method": "GET", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{AccessToken}}", - "description": "" - }, - { - "key": "Accept", - "value": "application/json", - "description": "" - } - ], - "description": "" - }, - "response": [] - }, - { - "name": "Replying to a Conversation (Reply with and Without Attachments)", - "request": { - "url": "https://api.intercom.io/conversations/{conversation_id}/reply", - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{AccessToken}}", - "description": "" - }, - { - "key": "Accept", - "value": "application/json", - "description": "" - }, - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "description": "", - "body": { - "mode": "raw", - "raw": "\n{\n \"intercom_user_id\": \"536e564f316c83104c000020\",\n \"body\": \"Thanks again :)\",\n \"type\": \"user\",\n \"message_type\": \"comment\"\n}" - } - }, - "response": [] - }, - { - "name": "Replying to a Conversation (Reply with a note)", - "request": { - "url": "https://api.intercom.io/conversations/{conversation_id}/reply", - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{AccessToken}}", - "description": "" - }, - { - "key": "Accept", - "value": "application/json", - "description": "" - }, - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "description": "", - "body": { - "mode": "raw", - "raw": "\n{\n \"admin_id\": \"814860\",\n \"body\": \"

An Unordered HTML List

  • Coffee
  • Tea
  • Milk

An Ordered HTML List

  1. Coffee
  2. Tea
  3. Milk
\",\n \"type\": \"admin\",\n \"message_type\": \"note\"\n}" - } - }, - "response": [] - }, - { - "name": "Replying to Users Last Conversation (Replying to the Users Most Recent Conversation)", - "request": { - "url": "https://api.intercom.io/conversations/last/reply", - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{AccessToken}}", - "description": "" - }, - { - "key": "Accept", - "value": "application/json", - "description": "" - }, - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "description": "", - "body": { - "mode": "raw", - "raw": "\n{\n \"intercom_user_id\": \"536e564f316c83104c000020\",\n \"body\": \"Let me know if you have any more questions!\",\n \"type\": \"admin\",\n \"admin_id\": \"1234\",\n \"message_type\": \"comment\"\n}" - } - }, - "response": [] - }, - { - "name": "Assigning a Conversation to Unassigned (Assign to Unassigned)", - "request": { - "url": "https://api.intercom.io/conversations/6167678340/reply", - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{AccessToken}}", - "description": "" - }, - { - "key": "Accept", - "value": "application/json", - "description": "" - }, - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "description": "", - "body": { - "mode": "raw", - "raw": "\n{\n \"body\": \"Reassigning to no-one!\",\n \"type\": \"admin\",\n \"admin_id\": \"1234\",\n \"assignee_id\": \"0\",\n \"message_type\": \"assignment\"\n}" - } - }, - "response": [] - }, - { - "name": "Run assignment rules on a conversation (Assign based on assignment rules)", - "request": { - "url": "https://api.intercom.io/conversations/{convo_id}/run_assignment_rules", - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{AccessToken}}", - "description": "" - }, - { - "key": "Accept", - "value": "application/json", - "description": "" - }, - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "description": "" - }, - "response": [] - }, - { - "name": "Marking a Conversation as Read (Mark a Conversation as Read)", - "request": { - "url": "https://api.intercom.io/conversations/147", - "method": "PUT", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{AccessToken}}", - "description": "" - }, - { - "key": "Accept", - "value": "application/json", - "description": "" - }, - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "description": "", - "body": { - "mode": "raw", - "raw": "\n{\n \"read\": true\n}" - } - }, - "response": [] - }, - { - "name": "Adding to group conversations as admin (Adding a customer to a group conversation)", - "request": { - "url": "https://api.intercom.io/conversations/11055118659/customers", - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{AccessToken}}", - "description": "" - }, - { - "key": "Accept", - "value": "application/json", - "description": "" - }, - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "description": "", - "body": { - "mode": "raw", - "raw": "\n{\n \"admin_id\": \"781236\",\n \"customer\":{\n \"intercom_user_id\": \"58c1c78946a0aa9ef45b098a\"\n }\n}" - } - }, - "response": [] - }, - { - "name": "Adding to group conversations as customer (Adding a customer to a group conversation as customer)", - "request": { - "url": "https://api.intercom.io/conversations/11055118659/customers", - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{AccessToken}}", - "description": "" - }, - { - "key": "Accept", - "value": "application/json", - "description": "" - }, - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "description": "", - "body": { - "mode": "raw", - "raw": "\n{\n \"intercom_user_id\": \"55c1c78946b0aa9ef45b09ff\",\n \"customer\":{\n \"intercom_user_id\": \"58c1c78946a0aa9ef45b098a\"\n }\n}" - } - }, - "response": [] - }, - { - "name": "Deleting from group conversations (Deleting a customer from a group conversation)", - "request": { - "url": "https://api.intercom.io/conversations/11055118659/customers/58c1c72246a0aa9ef45a098e", - "method": "DELETE", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{AccessToken}}", - "description": "" - }, - { - "key": "Accept", - "value": "application/json", - "description": "" - }, - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "description": "", - "body": { - "mode": "raw", - "raw": "\n{\n \"admin_id\": \"781345\"\n}" - } - }, - "response": [] - }, - { - "name": "Snoozing a conversation (Snooze a conversation)", - "request": { - "url": "https://api.intercom.io/conversations/11055118659/reply", - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{AccessToken}}", - "description": "" - }, - { - "key": "Accept", - "value": "application/json", - "description": "" - }, - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "description": "", - "body": { - "mode": "raw", - "raw": "\n{\n \"admin_id\": \"724860\",\n \"message_type\":\"snoozed\",\n \"snoozed_until\":\"1501512795\"\n}" - } - }, - "response": [] - }, - { - "name": "Unsnoozing a conversation (Unsnooze a conversation)", - "request": { - "url": "https://api.intercom.io/conversations/11055118659/reply", - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{AccessToken}}", - "description": "" - }, - { - "key": "Accept", - "value": "application/json", - "description": "" - }, - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "description": "", - "body": { - "mode": "raw", - "raw": "\n{\n \"admin_id\": \"814860\",\n \"message_type\":\"open\"\n}" - } - }, - "response": [] - }, - { - "name": "Closing a conversation (Closing a Conversation Without Reply)", - "request": { - "url": "https://api.intercom.io/conversations/xxx/reply", - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{AccessToken}}", - "description": "" - }, - { - "key": "Accept", - "value": "application/json", - "description": "" - }, - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "description": "", - "body": { - "mode": "raw", - "raw": "{ \"admin_id\": CLOSING_ADMIN_ID, \"message_type\": \"close\", \"type\": \"admin\"}" - } - }, - "response": [] - }, - { - "name": "Closing a conversation (Closing a Conversation With Reply)", - "request": { - "url": "https://api.intercom.io/conversations/xxx/reply", - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{AccessToken}}", - "description": "" - }, - { - "key": "Accept", - "value": "application/json", - "description": "" - }, - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "description": "", - "body": { - "mode": "raw", - "raw": "{ \"body\":\"closing this convo\", \"admin_id\": CLOSING_ADMIN_ID, \"message_type\": \"close\", \"type\": \"admin\"}" - } - }, - "response": [] - } - ] - }, - { - "name": "Exports - Message Data", - "description": "", - "item": [ - { - "name": "Creating an export job", - "request": { - "url": "https://api.intercom.io/export/messages/data", - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{AccessToken}}", - "description": "" - }, - { - "key": "Accept", - "value": "application/json", - "description": "" - }, - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "description": "", - "body": { - "mode": "raw", - "raw": "\n{\n \"created_at_after\": 1527811200,\n \"created_at_before\": 1530316800,\n}" - } - }, - "response": [] - }, - { - "name": "Checking the status of the job", - "request": { - "url": "https://api.intercom.io/export/messages/data/v5xsp8c19ji0s82", - "method": "GET", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{AccessToken}}", - "description": "" - }, - { - "key": "Accept", - "value": "application/json", - "description": "" - } - ], - "description": "" - }, - "response": [] - }, - { - "name": "Downloading the data", - "request": { - "url": "https://api.intercom.io/download/messages/data/xyz1234", - "method": "GET", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{AccessToken}}", - "description": "" - }, - { - "key": "‘Accept:", - "description": "" - } - ], - "description": "" - }, - "response": [] - } - ] - }, - { - "name": "Errors", - "description": "", - "item": [] } ] } \ No newline at end of file