@robinpath/intercom
0.1.1Node.jsPublicIntercom module for RobinPath.
Intercom
Intercom module for RobinPath.
Package: @robinpath/intercom | Category: Crm | Type: Integration
Authentication
intercom.setCredentials "your-credentials"
Call this once at the start of your script before using any other function. Credentials persist for the duration of the script execution.
Use Cases
Use the intercom module when you need to:
- listContacts -- Use
intercom.listContactsto perform this operation - getContact -- Use
intercom.getContactto perform this operation - createContact -- Use
intercom.createContactto perform this operation - updateContact -- Use
intercom.updateContactto perform this operation - deleteContact -- Use
intercom.deleteContactto perform this operation
Quick Reference
| Function | Description | Returns |
|---|---|---|
setCredentials | Configure intercom credentials. | object |
listContacts | listContacts | object |
getContact | getContact | object |
createContact | createContact | object |
updateContact | updateContact | object |
deleteContact | deleteContact | object |
searchContacts | searchContacts | object |
listConversations | listConversations | object |
getConversation | getConversation | object |
replyToConversation | replyToConversation | object |
assignConversation | assignConversation | object |
closeConversation | closeConversation | object |
listCompanies | listCompanies | object |
getCompany | getCompany | object |
createCompany | createCompany | object |
listTags | listTags | object |
createTag | createTag | object |
tagContact | tagContact | object |
removeTag | removeTag | object |
Functions
setCredentials
Configure intercom credentials.
Module: intercom | Returns: object -- API response.
intercom.setCredentials
| Parameter | Type | Required | Description |
|---|---|---|---|
accessToken | string | Yes | accessToken |
listContacts
listContacts
Module: intercom | Returns: object -- API response.
intercom.listContacts
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getContact
getContact
Module: intercom | Returns: object -- API response.
intercom.getContact
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
createContact
createContact
Module: intercom | Returns: object -- API response.
intercom.createContact
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
updateContact
updateContact
Module: intercom | Returns: object -- API response.
intercom.updateContact
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
deleteContact
deleteContact
Module: intercom | Returns: object -- API response.
intercom.deleteContact
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
searchContacts
searchContacts
Module: intercom | Returns: object -- API response.
intercom.searchContacts
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
listConversations
listConversations
Module: intercom | Returns: object -- API response.
intercom.listConversations
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getConversation
getConversation
Module: intercom | Returns: object -- API response.
intercom.getConversation
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
replyToConversation
replyToConversation
Module: intercom | Returns: object -- API response.
intercom.replyToConversation
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
assignConversation
assignConversation
Module: intercom | Returns: object -- API response.
intercom.assignConversation
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
closeConversation
closeConversation
Module: intercom | Returns: object -- API response.
intercom.closeConversation
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
listCompanies
listCompanies
Module: intercom | Returns: object -- API response.
intercom.listCompanies
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getCompany
getCompany
Module: intercom | Returns: object -- API response.
intercom.getCompany
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
createCompany
createCompany
Module: intercom | Returns: object -- API response.
intercom.createCompany
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
listTags
listTags
Module: intercom | Returns: object -- API response.
intercom.listTags
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
createTag
createTag
Module: intercom | Returns: object -- API response.
intercom.createTag
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
tagContact
tagContact
Module: intercom | Returns: object -- API response.
intercom.tagContact
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
removeTag
removeTag
Module: intercom | Returns: object -- API response.
intercom.removeTag
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
Error Handling
All functions throw on failure. Common errors:
| Error | Cause |
|---|---|
Intercom API error (${res.status}): ${t} | Check the error message for details |
intercom.setCredentials requires accessToken. | Check the error message for details |
intercom.updateContact requires an ID. | Check the error message for details |
intercom.deleteContact requires an ID. | Check the error message for details |
intercom.closeConversation requires an ID. | Check the error message for details |
intercom.removeTag requires an ID. | Check the error message for details |
Intercom: "..." not configured. Call intercom.setCredentials first. | Check the error message for details |
@desc "List contacts and validate result"
do
set $result as intercom.listContacts
if $result != null
print "Success"
else
print "No result"
end
enddo
Recipes
1. List and iterate Contacts
Retrieve all items and loop through them.
@desc "Setup authentication"
do
intercom.setCredentials $token
enddo
@desc "List contacts and iterate results"
do
set $result as intercom.listContacts
each $item in $result
print $item
end
enddo
2. Create a new item with createContact
Create a new resource and capture the result.
@desc "Setup authentication"
do
intercom.setCredentials $token
enddo
@desc "Create contact"
do
set $result as intercom.createContact
print "Created: " + $result
enddo
3. Create and update workflow
Create an item and then update it.
@desc "Setup authentication"
do
intercom.setCredentials $token
enddo
@desc "Create contact and update contact"
do
set $created as intercom.createContact
# Update the created item
intercom.updateContact
enddo
4. Check before creating
List existing items and only create if needed.
@desc "Setup authentication"
do
intercom.setCredentials $token
enddo
@desc "List contacts and create contact"
do
set $existing as intercom.listContacts
if $existing == null
intercom.createContact
print "Item created"
else
print "Item already exists"
end
enddo
5. Multi-step Intercom workflow
Chain multiple intercom operations together.
@desc "Setup authentication"
do
intercom.setCredentials $token
enddo
@desc "List contacts, get contact, and more"
do
set $r_listContacts as intercom.listContacts
set $r_getContact as intercom.getContact
set $r_createContact as intercom.createContact
print "All operations complete"
enddo
6. Safe listContacts with validation
Check results before proceeding.
@desc "Setup authentication"
do
intercom.setCredentials $token
enddo
@desc "List contacts and validate result"
do
set $result as intercom.listContacts
if $result != null
print "Success: " + $result
else
print "Operation returned no data"
end
enddo
Related Modules
- hubspot -- HubSpot module for complementary functionality
- salesforce -- Salesforce module for complementary functionality
- pipedrive -- Pipedrive module for complementary functionality
- freshdesk -- Freshdesk module for complementary functionality
- zoho -- Zoho module for complementary functionality
Versions (1)
| Version | Tag | Published |
|---|---|---|
| 0.1.1 | latest | 1 months ago |
$ robinpath add @robinpath/intercom
