...
CRM needs to be able to receive and respond to HTTPS requests with JSON content.
CRM needs to be able to authorize requests from a Ringotel server using Basic, Bearer, or OAuth2 method.
CRM need to be able to accept and return data in the predefined format.
CRM should respond to the authentication requests from Ringotel with the stadard 200 OK or 403 Forbidden HTTP codes.
Implementation
Currently, Ringotel supports the following workflow:
Users
(required)
Must provide The Ringotel integration for CRM utilizes the following workflow:
Authentication
Authentications can be based on the OAuth 2.0 Web Server Flow using the client_id and client_secret. Alternatively, Basic or Bearer authentication can be used.
OAuth2 Authentication example:
Code Block | ||
---|---|---|
| ||
"OAuth2": {
"client_id": "$Client ID$",
"client_secret": "$Client Secret$",
"flow_type": {
"default": "0"
},
"authorization_endpoint": "https://login.example.com/services/oauth2/authorize",
"authorization_parameters": {
"default": "scope=api%20refresh_token"
},
"token_endpoint": "https://login.example.com/services/oauth2/token",
"token_parameters": {
"content_type": "application/x-www-form-urlencoded;charset=utf-8"
},
"request_auth": "Bearer"
} |
Bearer Authentication example:
Code Block | ||
---|---|---|
| ||
"auth": {
"type": "Bearer",
"token": "$API key$"
}, |
Basic Authentication example:
Code Block | ||
---|---|---|
| ||
"auth": {
"type": "Basic",
"username": "$Username$",
"password": "$Password$"
}, |
Users
Provides the list of CRM users to map with the Ringotel users. Each user needs to have unique identifier (ID).
Code Block |
---|
"Users": {
"request_method": "GET",
"request_path": "/query?q=SELECT Id,FirstName,LastName,Email,Phone FROM User",
"response_map":
{
"records": [
{
"Id": "$user_id$",
"FirstName": "$firstname$",
"LastName": "$lastname$",
"Email": "$email$",
"Phone": "$phone$"
}
]
}
} |
Contacts
Returns the list of contacts and their properties.
Organizations
Rerturns the list of companies and their properties.
FindContact
Used to identfied
Code Block |
---|
"Contacts": {
"request_method": "GET",
"request_path": "/query?q=SELECT Id,FirstName,LastName,Email,Phone,Account.Name,MobilePhone,Title FROM Contact",
"response_map":
{
"records":
[
{
"Id": "$contact_id$",
"FirstName": "$firstname$",
"LastName": "$lastname$",
"Email": "$email$",
"Phone": "$phone$",
"MobilePhone": "$mobile$",
"Account":{
"Name":"$company_name$"
},
"Title": "$job_title$"
}
]
}
} |
Organizations
Returns the list of accounts and their properties.
Code Block |
---|
"Organizations": {
"request_method": "GET",
"request_path": "/query?q=SELECT Id, Name FROM Account",
"response_map":
{
"records":
[
{
"Id": "$company_id$",
"Name":"$company_name$"
}
]
}
} |
FindContact
Is used to identify caller on incoming/outgoing call. Must return a specific contact identified by the phone number.
Code Block |
---|
"FindContact": {
"request_method": "GET",
"request_path": "/query?q=SELECT Id,FirstName,LastName,Email,Phone,Account.Name,MobilePhone,Title FROM Contact WHERE Phone LIKE '%$phone$' OR MobilePhone LIKE '%$phone$'",
"response_map":
{
"records":
[
{
"Id": "$contact_id$",
"FirstName": "$firstname$",
"LastName": "$lastname$",
"Email": "$email$",
"Phone": "$phone$",
"MobilePhone": "$mobile$",
"Account":{
"Name":"$company_name$"
},
"Title": "$job_title$"
}
]
}
} |
CreateContact
Creates a new contact with properties.
Code Block |
---|
"CreateContact": {
"request_method": "POST",
"request_path": "/sobjects/Contact",
"request_parameters":
{
"FirstName": "$firstname$",
"LastName": "$lastname$ ",
"Email": "$email$",
"Phone": "$phone$",
"AccountId": "$company$"
},
"response_map":
{
"id": "$contact_id$"
}
} |
UpdateContact
Updates a specific contact identified by ID with the new properties.
Code Block |
---|
"UpdateContact": {
"request_method": "PATCH",
"request_path": "/sobjects/Contact/$contact_id$",
"request_parameters":
{
"FirstName": "$firstname$",
"LastName": "$lastname$",
"Email": "$email$",
"Phone": "$phone$",
"AccountId": "$company$"
},
"response_map":
{
"id": "$contact_id$"
}
} |
CreateActivity
Creates a new call activity with its properties.
AssignActivity
...
Code Block |
---|
"CreateActivity": {
"request_method": "POST",
"request_path": "/sobjects/Task/",
"request_parameters":
{
"Subject":"$call_title$",
"OwnerId":"$user_id$",
"WhoId":"$contact_id$",
"CallType":"$activity_type$"
},
"response_map":
{
"id": "$activity_id$"
}
} |
UpdateActivity
Updates CRM activity indetified identified by activity ID.
Code Block |
---|
"UpdateActivity": {
"request_method": "PATCH",
"request_path": "/sobjects/Task/$activity_id$",
"request_parameters":
{
"Subject": "$subject$",
"Description": "$comment$"
}
} |
StopCallActivity
Changes the status of a specific activity (identified by activity ID).
Code Block |
---|
"StopCallActivity": {
"request_method": "PATCH",
"request_path": "/sobjects/Task/$activity_id$",
"request_parameters":
{
"Status":"Completed",
"CallDurationInSeconds": "$call_duration_millis$"
}
} |
UpdateCallRecording
Uploads and attaches a call recording file to a specific activity (identified by ID).
Code Block |
---|
"UploadFile": {
"request_method": "POST",
"request_path": "/sobjects/Attachment",
"request_content_type": "application/json",
"request_parameters": {
"Name":"$filename$",
"ParentId":"$activity_id$",
"ContentType":"audio/wav",
"Body":"$file$",
"OwnerId":"$user_id$"
}
} |
...
Below you can find a JSON document with a CRM integration example. Should you have any questions, please don't hesitate to contact us at support@ringotel.co.
View file | ||
---|---|---|
|