Conversations Inbox API
Version: v1.0
Specification Release Notes Other versions
The Conversations Inbox API is a JSON REST API to connect to social messaging platforms like WhatsApp Business, Apple Business Chat, Facebook Messenger, Twitter DM, Viber, LINE and more.
HTTP requests
Standard HTTP methods, such as GET or POST, are used with the application/json content type. API keys are used for authentication and TLS 1.2 is required.
HTTP responses
HTTP success status codes, such as 200 OK or 201 Created, are returned for successful responses and the response data has the application/json content type.
HTTP error status codes, such as 400 Bad Request or 401 Unauthorized, are returned for error responses. See Error codes for more information.
Channels & JIDs
The API uses Jabber IDs (JIDs) to identify channels and contacts. They have the same format as email addresses. The following channels are supported:
Channel | JID example |
---|---|
WhatsApp Business | 31611111111@whatsapp.eazy.im |
Apple Business Chat | d2b9f484-08ac-45a7-bbe0-f2f7d844bcb6@apple.eazy.im |
Facebook Messenger | 1918363544518991@messenger.eazy.im |
Line | 8191584934115639@line.eazy.im |
Twitter DM | 872362551@twitter.eazy.im |
Viber | voON2IU2FTGtgUB50qc08g@viber.eazy.im |
Web chat | 8191584934115639@webchat.eazy.im |
SMS | 31633333333@sms.eazy.im |
Note: Custom channels can be added on your demand. For instance, an existing chat in your custom mobile app or live chat on your website can be added as a channel in the Conversations Inbox.
Error codes
400 Bad Request
{
"error": {
"code": 1005,
"message": "Jid is invalid"
},
"traceId": "7e6459"
}
In the case an HTTP error status (4xx) was returned, the response provides a detailed error code and message in the JSON body, see the sample on the right.
The traceId can be used by our support team to track down the corresponding request.
The following error codes and messages are defined:
Error code | Description |
---|---|
1001 | Unauthorized |
1002 | Access denied |
1003 | Service unavailable |
1004 | Internal server error |
1005 | Validation error |
1006 | Template name does not exist |
1007 | User does not have WhatsApp |
1008 | Media is invalid |
1009 | Not found |
1010 | Assistant has no ownership of conversation |
1011 | Message rejected |
1012 | Bad gateway |
1013 | Parameter count mismatch |
1014 | Already exists |
1015 | Customer care window expired |
Base URLs
API Keys
You can read information about your API keys and their scopes.
List all API keys
Code samples
# You can also use wget
curl -X GET https://api.cmd.tyntec.com/v3/keys \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.cmd.tyntec.com/v3/keys HTTP/1.1
Host: api.cmd.tyntec.com
Accept: application/json
Authorization: Bearer {access-token}
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/keys',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.cmd.tyntec.com/v3/keys',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.cmd.tyntec.com/v3/keys', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.cmd.tyntec.com/v3/keys', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/keys");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.cmd.tyntec.com/v3/keys", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /keys
A list of all keys can be retrieved using the GET method.
Example responses
200 Response
[]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» anonymous | any | false | none | none |
Current API key
Code samples
# You can also use wget
curl -X GET https://api.cmd.tyntec.com/v3/keys/currrent \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.cmd.tyntec.com/v3/keys/currrent HTTP/1.1
Host: api.cmd.tyntec.com
Accept: application/json
Authorization: Bearer {access-token}
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/keys/currrent',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.cmd.tyntec.com/v3/keys/currrent',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.cmd.tyntec.com/v3/keys/currrent', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.cmd.tyntec.com/v3/keys/currrent', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/keys/currrent");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.cmd.tyntec.com/v3/keys/currrent", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /keys/currrent
A specific agent can be requested
Example responses
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | None |
Response Schema
Company Management
Each owner is defined by a company. Owners can only manage their own company except for resellers who can manage multiple companies.
Agents and teams
Agents are accounts of users in your company who respond to your customers via the Conversations Inbox.
You may organize agents into teams (e.g. support team, sales team).
Assistants
AI assistants can be used to automate conversations. If you want to add and assign an assistant to your agent, contact us.
Labels
Labels can be used to assign friendly titles in colored boxes to conversations.
List all companies
Code samples
# You can also use wget
curl -X GET https://api.cmd.tyntec.com/v3/companies \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.cmd.tyntec.com/v3/companies HTTP/1.1
Host: api.cmd.tyntec.com
Accept: application/json
Authorization: Bearer {access-token}
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/companies',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.cmd.tyntec.com/v3/companies',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.cmd.tyntec.com/v3/companies', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.cmd.tyntec.com/v3/companies', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/companies");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.cmd.tyntec.com/v3/companies", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /companies
List of all companies can be requested
Example responses
200 Response
[
{
"id": "458e633a-ab50-445f-9d1f-52afbf720ec3",
"name": "tyntec"
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [companyResponse] | false | none | [Company response] |
» id | string | false | none | ID of the company |
» name | string(string) | false | none | Name of the company |
Current company
Code samples
# You can also use wget
curl -X GET https://api.cmd.tyntec.com/v3/companies/current \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.cmd.tyntec.com/v3/companies/current HTTP/1.1
Host: api.cmd.tyntec.com
Accept: application/json
Authorization: Bearer {access-token}
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/companies/current',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.cmd.tyntec.com/v3/companies/current',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.cmd.tyntec.com/v3/companies/current', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.cmd.tyntec.com/v3/companies/current', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/companies/current");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.cmd.tyntec.com/v3/companies/current", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /companies/current
The current company can be requested
Example responses
200 Response
{
"id": "458e633a-ab50-445f-9d1f-52afbf720ec3",
"name": "tyntec"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | companyResponse |
Company by ID
Code samples
# You can also use wget
curl -X GET https://api.cmd.tyntec.com/v3/companies/{id} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.cmd.tyntec.com/v3/companies/{id} HTTP/1.1
Host: api.cmd.tyntec.com
Accept: application/json
Authorization: Bearer {access-token}
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/companies/{id}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.cmd.tyntec.com/v3/companies/{id}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.cmd.tyntec.com/v3/companies/{id}', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.cmd.tyntec.com/v3/companies/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/companies/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.cmd.tyntec.com/v3/companies/{id}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /companies/{id}
Request a company by the ID
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | string | true | ID of the company |
Example responses
200 Response
{
"id": "458e633a-ab50-445f-9d1f-52afbf720ec3",
"name": "tyntec"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | companyResponse |
List all agents
Code samples
# You can also use wget
curl -X GET https://api.cmd.tyntec.com/v3/companies/{companyId}/agents \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.cmd.tyntec.com/v3/companies/{companyId}/agents HTTP/1.1
Host: api.cmd.tyntec.com
Accept: application/json
Authorization: Bearer {access-token}
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/companies/{companyId}/agents',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.cmd.tyntec.com/v3/companies/{companyId}/agents',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.cmd.tyntec.com/v3/companies/{companyId}/agents', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.cmd.tyntec.com/v3/companies/{companyId}/agents', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/companies/{companyId}/agents");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.cmd.tyntec.com/v3/companies/{companyId}/agents", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /companies/{companyId}/agents
A list of all agents can be retrieved using the GET method. The objects field specifies to which objects the key has access to. IP whitelisting can be used to restrict originating IP addresses.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
companyId | path | string | true | ID of the company |
Example responses
200 Response
[
{
"email": "jane@mycompany.com",
"name": {
"firstName": "Jane",
"fullName": "Jane Mayers",
"lastName": "Mayers"
},
"roles": [
"admin",
"user"
],
"status": "OFFLINE",
"teams": [
"company@domail.com"
]
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [agentResponse] | false | none | [Details of an agent] |
string | false | none | email address | |
» name | object | false | none | Name |
»» firstName | string | false | none | First Name of the Agent |
»» fullName | string | false | none | Full Name of the Agent |
»» lastName | string | false | none | Last Name of the Agent |
» roles | [string] | false | none | The role of the agent |
» status | string | false | none | Status of the agent |
» teams | [string] | false | none | Teams to be contacted with email |
Enumerated values
Property | Value |
---|---|
status | OFFLINE |
status | AWAY |
status | ONLINE |
Read an agent
Code samples
# You can also use wget
curl -X GET https://api.cmd.tyntec.com/v3/companies/{companyId}/agents/{email} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.cmd.tyntec.com/v3/companies/{companyId}/agents/{email} HTTP/1.1
Host: api.cmd.tyntec.com
Accept: application/json
Authorization: Bearer {access-token}
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/companies/{companyId}/agents/{email}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.cmd.tyntec.com/v3/companies/{companyId}/agents/{email}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.cmd.tyntec.com/v3/companies/{companyId}/agents/{email}', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.cmd.tyntec.com/v3/companies/{companyId}/agents/{email}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/companies/{companyId}/agents/{email}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.cmd.tyntec.com/v3/companies/{companyId}/agents/{email}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /companies/{companyId}/agents/{email}
A specific agent can be retrieved using the GET method.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
companyId | path | string | true | ID of the company |
path | string(email) | true | email of the agent |
Example responses
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | None |
Response Schema
Create a team
Code samples
# You can also use wget
curl -X POST https://api.cmd.tyntec.com/v3/companies/{companyId}/teams \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.cmd.tyntec.com/v3/companies/{companyId}/teams HTTP/1.1
Host: api.cmd.tyntec.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer {access-token}
const inputBody = '{
"name": "Support"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/companies/{companyId}/teams',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.cmd.tyntec.com/v3/companies/{companyId}/teams',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.cmd.tyntec.com/v3/companies/{companyId}/teams', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.cmd.tyntec.com/v3/companies/{companyId}/teams', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/companies/{companyId}/teams");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.cmd.tyntec.com/v3/companies/{companyId}/teams", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /companies/{companyId}/teams
Create a new team
Body parameter
{
"name": "Support"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
companyId | path | string | true | Company ID |
body | body | object | true | The team you would like to create |
» name | body | string | true | Name of the team to be created |
Example responses
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Created | None |
Response Schema
List all teams
Code samples
# You can also use wget
curl -X GET https://api.cmd.tyntec.com/v3/companies/{companyId}/teams \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.cmd.tyntec.com/v3/companies/{companyId}/teams HTTP/1.1
Host: api.cmd.tyntec.com
Accept: application/json
Authorization: Bearer {access-token}
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/companies/{companyId}/teams',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.cmd.tyntec.com/v3/companies/{companyId}/teams',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.cmd.tyntec.com/v3/companies/{companyId}/teams', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.cmd.tyntec.com/v3/companies/{companyId}/teams', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/companies/{companyId}/teams");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.cmd.tyntec.com/v3/companies/{companyId}/teams", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /companies/{companyId}/teams
A list of all teams can be requested
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
companyId | path | string | true | Company ID |
Example responses
200 Response
[
{
"channels": [
{
"dataRetentionInDays": 90,
"jid": "31611111111@company.com",
"name": "WhatApp",
"priority": 0
}
],
"color": 8,
"jid": "31611111111@company.com",
"metadata": "string",
"name": "Support"
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [teamResponse] | false | none | [Single team response] |
» channels | [channelResponse] | false | none | Array of channels |
»» dataRetentionInDays | integer | false | none | Body/text of the message |
»» jid | string(email) | false | none | ID |
»» name | string | false | none | Name of the channel |
»» priority | integer | false | none | Priority of the channel |
» color | integer | false | none | Color |
» jid | string(email) | false | none | ID |
» metadata | string | false | none | Metadata information |
» name | string | false | none | Name of the team |
Update a team
Code samples
# You can also use wget
curl -X PATCH https://api.cmd.tyntec.com/v3/companies/{companyId}/teams/{jid} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
PATCH https://api.cmd.tyntec.com/v3/companies/{companyId}/teams/{jid} HTTP/1.1
Host: api.cmd.tyntec.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer {access-token}
const inputBody = '{
"name": "Support",
"color": 1,
"metadata": {},
"reference": "Team-Support-1231-DE"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/companies/{companyId}/teams/{jid}',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.patch 'https://api.cmd.tyntec.com/v3/companies/{companyId}/teams/{jid}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.patch('https://api.cmd.tyntec.com/v3/companies/{companyId}/teams/{jid}', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PATCH','https://api.cmd.tyntec.com/v3/companies/{companyId}/teams/{jid}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/companies/{companyId}/teams/{jid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PATCH", "https://api.cmd.tyntec.com/v3/companies/{companyId}/teams/{jid}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PATCH /companies/{companyId}/teams/{jid}
A team can be updated using the PATCH method. Only the specified fields will be updated, all other fields will remain unchanged. The following fields can be updated color, metadata, name
Body parameter
{
"name": "Support",
"color": 1,
"metadata": {},
"reference": "Team-Support-1231-DE"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
companyId | path | string | true | Company ID |
jid | path | string(email) | true | Jabber IDs to represent contacts |
body | body | object | true | The team you would like to create |
» name | body | string | false | Name of the team to be created |
» color | body | integer | false | Color of the team |
» metadata | body | object | false | Meta data for this team |
» reference | body | string | false | Companies reference information |
Example responses
200 Response
{
"channels": [
{
"dataRetentionInDays": 90,
"jid": "31611111111@company.com",
"name": "WhatApp",
"priority": 0
}
],
"color": 8,
"jid": "31611111111@company.com",
"metadata": "string",
"name": "Support"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | teamResponse |
Delete a team
Code samples
# You can also use wget
curl -X DELETE https://api.cmd.tyntec.com/v3/companies/{companyId}/teams/{jid} \
-H 'Authorization: Bearer {access-token}'
DELETE https://api.cmd.tyntec.com/v3/companies/{companyId}/teams/{jid} HTTP/1.1
Host: api.cmd.tyntec.com
Authorization: Bearer {access-token}
const headers = {
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/companies/{companyId}/teams/{jid}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.delete 'https://api.cmd.tyntec.com/v3/companies/{companyId}/teams/{jid}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Authorization': 'Bearer {access-token}'
}
r = requests.delete('https://api.cmd.tyntec.com/v3/companies/{companyId}/teams/{jid}', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','https://api.cmd.tyntec.com/v3/companies/{companyId}/teams/{jid}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/companies/{companyId}/teams/{jid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://api.cmd.tyntec.com/v3/companies/{companyId}/teams/{jid}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /companies/{companyId}/teams/{jid}
An existing Team can be deleted
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
companyId | path | string | true | Company ID |
jid | path | string(email) | true | Jabber IDs to represent contacts |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | No Content | None |
List all assistants
Code samples
# You can also use wget
curl -X GET https://api.cmd.tyntec.com/v3/companies/{companyId}/assistants \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.cmd.tyntec.com/v3/companies/{companyId}/assistants HTTP/1.1
Host: api.cmd.tyntec.com
Accept: application/json
Authorization: Bearer {access-token}
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/companies/{companyId}/assistants',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.cmd.tyntec.com/v3/companies/{companyId}/assistants',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.cmd.tyntec.com/v3/companies/{companyId}/assistants', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.cmd.tyntec.com/v3/companies/{companyId}/assistants', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/companies/{companyId}/assistants");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.cmd.tyntec.com/v3/companies/{companyId}/assistants", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /companies/{companyId}/assistants
A list of all assistants can be requested using the GET method.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
companyId | path | string | true | ID of the company |
Example responses
200 Response
[
{
"color": 8,
"description": "Sales assistant",
"jid": "jane@mycompany.com",
"name": "Jane Mayer"
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [assistantResponse] | false | none | [Single assistant response] |
» color | integer | false | none | Color |
» description | string | false | none | Role of the Assistant |
» jid | string(email) | false | none | Id of the key |
» name | string | false | none | Name of the assistant |
Update an assistant
Code samples
# You can also use wget
curl -X PATCH https://api.cmd.tyntec.com/v3/companies/{companyId}/assistants/{jid} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
PATCH https://api.cmd.tyntec.com/v3/companies/{companyId}/assistants/{jid} HTTP/1.1
Host: api.cmd.tyntec.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer {access-token}
const inputBody = '{
"color": 0,
"description": "string",
"name": "string",
"enabled": true
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/companies/{companyId}/assistants/{jid}',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.patch 'https://api.cmd.tyntec.com/v3/companies/{companyId}/assistants/{jid}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.patch('https://api.cmd.tyntec.com/v3/companies/{companyId}/assistants/{jid}', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PATCH','https://api.cmd.tyntec.com/v3/companies/{companyId}/assistants/{jid}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/companies/{companyId}/assistants/{jid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PATCH", "https://api.cmd.tyntec.com/v3/companies/{companyId}/assistants/{jid}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PATCH /companies/{companyId}/assistants/{jid}
An assistant can be updated using the PATCH method. Only the specified fields will be updated, all other fields will remain unchanged. The following fields can be updated, color, description, name
Body parameter
{
"color": 0,
"description": "string",
"name": "string",
"enabled": true
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
companyId | path | string | true | ID of the company |
jid | path | string(email) | true | Jabber IDs to represent contacts |
body | body | object | true | The assistant you would like to update |
» color | body | integer | false | Color |
» description | body | string | false | Description of the assistant |
» name | body | string | false | Name of the assistant |
» enabled | body | boolean | false | is the assistant enabled |
Example responses
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | None |
Response Schema
Create a label
Code samples
# You can also use wget
curl -X POST https://api.cmd.tyntec.com/v3/companies/{companyId}/labels \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.cmd.tyntec.com/v3/companies/{companyId}/labels HTTP/1.1
Host: api.cmd.tyntec.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer {access-token}
const inputBody = '{
"description": "Support related questions",
"name": "Support"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/companies/{companyId}/labels',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.cmd.tyntec.com/v3/companies/{companyId}/labels',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.cmd.tyntec.com/v3/companies/{companyId}/labels', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.cmd.tyntec.com/v3/companies/{companyId}/labels', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/companies/{companyId}/labels");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.cmd.tyntec.com/v3/companies/{companyId}/labels", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /companies/{companyId}/labels
Create a new label. The name must be unique.
Body parameter
{
"description": "Support related questions",
"name": "Support"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
companyId | path | string | true | Company ID |
body | body | object | true | The label you would like to create |
» description | body | string | false | Description of the label |
» name | body | string | false | Name of the label |
Example responses
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Created | None |
Response Schema
List all labels
Code samples
# You can also use wget
curl -X GET https://api.cmd.tyntec.com/v3/companies/{companyId}/labels \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.cmd.tyntec.com/v3/companies/{companyId}/labels HTTP/1.1
Host: api.cmd.tyntec.com
Accept: application/json
Authorization: Bearer {access-token}
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/companies/{companyId}/labels',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.cmd.tyntec.com/v3/companies/{companyId}/labels',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.cmd.tyntec.com/v3/companies/{companyId}/labels', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.cmd.tyntec.com/v3/companies/{companyId}/labels', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/companies/{companyId}/labels");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.cmd.tyntec.com/v3/companies/{companyId}/labels", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /companies/{companyId}/labels
A list of all labels can be requested
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
companyId | path | string | true | Company ID |
Example responses
200 Response
[]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» anonymous | any | false | none | none |
Update a label
Code samples
# You can also use wget
curl -X PATCH https://api.cmd.tyntec.com/v3/companies/{companyId}/labels/{jid} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
PATCH https://api.cmd.tyntec.com/v3/companies/{companyId}/labels/{jid} HTTP/1.1
Host: api.cmd.tyntec.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer {access-token}
const inputBody = '{
"color": 8,
"name": "Customer support",
"priority": 0
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/companies/{companyId}/labels/{jid}',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.patch 'https://api.cmd.tyntec.com/v3/companies/{companyId}/labels/{jid}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.patch('https://api.cmd.tyntec.com/v3/companies/{companyId}/labels/{jid}', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PATCH','https://api.cmd.tyntec.com/v3/companies/{companyId}/labels/{jid}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/companies/{companyId}/labels/{jid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PATCH", "https://api.cmd.tyntec.com/v3/companies/{companyId}/labels/{jid}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PATCH /companies/{companyId}/labels/{jid}
A label can be updated using the PATCH method. Only the specified fields will be updated, all other fields will remain unchanged. The following fields can be updated color, name, priority.
Body parameter
{
"color": 8,
"name": "Customer support",
"priority": 0
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
companyId | path | string | true | Company ID |
jid | path | string(email) | true | Jabber IDs to represent contacts |
body | body | object | true | The label you would like to update |
» color | body | integer | false | Color of the label |
» name | body | string | false | Friendly name of the label |
» priority | body | integer | false | Priority of the label |
Example responses
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | None |
Response Schema
Delete a label
Code samples
# You can also use wget
curl -X DELETE https://api.cmd.tyntec.com/v3/companies/{companyId}/labels/{jid} \
-H 'Authorization: Bearer {access-token}'
DELETE https://api.cmd.tyntec.com/v3/companies/{companyId}/labels/{jid} HTTP/1.1
Host: api.cmd.tyntec.com
Authorization: Bearer {access-token}
const headers = {
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/companies/{companyId}/labels/{jid}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.delete 'https://api.cmd.tyntec.com/v3/companies/{companyId}/labels/{jid}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Authorization': 'Bearer {access-token}'
}
r = requests.delete('https://api.cmd.tyntec.com/v3/companies/{companyId}/labels/{jid}', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','https://api.cmd.tyntec.com/v3/companies/{companyId}/labels/{jid}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/companies/{companyId}/labels/{jid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://api.cmd.tyntec.com/v3/companies/{companyId}/labels/{jid}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /companies/{companyId}/labels/{jid}
An existing label can be deleted by using the DELETE method.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
companyId | path | string | true | Company ID |
jid | path | string(email) | true | Jabber IDs to represent contacts |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | No Content | None |
Channel Management
The available channels can be used.
List all channels
Code samples
# You can also use wget
curl -X GET https://api.cmd.tyntec.com/v3/channels \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.cmd.tyntec.com/v3/channels HTTP/1.1
Host: api.cmd.tyntec.com
Accept: application/json
Authorization: Bearer {access-token}
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.cmd.tyntec.com/v3/channels',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.cmd.tyntec.com/v3/channels', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.cmd.tyntec.com/v3/channels', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.cmd.tyntec.com/v3/channels", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /channels
A list of all channels can be requested
Example responses
200 Response
[
{
"dataRetentionInDays": 90,
"jid": "31611111111@company.com",
"name": "WhatApp",
"priority": 0
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [channelResponse] | false | none | [Channel Response] |
» dataRetentionInDays | integer | false | none | Body/text of the message |
» jid | string(email) | false | none | ID |
» name | string | false | none | Name of the channel |
» priority | integer | false | none | Priority of the channel |
Update a channel
Code samples
# You can also use wget
curl -X PATCH https://api.cmd.tyntec.com/v3/channels/{channelJid} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
PATCH https://api.cmd.tyntec.com/v3/channels/{channelJid} HTTP/1.1
Host: api.cmd.tyntec.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer {access-token}
const inputBody = '{
"name": 0,
"priority": 0
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.patch 'https://api.cmd.tyntec.com/v3/channels/{channelJid}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.patch('https://api.cmd.tyntec.com/v3/channels/{channelJid}', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PATCH','https://api.cmd.tyntec.com/v3/channels/{channelJid}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PATCH", "https://api.cmd.tyntec.com/v3/channels/{channelJid}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PATCH /channels/{channelJid}
A channel can be updated using the PATCH method. Only the specified fields will be updated, all other fields will remain unchanged. The following fields can be updated, name, priority
Body parameter
{
"name": 0,
"priority": 0
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
body | body | object | true | The channel you would like to update |
» name | body | integer | false | Name of the channel |
» priority | body | integer | false | Priority of the channel |
Example responses
200 Response
{
"dataRetentionInDays": 90,
"jid": "31611111111@company.com",
"name": "WhatApp",
"priority": 0
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | channelResponse |
WhatsApp Management
WhatsApp Business channel has the following additional features:
- Profile – define customer-facing information that consists of a logo, business information and an About message
- QR code – assign QR codes to messages and other objects in WhatsApp
- Message templates – define your message templates
Message templates
Operations for WhatsApp Business templates.
An example of a media template with a header, body, footer and buttons is as follows:
{
"category": "TICKET_UPDATE",
"components": [
{
"format": "DOCUMENT",
"type": "HEADER"
},
{
"text": "This is your KLM ticket for your flight on December 20th to New York.",
"type": "BODY"
},
{
"text": "Questions? We are available now, just send us a message",
"type": "FOOTER"
},
{
"buttons": [
{
"text": "Confirm",
"type": "QUICK_REPLY"
},
{
"text": "Reschedule",
"type": "QUICK_REPLY"
}
],
"type": "BUTTONS"
}
],
"language": "en",
"name": "ticket"
}
And this is a response example:
{
"namespace": "e08e69cb_d136_86fc_c33f_0f64becd1f46",
"templates": [
{
"category": "ISSUE_RESOLUTION",
"name": "delivery_notification",
"translations": [
{
"components": [
{
"text": "Hello {{1}}, your order with reference {{2}} has been delivered.",
"type": "body"
}
],
"localeName": "en",
"status": "APPROVED"
},
{
"components": [
{
"text": "Hallo {{1}}, je bestelling met nummer {{2}} is afgeleverd.",
"type": "body"
}
],
"localeName": "nl",
"rejectedReason": "NONE",
"status": "APPROVED"
}
]
},
{
"category": "ACCOUNT_UPDATE",
"name": "hello",
"translations": [
{
"components": [
{
"text": "Hello {{1}}",
"type": "body"
}
],
"localeName": "en",
"rejectedReason": "PROMOTIONAL",
"status": "REJECTED"
}
]
}
]
}
Read your profile
Code samples
# You can also use wget
curl -X GET https://api.cmd.tyntec.com/v3/channels/{channelJid}/profile \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.cmd.tyntec.com/v3/channels/{channelJid}/profile HTTP/1.1
Host: api.cmd.tyntec.com
Accept: application/json
Authorization: Bearer {access-token}
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/profile',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/profile',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.cmd.tyntec.com/v3/channels/{channelJid}/profile', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.cmd.tyntec.com/v3/channels/{channelJid}/profile', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/profile");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/profile", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /channels/{channelJid}/profile
The WhatsApp Business profile can be retrieved
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
Example responses
200 Response
{
"about": "Welcome! We are here to help you 24/7",
"businessProfile": {
"address": "High Street 15, New York",
"description": "YourCompany Ltd.",
"email": "info@your-company.com",
"vertical": "Vertical",
"websites": [
"www.company1.com",
"www.company2.com"
]
},
"name": "YourCompany",
"phoneNumber": 31612345678,
"pictureUrl": "https://pps.whatsapp.net/v/t61.24694-24/s96x96/71527172_751740171986704_2078049712831220364_n.jpg?oe=5E2168E9&oh=174efd2076218dff633a1e748beac190"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | profileResponse |
Overwrite your profile
Code samples
# You can also use wget
curl -X POST https://api.cmd.tyntec.com/v3/channels/{channelJid}/profile \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.cmd.tyntec.com/v3/channels/{channelJid}/profile HTTP/1.1
Host: api.cmd.tyntec.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer {access-token}
const inputBody = '{
"about": "Welcome! We are here to help you 24/7",
"businessProfile": {
"address": "High Street 15, New York",
"description": "YourCompany Ltd.",
"email": "info@your-company.com",
"vertical": null,
"websites": [
"https://your-company.com"
]
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/profile',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/profile',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.cmd.tyntec.com/v3/channels/{channelJid}/profile', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.cmd.tyntec.com/v3/channels/{channelJid}/profile', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/profile");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/profile", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /channels/{channelJid}/profile
The WhatsApp Business profile can be completely overwritten or partially updated. The POST method is used to overwrite the whole profile.
Body parameter
{
"about": "Welcome! We are here to help you 24/7",
"businessProfile": {
"address": "High Street 15, New York",
"description": "YourCompany Ltd.",
"email": "info@your-company.com",
"vertical": null,
"websites": [
"https://your-company.com"
]
}
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
body | body | object | true | The profile you would like to overwrite |
» about | body | string | false | Description of what is this profile about. |
» businessProfile | body | object | false | WhatsApp for Business profile |
»» address | body | string | false | Address associated with the profile |
»» description | body | string | false | Description of the profile |
body | string(email) | false | email address associated with the WhatsApp for business profile | |
»» vertical | body | string | false | none |
»» websites | body | [website] | false | [Website URL] |
Example responses
200 Response
{
"about": "Welcome! We are here to help you 24/7",
"businessProfile": {
"address": "High Street 15, New York",
"description": "YourCompany Ltd.",
"email": "info@your-company.com",
"vertical": "Vertical",
"websites": [
"www.company1.com",
"www.company2.com"
]
},
"name": "YourCompany",
"phoneNumber": 31612345678,
"pictureUrl": "https://pps.whatsapp.net/v/t61.24694-24/s96x96/71527172_751740171986704_2078049712831220364_n.jpg?oe=5E2168E9&oh=174efd2076218dff633a1e748beac190"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | profileResponse |
Update your profile
Code samples
# You can also use wget
curl -X PATCH https://api.cmd.tyntec.com/v3/channels/{channelJid}/profile \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
PATCH https://api.cmd.tyntec.com/v3/channels/{channelJid}/profile HTTP/1.1
Host: api.cmd.tyntec.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer {access-token}
const inputBody = '{
"businessProfile": {
"description": "YourCompany Ltd.",
"email": "info@your-company.com"
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/profile',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.patch 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/profile',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.patch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/profile', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PATCH','https://api.cmd.tyntec.com/v3/channels/{channelJid}/profile', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/profile");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PATCH", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/profile", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PATCH /channels/{channelJid}/profile
The PATCH method is used for a partial update. Unspecified fields will remain unchanged.
Body parameter
{
"businessProfile": {
"description": "YourCompany Ltd.",
"email": "info@your-company.com"
}
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
body | body | object | true | The profile you would like to update |
» businessProfile | body | object | false | Example of WhatsApp for Business profile update |
»» description | body | string | false | Description of the profile |
body | string(email) | false | email address associated with the WhatsApp for business profile |
Example responses
200 Response
{
"about": "Welcome! We are here to help you 24/7",
"businessProfile": {
"address": "High Street 15, New York",
"description": "YourCompany Ltd.",
"email": "info@your-company.com",
"vertical": "Vertical",
"websites": [
"www.company1.com",
"www.company2.com"
]
},
"name": "YourCompany",
"phoneNumber": 31612345678,
"pictureUrl": "https://pps.whatsapp.net/v/t61.24694-24/s96x96/71527172_751740171986704_2078049712831220364_n.jpg?oe=5E2168E9&oh=174efd2076218dff633a1e748beac190"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | profileResponse |
List all QR codes
Code samples
# You can also use wget
curl -X GET https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes HTTP/1.1
Host: api.cmd.tyntec.com
Accept: application/json
Authorization: Bearer {access-token}
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /channels/{channelJid}/qr-codes
A list of all QR codes can be requested
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
Example responses
200 Response
[]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» anonymous | any | false | none | none |
Create a QR code
Code samples
# You can also use wget
curl -X POST https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes HTTP/1.1
Host: api.cmd.tyntec.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer {access-token}
const inputBody = '{
"message": "I have a question about product ABC"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /channels/{channelJid}/qr-codes
Create a new QR code with a prefilled message for WhatsApp Business
Body parameter
{
"message": "I have a question about product ABC"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
body | body | object | true | The QR code you would like to create |
» message | body | string | false | Text/Body of the message. |
Example responses
201 Response
{
"code": "VETO8Y3SYCSFH1",
"createdAt": "2020-03-11T19:53:02.000000Z",
"image": "https://scontent.xx.fbcdn.net/...",
"message": "I have a question about product ABC",
"updatedAt": "2020-04-11T19:53:02.000000Z",
"url": "https://wa.me/message/VEKO8Y3SYCSFH1"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Created | qrCodeResponse |
Update a QR code
Code samples
# You can also use wget
curl -X PATCH https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes/{code} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
PATCH https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes/{code} HTTP/1.1
Host: api.cmd.tyntec.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer {access-token}
const inputBody = '{
"message": "I have a question about product ABC"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes/{code}',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.patch 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes/{code}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.patch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes/{code}', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PATCH','https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes/{code}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes/{code}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PATCH", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes/{code}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PATCH /channels/{channelJid}/qr-codes/{code}
The prefilled message of a QR code can be updated using the PATCH method. Only the specified fields will be updated, all other fields will remain unchanged. The following fields can be updated message
Body parameter
{
"message": "I have a question about product ABC"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
code | path | string | true | QR code |
body | body | object | true | The QR code you would like to update |
» message | body | string | true | Text/Body of the message. |
Example responses
200 Response
{
"code": "VETO8Y3SYCSFH1",
"createdAt": "2020-03-11T19:53:02.000000Z",
"image": "https://scontent.xx.fbcdn.net/...",
"message": "I have a question about product ABC",
"updatedAt": "2020-04-11T19:53:02.000000Z",
"url": "https://wa.me/message/VEKO8Y3SYCSFH1"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | qrCodeResponse |
Delete a QR code
Code samples
# You can also use wget
curl -X DELETE https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes/{code} \
-H 'Authorization: Bearer {access-token}'
DELETE https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes/{code} HTTP/1.1
Host: api.cmd.tyntec.com
Authorization: Bearer {access-token}
const headers = {
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes/{code}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.delete 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes/{code}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Authorization': 'Bearer {access-token}'
}
r = requests.delete('https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes/{code}', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes/{code}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes/{code}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/qr-codes/{code}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /channels/{channelJid}/qr-codes/{code}
An existing QR code can be deleted
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
code | path | string | true | QR code |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | No Content | None |
List all templates
Code samples
# You can also use wget
curl -X GET https://api.cmd.tyntec.com/v3/channels/{channelJid}/templates \
-H 'Authorization: Bearer {access-token}'
GET https://api.cmd.tyntec.com/v3/channels/{channelJid}/templates HTTP/1.1
Host: api.cmd.tyntec.com
Authorization: Bearer {access-token}
const headers = {
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/templates',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/templates',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.cmd.tyntec.com/v3/channels/{channelJid}/templates', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.cmd.tyntec.com/v3/channels/{channelJid}/templates', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/templates");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/templates", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /channels/{channelJid}/templates
All WhatsApp Business templates can be retrieved
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK - Check response in example above | None |
Create a template
Code samples
# You can also use wget
curl -X POST https://api.cmd.tyntec.com/v3/channels/{channelJid}/templates \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.cmd.tyntec.com/v3/channels/{channelJid}/templates HTTP/1.1
Host: api.cmd.tyntec.com
Content-Type: application/json
Authorization: Bearer {access-token}
const inputBody = '{
"category": "ISSUE_RESOLUTION",
"components": "string",
"language": "en",
"name": "support_after_24hours"
}';
const headers = {
'Content-Type':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/templates',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/templates',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.cmd.tyntec.com/v3/channels/{channelJid}/templates', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.cmd.tyntec.com/v3/channels/{channelJid}/templates', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/templates");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/templates", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /channels/{channelJid}/templates
Create a new WhatsApp Business template. Templates can include a header, body, footer and buttons.
Body parameter
{
"category": "ISSUE_RESOLUTION",
"components": "string",
"language": "en",
"name": "support_after_24hours"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
body | body | object | true | The template you would like to create |
» category | body | string | true | Category text |
» components | body | string | false | Array of components to be used in the template |
» language | body | string | true | Language to be used in the template |
» name | body | string | true | Name of the template |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Created - Check response in example above | None |
Delete a template
Code samples
# You can also use wget
curl -X DELETE https://api.cmd.tyntec.com/v3/channels/{channelJid}/templates/{name} \
-H 'Authorization: Bearer {access-token}'
DELETE https://api.cmd.tyntec.com/v3/channels/{channelJid}/templates/{name} HTTP/1.1
Host: api.cmd.tyntec.com
Authorization: Bearer {access-token}
const headers = {
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/templates/{name}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.delete 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/templates/{name}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Authorization': 'Bearer {access-token}'
}
r = requests.delete('https://api.cmd.tyntec.com/v3/channels/{channelJid}/templates/{name}', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','https://api.cmd.tyntec.com/v3/channels/{channelJid}/templates/{name}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/templates/{name}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/templates/{name}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /channels/{channelJid}/templates/{name}
An existing Template can be deleted
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
name | path | string | true | Name of the template to be deleted |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | No Content | None |
Quick Reply Management
Operations around management of quick replies.
List of available quick replies
Code samples
# You can also use wget
curl -X GET https://api.cmd.tyntec.com/v3/companies/current/quick-replies \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.cmd.tyntec.com/v3/companies/current/quick-replies HTTP/1.1
Host: api.cmd.tyntec.com
Accept: application/json
Authorization: Bearer {access-token}
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/companies/current/quick-replies',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.cmd.tyntec.com/v3/companies/current/quick-replies',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.cmd.tyntec.com/v3/companies/current/quick-replies', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.cmd.tyntec.com/v3/companies/current/quick-replies', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/companies/current/quick-replies");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.cmd.tyntec.com/v3/companies/current/quick-replies", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /companies/current/quick-replies
Quick replies available for the current company
Example responses
200 Response
[
{
"category": "Welcome Message",
"createdAt": "2021-07-05T06:20:33.000000Z",
"jids": [
"123152345245@whatsapp.eazy.im"
],
"message": "Hi {{1}}, how can we help you?",
"name": "welcome",
"updatedAt": "2021-07-05T06:28:33.000000Z"
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | quickRepliesResponse |
Contact Management
Operations regarding contacts.
Remarks & Notes
Assign remarks and notes to contacts.
Contact lists
Operations regarding custom lists of contacts that can be created in the GUI. You may use contact lists to send the same message to several contacts at once while keeping them as individual recipients.
Black list
Contacts can be black listed so that any messages received from those contacts are ignored. Also agents will not be able to send messages to blacklisted contacts.
Create a contact
Code samples
# You can also use wget
curl -X POST https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts HTTP/1.1
Host: api.cmd.tyntec.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer {access-token}
const inputBody = '{
"jid": "31611111111@company.com",
"name": "John Doe",
"reference": "Customer #545",
"remarks": "VIP"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /channels/{channelJid}/contacts
Create a new contact.
Body parameter
{
"jid": "31611111111@company.com",
"name": "John Doe",
"reference": "Customer #545",
"remarks": "VIP"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
body | body | object | true | The contact you would like to create |
» jid | body | string | false | Contact ID |
» name | body | string | false | Name of the contact |
» reference | body | string | false | Reference of the contact |
» remarks | body | string | false | Comment for the contact |
Example responses
201 Response
{
"names": [],
"notes": [],
"phoneNumber": 31611111111,
"reference": "Customer #545",
"remarks": "VIP",
"type": "INDIVIDUAL"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Created | contactResponse |
Read a contact
Code samples
# You can also use wget
curl -X GET https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid} HTTP/1.1
Host: api.cmd.tyntec.com
Accept: application/json
Authorization: Bearer {access-token}
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /channels/{channelJid}/contacts/{contactJid}
A contact can be retrieved
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
contactJid | path | string(email) | true | Jabber IDs to represent contacts |
Example responses
200 Response
{
"names": [],
"notes": [],
"phoneNumber": 31611111111,
"reference": "Customer #545",
"remarks": "VIP",
"type": "INDIVIDUAL"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | contactResponse |
Update a contact
Code samples
# You can also use wget
curl -X PATCH https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
PATCH https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid} HTTP/1.1
Host: api.cmd.tyntec.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer {access-token}
const inputBody = '{
"name": "John Doe",
"reference": "Customer #545",
"remarks": "VIP"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.patch 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.patch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PATCH','https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PATCH", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PATCH /channels/{channelJid}/contacts/{contactJid}
A contact can be updated using the PATCH method. Only the specified fields will be updated, all other fields will remain unchanged. The following fields can be updated name, reference, remarks
Body parameter
{
"name": "John Doe",
"reference": "Customer #545",
"remarks": "VIP"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
contactJid | path | string(email) | true | Jabber IDs to represent contacts |
body | body | object | true | The contact you would like to update |
» name | body | string | false | Name of the contact |
» reference | body | string | false | Reference of the contact |
» remarks | body | string | false | Comment for the contact |
Example responses
200 Response
{
"names": [],
"notes": [],
"phoneNumber": 31611111111,
"reference": "Customer #545",
"remarks": "VIP",
"type": "INDIVIDUAL"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | contactResponse |
List blocked contacts
Code samples
# You can also use wget
curl -X GET https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/blacklist \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/blacklist HTTP/1.1
Host: api.cmd.tyntec.com
Accept: application/json
Authorization: Bearer {access-token}
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/blacklist',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/blacklist',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/blacklist', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/blacklist', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/blacklist");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/blacklist", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /channels/{channelJid}/contacts/blacklist
A list of all blocked contacts can be requested.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
Example responses
200 Response
[]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» anonymous | any | false | none | none |
Block a contact
Code samples
# You can also use wget
curl -X POST https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/blacklist/{contactJid} \
-H 'Authorization: Bearer {access-token}'
POST https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/blacklist/{contactJid} HTTP/1.1
Host: api.cmd.tyntec.com
Authorization: Bearer {access-token}
const headers = {
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/blacklist/{contactJid}',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/blacklist/{contactJid}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/blacklist/{contactJid}', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/blacklist/{contactJid}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/blacklist/{contactJid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/blacklist/{contactJid}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /channels/{channelJid}/contacts/blacklist/{contactJid}
A contact can be blocked by adding it to the blacklist. Messages received from a blocked contact will be ignored and it is not possible to send messages to it.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
contactJid | path | string(email) | true | Jabber IDs to represent contacts |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | No Content | None |
Unblock a contact
Code samples
# You can also use wget
curl -X DELETE https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/blacklist/{contactJid} \
-H 'Authorization: Bearer {access-token}'
DELETE https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/blacklist/{contactJid} HTTP/1.1
Host: api.cmd.tyntec.com
Authorization: Bearer {access-token}
const headers = {
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/blacklist/{contactJid}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.delete 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/blacklist/{contactJid}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Authorization': 'Bearer {access-token}'
}
r = requests.delete('https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/blacklist/{contactJid}', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/blacklist/{contactJid}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/blacklist/{contactJid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/blacklist/{contactJid}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /channels/{channelJid}/contacts/blacklist/{contactJid}
A contact can be removed from the blacklist
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
contactJid | path | string(email) | true | Jabber IDs to represent contacts |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | No Content | None |
List all contact lists
Code samples
# You can also use wget
curl -X GET https://api.cmd.tyntec.com/v3/channels/{channelJid}/lists \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.cmd.tyntec.com/v3/channels/{channelJid}/lists HTTP/1.1
Host: api.cmd.tyntec.com
Accept: application/json
Authorization: Bearer {access-token}
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/lists',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/lists',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.cmd.tyntec.com/v3/channels/{channelJid}/lists', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.cmd.tyntec.com/v3/channels/{channelJid}/lists', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/lists");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/lists", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /channels/{channelJid}/lists
All lists can be requested
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
Example responses
200 Response
[]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» anonymous | any | false | none | none |
Add a contact to a list
Code samples
# You can also use wget
curl -X POST https://api.cmd.tyntec.com/v3/channels/{channelJid}/lists/{listJid}/{contactJid} \
-H 'Authorization: Bearer {access-token}'
POST https://api.cmd.tyntec.com/v3/channels/{channelJid}/lists/{listJid}/{contactJid} HTTP/1.1
Host: api.cmd.tyntec.com
Authorization: Bearer {access-token}
const headers = {
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/lists/{listJid}/{contactJid}',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/lists/{listJid}/{contactJid}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.cmd.tyntec.com/v3/channels/{channelJid}/lists/{listJid}/{contactJid}', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.cmd.tyntec.com/v3/channels/{channelJid}/lists/{listJid}/{contactJid}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/lists/{listJid}/{contactJid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/lists/{listJid}/{contactJid}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /channels/{channelJid}/lists/{listJid}/{contactJid}
A contact can be added to a list.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
listJid | path | string(email) | true | Jabber IDs to represent a list |
contactJid | path | string(email) | true | Jabber IDs to represent contacts |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | None |
Remove a contact from a list
Code samples
# You can also use wget
curl -X DELETE https://api.cmd.tyntec.com/v3/channels/{channelJid}/lists/{listJid}/{contactJid} \
-H 'Authorization: Bearer {access-token}'
DELETE https://api.cmd.tyntec.com/v3/channels/{channelJid}/lists/{listJid}/{contactJid} HTTP/1.1
Host: api.cmd.tyntec.com
Authorization: Bearer {access-token}
const headers = {
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/lists/{listJid}/{contactJid}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.delete 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/lists/{listJid}/{contactJid}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Authorization': 'Bearer {access-token}'
}
r = requests.delete('https://api.cmd.tyntec.com/v3/channels/{channelJid}/lists/{listJid}/{contactJid}', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','https://api.cmd.tyntec.com/v3/channels/{channelJid}/lists/{listJid}/{contactJid}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/lists/{listJid}/{contactJid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/lists/{listJid}/{contactJid}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /channels/{channelJid}/lists/{listJid}/{contactJid}
A contact can be removed from a list.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
listJid | path | string(email) | true | Jabber IDs to represent a list |
contactJid | path | string(email) | true | Jabber IDs to represent contacts |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | None |
List all notes
Code samples
# You can also use wget
curl -X GET https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes HTTP/1.1
Host: api.cmd.tyntec.com
Accept: application/json
Authorization: Bearer {access-token}
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /channels/{channelJid}/contacts/{contactJid}/notes
List all notes from a contact.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
contactJid | path | string(email) | true | Jabber IDs to represent contacts |
Example responses
200 Response
[
{
"body": "Return order received",
"createdAt": "2020-03-11T19:53:02.000000Z",
"createdBy": "john@mycompany.com",
"id": "280cbbe0-c08a-4606-bf8d-a30242c4eaa4",
"isPinned": false,
"isReadOnly": false,
"updatedAt": "2020-04-11T19:53:02.000000Z",
"referenceId": "CUSTOMER_NUMBER"
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [noteResponse] | false | none | [Single Note Response] |
» body | string | false | none | Text/Body of the note |
» createdAt | string(date-time) | false | none | Date and time the note is created |
» createdBy | string(email) | false | none | Who created this note |
» id | string | false | none | ID of the note |
» isPinned | boolean | false | none | Is this note pinned? |
» isReadOnly | boolean | false | none | Is this note read only or not? |
» updatedAt | string(date-time) | false | none | Date and time the note is last updated |
» referenceId | string | false | none | Reference ID of the note |
Create a note
Code samples
# You can also use wget
curl -X POST https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes HTTP/1.1
Host: api.cmd.tyntec.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer {access-token}
const inputBody = '{
"body": "Customer number #63553",
"referenceId": "CUSTOMER_NUMBER"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /channels/{channelJid}/contacts/{contactJid}/notes
Create a new note in a contact.
Body parameter
{
"body": "Customer number #63553",
"referenceId": "CUSTOMER_NUMBER"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
contactJid | path | string(email) | true | Jabber IDs to represent contacts |
body | body | object | true | The note you would like to create |
» body | body | string | false | Text/Body of the note. |
» referenceId | body | string | false | Friendly reference name as an ID. |
Example responses
201 Response
{
"body": "Return order received",
"createdAt": "2020-03-11T19:53:02.000000Z",
"createdBy": "john@mycompany.com",
"id": "280cbbe0-c08a-4606-bf8d-a30242c4eaa4",
"isPinned": false,
"isReadOnly": false,
"updatedAt": "2020-04-11T19:53:02.000000Z",
"referenceId": "CUSTOMER_NUMBER"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Created | noteResponse |
Update a note
Code samples
# You can also use wget
curl -X POST https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes/{id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes/{id} HTTP/1.1
Host: api.cmd.tyntec.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer {access-token}
const inputBody = '{
"body": "Customer number #63553",
"isPinned": true,
"isReadOnly": false,
"referenceId": "CUSTOMER_NUMBER"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes/{id}',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes/{id}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes/{id}', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes/{id}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /channels/{channelJid}/contacts/{contactJid}/notes/{id}
Update a note in a contact. Only the specified fields will be updated, all other fields will remain unchanged. The following fields can be updated: body, isPinned, isReadOnly, referenceId
Body parameter
{
"body": "Customer number #63553",
"isPinned": true,
"isReadOnly": false,
"referenceId": "CUSTOMER_NUMBER"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
contactJid | path | string(email) | true | Jabber IDs to represent contacts |
id | path | string | true | ID of the node |
body | body | object | true | The note you would like to update |
» body | body | string | false | Text/Body of the note. |
» isPinned | body | boolean | false | Is this note pinned? |
» isReadOnly | body | boolean | false | Is this note read only or not? |
» referenceId | body | string | false | Friendly reference name as an ID. |
Example responses
201 Response
{
"body": "Return order received",
"createdAt": "2020-03-11T19:53:02.000000Z",
"createdBy": "john@mycompany.com",
"id": "280cbbe0-c08a-4606-bf8d-a30242c4eaa4",
"isPinned": false,
"isReadOnly": false,
"updatedAt": "2020-04-11T19:53:02.000000Z",
"referenceId": "CUSTOMER_NUMBER"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Created | noteResponse |
Delete a note
Code samples
# You can also use wget
curl -X DELETE https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes/{id} \
-H 'Authorization: Bearer {access-token}'
DELETE https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes/{id} HTTP/1.1
Host: api.cmd.tyntec.com
Authorization: Bearer {access-token}
const headers = {
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes/{id}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.delete 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes/{id}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Authorization': 'Bearer {access-token}'
}
r = requests.delete('https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes/{id}', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/contacts/{contactJid}/notes/{id}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /channels/{channelJid}/contacts/{contactJid}/notes/{id}
Delete an existing note in a contact.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
contactJid | path | string(email) | true | Jabber IDs to represent contacts |
id | path | string | true | ID of the node |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | No Content | None |
Conversation Management
Operations regarding conversations.
Use cases
The following table shows a quick reference of the most common use cases.
Example | Description |
---|---|
status: "CLOSED" | Close the conversation |
assignee: "john@mycompany.com" | Handover the conversation from the assistant to a specific agent or assistant |
assignee: null | Handover the conversation from the assistant to the agents |
labels: ["1580486175684@label.eazy.im"] | Label the conversation with the specified labels |
labels: [] | Unlabel the conversation |
unreadCount: null | Mark as read |
unreadCount: 0 | Mark as unread |
Comments
Comments can be used in many paths of this API.
Automated messages
Automated messages are used in conversations.
List all automated messages
Code samples
# You can also use wget
curl -X GET https://api.cmd.tyntec.com/v3/channels/{channelJid}/automated-messages \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.cmd.tyntec.com/v3/channels/{channelJid}/automated-messages HTTP/1.1
Host: api.cmd.tyntec.com
Accept: application/json
Authorization: Bearer {access-token}
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/automated-messages',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/automated-messages',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.cmd.tyntec.com/v3/channels/{channelJid}/automated-messages', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.cmd.tyntec.com/v3/channels/{channelJid}/automated-messages', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/automated-messages");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/automated-messages", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /channels/{channelJid}/automated-messages
A list of all automated messages can be requested using the GET method.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
Example responses
200 Response
[
{
"body": "Sorry, we are currently closed. Your question will be answered as soon as possible.",
"createdAt": "2020-03-11T19:00:02.000000Z",
"enabled": true,
"type": "AWAY",
"updatedAt": "2020-04-11T19:00:02.000000Z"
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [autoMessageResponse] | false | none | [Automated message response] |
» body | string | false | none | Body/text of the message |
» createdAt | string(date-time) | false | none | When message is created |
» enabled | boolean | false | none | Is the message enabled? |
» type | string | false | none | Name of the assistant |
» updatedAt | string(date-time) | false | none | When message is last updated |
Enumerated values
Property | Value |
---|---|
type | AWAY |
type | GREETING |
Read an automated message
Code samples
# You can also use wget
curl -X GET https://api.cmd.tyntec.com/v3/channels/{channelJid}/automated-messages/{type} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.cmd.tyntec.com/v3/channels/{channelJid}/automated-messages/{type} HTTP/1.1
Host: api.cmd.tyntec.com
Accept: application/json
Authorization: Bearer {access-token}
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/automated-messages/{type}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/automated-messages/{type}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.cmd.tyntec.com/v3/channels/{channelJid}/automated-messages/{type}', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.cmd.tyntec.com/v3/channels/{channelJid}/automated-messages/{type}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/automated-messages/{type}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/automated-messages/{type}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /channels/{channelJid}/automated-messages/{type}
A specific automated message can be requested.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
type | path | string | true | Type of automated message |
Enumerated values
Parameter | Value |
---|---|
type | AWAY |
type | GREETING |
Example responses
200 Response
{
"body": "Sorry, we are currently closed. Your question will be answered as soon as possible.",
"createdAt": "2020-03-11T19:00:02.000000Z",
"enabled": true,
"type": "AWAY",
"updatedAt": "2020-04-11T19:00:02.000000Z"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The message is accepted by our system | autoMessageResponse |
Update an automated message
Code samples
# You can also use wget
curl -X PATCH https://api.cmd.tyntec.com/v3/channels/{channelJid}/automated-messages/{type} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
PATCH https://api.cmd.tyntec.com/v3/channels/{channelJid}/automated-messages/{type} HTTP/1.1
Host: api.cmd.tyntec.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer {access-token}
const inputBody = '{
"body": "Sorry, we are currently closed. Your question will be answered as soon as possible.",
"enabled": false
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/automated-messages/{type}',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.patch 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/automated-messages/{type}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.patch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/automated-messages/{type}', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PATCH','https://api.cmd.tyntec.com/v3/channels/{channelJid}/automated-messages/{type}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/automated-messages/{type}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PATCH", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/automated-messages/{type}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PATCH /channels/{channelJid}/automated-messages/{type}
An automated message can be updated using the PATCH method. Only the specified fields will be updated, all other fields will remain unchanged. The following fields can be updated body, enabled
Body parameter
{
"body": "Sorry, we are currently closed. Your question will be answered as soon as possible.",
"enabled": false
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
type | path | string | true | Type of automated message |
body | body | object | true | The message you would like to update |
» body | body | string | false | Text of the automated message |
» enabled | body | boolean | false | Is the automated message enabled? |
Enumerated values
Parameter | Value |
---|---|
type | AWAY |
type | GREETING |
Example responses
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | None |
Response Schema
Create a comment
Code samples
# You can also use wget
curl -X POST https://api.cmd.tyntec.com/v3/channels/{channelJid}/conversations/{contactJid}/comments \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.cmd.tyntec.com/v3/channels/{channelJid}/conversations/{contactJid}/comments HTTP/1.1
Host: api.cmd.tyntec.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer {access-token}
const inputBody = '{
"body": "Order #12345 has been delivered"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/conversations/{contactJid}/comments',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/conversations/{contactJid}/comments',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.cmd.tyntec.com/v3/channels/{channelJid}/conversations/{contactJid}/comments', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.cmd.tyntec.com/v3/channels/{channelJid}/conversations/{contactJid}/comments', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/conversations/{contactJid}/comments");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/conversations/{contactJid}/comments", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /channels/{channelJid}/conversations/{contactJid}/comments
Create a new comment for a conversation.
Body parameter
{
"body": "Order #12345 has been delivered"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
contactJid | path | string(email) | true | Jabber IDs to represent contacts |
body | body | object | true | The comment you would like to create |
» body | body | string | false | Text for the comment |
Example responses
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Created | None |
Response Schema
Read a conversation
Code samples
# You can also use wget
curl -X GET https://api.cmd.tyntec.com/v3/channels/{channelJid}/conversations/{contactJid} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.cmd.tyntec.com/v3/channels/{channelJid}/conversations/{contactJid} HTTP/1.1
Host: api.cmd.tyntec.com
Accept: application/json
Authorization: Bearer {access-token}
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/conversations/{contactJid}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/conversations/{contactJid}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.cmd.tyntec.com/v3/channels/{channelJid}/conversations/{contactJid}', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.cmd.tyntec.com/v3/channels/{channelJid}/conversations/{contactJid}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/conversations/{contactJid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/conversations/{contactJid}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /channels/{channelJid}/conversations/{contactJid}
A conversation can be requested
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
contactJid | path | string(email) | true | Jabber IDs to represent contacts |
Example responses
200 Response
{
"assignee": "john@mycompany.com",
"channel": "string",
"contact": "string",
"createdAt": "2019-04-04T15:29:47.000000Z",
"labels": [],
"lastMessageReceivedAt": "2019-04-08T23:55:39.000000Z",
"lastMessageSentAt": "2019-04-07T17:12:00.000000Z",
"messagesReceived": 12,
"messagesSent": 8,
"status": "CLOSED",
"unreadCount": 5
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | conversationResponse |
Update a conversation
Code samples
# You can also use wget
curl -X PATCH https://api.cmd.tyntec.com/v3/channels/{channelJid}/conversations/{contactJid} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
PATCH https://api.cmd.tyntec.com/v3/channels/{channelJid}/conversations/{contactJid} HTTP/1.1
Host: api.cmd.tyntec.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer {access-token}
const inputBody = '{
"assignee": "john@mycompany.com",
"label": "Label123",
"status": "CLOSED",
"unreadCount": 5
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/conversations/{contactJid}',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.patch 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/conversations/{contactJid}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.patch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/conversations/{contactJid}', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PATCH','https://api.cmd.tyntec.com/v3/channels/{channelJid}/conversations/{contactJid}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/conversations/{contactJid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PATCH", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/conversations/{contactJid}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PATCH /channels/{channelJid}/conversations/{contactJid}
A conversation can be updated using the PATCH method. Only the specified fields will be updated, all other fields will remain unchanged. The following fields can be updated assignee, labels, status, unreadCount
Body parameter
{
"assignee": "john@mycompany.com",
"label": "Label123",
"status": "CLOSED",
"unreadCount": 5
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
contactJid | path | string(email) | true | Jabber IDs to represent contacts |
body | body | object | true | The conversation you would like to update |
» assignee | body | string | false | Assistant to the agents |
» label | body | string | false | Labels of the conversation |
» status | body | string | false | Status of the conversation |
» unreadCount | body | integer | false | Number of unread messages |
Enumerated values
Parameter | Value |
---|---|
» status | CLOSED |
» status | OPEN |
Example responses
200 Response
{
"assignee": "john@mycompany.com",
"channel": "string",
"contact": "string",
"createdAt": "2019-04-04T15:29:47.000000Z",
"labels": [],
"lastMessageReceivedAt": "2019-04-08T23:55:39.000000Z",
"lastMessageSentAt": "2019-04-07T17:12:00.000000Z",
"messagesReceived": 12,
"messagesSent": 8,
"status": "CLOSED",
"unreadCount": 5
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | conversationResponse |
Get unread messages
Code samples
# You can also use wget
curl -X GET https://api.cmd.tyntec.com/v3/custom/e96eb049-ec39-4a19-9973-c6f770c4e636/unread?agent=agent%40company.com \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.cmd.tyntec.com/v3/custom/e96eb049-ec39-4a19-9973-c6f770c4e636/unread?agent=agent%40company.com HTTP/1.1
Host: api.cmd.tyntec.com
Accept: application/json
Authorization: Bearer {access-token}
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/custom/e96eb049-ec39-4a19-9973-c6f770c4e636/unread?agent=agent%40company.com',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.cmd.tyntec.com/v3/custom/e96eb049-ec39-4a19-9973-c6f770c4e636/unread',
params: {
'agent' => 'string(email)'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.cmd.tyntec.com/v3/custom/e96eb049-ec39-4a19-9973-c6f770c4e636/unread', params={
'agent': 'agent@company.com'
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.cmd.tyntec.com/v3/custom/e96eb049-ec39-4a19-9973-c6f770c4e636/unread', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/custom/e96eb049-ec39-4a19-9973-c6f770c4e636/unread?agent=agent%40company.com");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.cmd.tyntec.com/v3/custom/e96eb049-ec39-4a19-9973-c6f770c4e636/unread", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /custom/e96eb049-ec39-4a19-9973-c6f770c4e636/unread
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
agent | query | string(email) | true | Agents mail |
Example responses
200 Response
{
"unread": 100
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | unreadMessagesResponse |
Messaging
Send a message
Code samples
# You can also use wget
curl -X POST https://api.cmd.tyntec.com/v3/channels/{channelJid}/messages/{contactJid} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.cmd.tyntec.com/v3/channels/{channelJid}/messages/{contactJid} HTTP/1.1
Host: api.cmd.tyntec.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer {access-token}
const inputBody = '{
"message": {
"body": "Hello world",
"type": "text"
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/messages/{contactJid}',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/messages/{contactJid}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.cmd.tyntec.com/v3/channels/{channelJid}/messages/{contactJid}', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.cmd.tyntec.com/v3/channels/{channelJid}/messages/{contactJid}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/messages/{contactJid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/messages/{contactJid}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /channels/{channelJid}/messages/{contactJid}
Request to send a message to a contact in a channel.
The JSON body structure of each message type is listed below.
Audio
Element | Value | Mandatory | Description |
---|---|---|---|
mimeType | string | Y | MIME type |
type | "audio" | Y | Message type |
Contact
Element | Value | Mandatory | Description |
---|---|---|---|
contacts | array | Y | Contact structure |
type | "contact" | Y | Message type |
Document
Element | Value | Mandatory | Description |
---|---|---|---|
fileName | string | Y | File name |
mimeType | string | Y | MIME type |
title | string | Y | Document title |
type | "document" | Y | Message type |
Gif
Element | Value | Mandatory | Description |
---|---|---|---|
caption | string | N | Caption text message |
mimeType | string | Y | MIME type |
type | "gif" | Y | Message type |
Image
Element | Value | Mandatory | Description |
---|---|---|---|
caption | string | N | Caption text message |
mimeType | string | Y | MIME type |
type | "image" | Y | Message type |
Location
Element | Value | Mandatory | Description |
---|---|---|---|
latitude | float Y | Latitude | coordinate |
longitude | float Y | Longitude | coordinate |
name | string | N | Name of the location |
type | "location" | Y | Message type |
url | string | N | Website URL |
Voice message
Element | Value | Mandatory | Description |
---|---|---|---|
mimeType | string | Y | MIME type |
type | "ptt" | Y | Message type |
Sticker
Element | Value | Mandatory | Description |
---|---|---|---|
mimeType | string | Y | MIME type |
type | "sticker" | Y | Message type |
Template
Element | Value | Mandatory | Description |
---|---|---|---|
template | array | Y | Template structure |
type | "template" | Y | Message type |
Text
Element | Value | Mandatory | Description |
---|---|---|---|
body | string | Y | Message body |
type | "text" | Y | Message type |
Video
Element | Value | Mandatory | Description |
---|---|---|---|
caption | string | N | Caption text message |
mimeType | string | Y | MIME type |
type | "video" | Y | Message type |
Body parameter
{
"message": {
"body": "Hello world",
"type": "text"
}
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
contactJid | path | string(email) | true | Jabber IDs to represent contacts |
body | body | object | true | The message you would like to send |
» message | body | object | false | Outgoing message |
Example responses
202 Response
{
"id": "b48eaa2fab1e942cad8b8717ec6bf3ed2dad05a"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
202 | Accepted | Accepted | Inline |
Response Schema
Status Code 202
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» id | string | false | none | The returned id can be used to match delivery receipts to the original message. |
Receive messages
Code samples
# You can also use wget
curl -X POST https://api.cmd.tyntec.com/v3/incoming \
-H 'Authorization: Bearer {access-token}'
POST https://api.cmd.tyntec.com/v3/incoming HTTP/1.1
Host: api.cmd.tyntec.com
Authorization: Bearer {access-token}
const headers = {
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/incoming',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.cmd.tyntec.com/v3/incoming',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.cmd.tyntec.com/v3/incoming', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.cmd.tyntec.com/v3/incoming', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/incoming");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.cmd.tyntec.com/v3/incoming", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /incoming
To receive messages, create an endpoint on your webserver that will be able to process POST requests and subscribe its URL via Webhook Configuration to the "message" events.
Note: The path above is only an example, you may choose your URL freely.
Responses
Status | Meaning | Description | Schema |
---|
Webhook Configuration
Webhooks are used to receive real-time events like messages and receipts. Multiple webhooks can be defined per channel, each with their own events.
Webhooks must always return a 200 OK response.
Important: HTTPS with TLS 1.2 is required. Self-signed certificates are NOT allowed.
Retries
In the case of connection or HTTP errors, the platform will retry indefinitely.
Webhook Events
The following events are defined:
Name | Description |
---|---|
custom | Custom event for specific customer purposes |
echo | Outgoing messages sent by agents or assistants |
handover | Handover event whenever a conversation is transferred to an assistant or agent |
label | Label event whenever a conversation is labelled or unlabelledv |
message | Incoming messages from customers |
note | Note creation or deletion event |
postback | Postback event for WhatsApp button templates, Apple list pickers etc |
receipt | Message receipt event |
template_pack | Template updates whenever templates are approved, rejected etc. |
typing | Typing indications when customers are typing a message |
List all webhooks
Code samples
# You can also use wget
curl -X GET https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks HTTP/1.1
Host: api.cmd.tyntec.com
Accept: application/json
Authorization: Bearer {access-token}
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /channels/{channelJid}/webhooks
A list of all webhooks can be requested
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
Example responses
200 Response
[]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» anonymous | any | false | none | none |
Create a webhook
Code samples
# You can also use wget
curl -X POST https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks HTTP/1.1
Host: api.cmd.tyntec.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer {access-token}
const inputBody = '{
"events": [
"message"
],
"url": "https://your.company.com/webhook"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /channels/{channelJid}/webhooks
Create a new webhook for the specified events.
Body parameter
{
"events": [
"message"
],
"url": "https://your.company.com/webhook"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
body | body | object | true | The webhook you would like to create |
» events | body | [string] | true | Events described above |
» url | body | string(uri) | true | URL of the webhook |
Example responses
201 Response
{
"assistant": "john@mycompany.com",
"cipherKey": "string",
"createdAt": "2019-04-04T15:29:47.000000Z",
"enabled": true,
"events": [],
"headers": {},
"id": "8520d8d6-7b28-4d6f-8631-ecd528a0246d",
"updatedAt": "2019-04-07T17:12:00.000000Z",
"url": "https://your.company.com/webhook"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Created | webhookResponse |
Update a webhook
Code samples
# You can also use wget
curl -X PATCH https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks/{id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
PATCH https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks/{id} HTTP/1.1
Host: api.cmd.tyntec.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer {access-token}
const inputBody = '{
"name": "Support"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks/{id}',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.patch 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks/{id}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.patch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks/{id}', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PATCH','https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PATCH", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks/{id}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PATCH /channels/{channelJid}/webhooks/{id}
A webhook can be updated using the PATCH method. Only the specified fields will be updated, all other fields will remain unchanged. The following fields can be updated name
Body parameter
{
"name": "Support"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
id | path | string | true | ID of the node |
body | body | object | true | The webhook you would like to update |
» name | body | string | true | Name of the webhook to be created |
Example responses
200 Response
{
"assistant": "john@mycompany.com",
"cipherKey": "string",
"createdAt": "2019-04-04T15:29:47.000000Z",
"enabled": true,
"events": [],
"headers": {},
"id": "8520d8d6-7b28-4d6f-8631-ecd528a0246d",
"updatedAt": "2019-04-07T17:12:00.000000Z",
"url": "https://your.company.com/webhook"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | webhookResponse |
Delete a webhook
Code samples
# You can also use wget
curl -X DELETE https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks/{id} \
-H 'Authorization: Bearer {access-token}'
DELETE https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks/{id} HTTP/1.1
Host: api.cmd.tyntec.com
Authorization: Bearer {access-token}
const headers = {
'Authorization':'Bearer {access-token}'
};
fetch('https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks/{id}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.delete 'https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks/{id}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Authorization': 'Bearer {access-token}'
}
r = requests.delete('https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks/{id}', params={
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://api.cmd.tyntec.com/v3/channels/{channelJid}/webhooks/{id}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /channels/{channelJid}/webhooks/{id}
An existing Webhook can be deleted
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
channelJid | path | string(email) | true | Jabber IDs to represent channel |
id | path | string | true | ID of the node |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | No Content | None |
Schemas
agentResponse
{
"email": "jane@mycompany.com",
"name": {
"firstName": "Jane",
"fullName": "Jane Mayers",
"lastName": "Mayers"
},
"roles": [
"admin",
"user"
],
"status": "OFFLINE",
"teams": [
"company@domail.com"
]
}
Details of an agent
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
string | false | none | email address | |
name | object | false | none | Name |
» firstName | string | false | none | First Name of the Agent |
» fullName | string | false | none | Full Name of the Agent |
» lastName | string | false | none | Last Name of the Agent |
roles | [string] | false | none | The role of the agent |
status | string | false | none | Status of the agent |
teams | [string] | false | none | Teams to be contacted with email |
Enumerated values
Property | Value |
---|---|
status | OFFLINE |
status | AWAY |
status | ONLINE |
apiKeyResponse
{
"cipherKey": "string",
"description": "Test environment",
"id": "509000e9-05c9-43a9-b6f1-70f1c6a5448a",
"lastUsed": "2020-03-11T19:53:02.000000Z",
"objects": [
[
"'jid': '31612345678@tyntec.com'",
"'type': 'CHANNEL'"
]
],
"scope": "CHANNEL",
"whitelist": [
"95.95.95.95",
"12.12.12.12"
]
}
Current API key response
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
cipherKey | string | false | none | Cipher Key |
description | string | false | none | Description for the key or usage of the key |
id | string | false | none | Id of the key |
lastUsed | string(date-time) | false | none | When the key last used |
objects | [array] | false | none | Array of objects. Check example on the right |
scope | string | false | none | The scope of this key |
whitelist | [string] | false | none | Array of whitelisted IPs. Check example on the right |
assistantResponse
{
"color": 8,
"description": "Sales assistant",
"jid": "jane@mycompany.com",
"name": "Jane Mayer"
}
Single assistant response
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
color | integer | false | none | Color |
description | string | false | none | Role of the Assistant |
jid | string(email) | false | none | Id of the key |
name | string | false | none | Name of the assistant |
autoMessageResponse
{
"body": "Sorry, we are currently closed. Your question will be answered as soon as possible.",
"createdAt": "2020-03-11T19:00:02.000000Z",
"enabled": true,
"type": "AWAY",
"updatedAt": "2020-04-11T19:00:02.000000Z"
}
Automated message response
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
body | string | false | none | Body/text of the message |
createdAt | string(date-time) | false | none | When message is created |
enabled | boolean | false | none | Is the message enabled? |
type | string | false | none | Name of the assistant |
updatedAt | string(date-time) | false | none | When message is last updated |
Enumerated values
Property | Value |
---|---|
type | AWAY |
type | GREETING |
channelResponse
{
"dataRetentionInDays": 90,
"jid": "31611111111@company.com",
"name": "WhatApp",
"priority": 0
}
Channel Response
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
dataRetentionInDays | integer | false | none | Body/text of the message |
jid | string(email) | false | none | ID |
name | string | false | none | Name of the channel |
priority | integer | false | none | Priority of the channel |
commentResponse
{
"id": "ee487689cac84f972ff1d8d10ed7b64f4148"
}
Comment response
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | false | none | ID of the contact added the comment |
companyResponse
{
"id": "458e633a-ab50-445f-9d1f-52afbf720ec3",
"name": "tyntec"
}
Company response
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | false | none | ID of the company |
name | string(string) | false | none | Name of the company |
contactResponse
{
"names": [],
"notes": [],
"phoneNumber": 31611111111,
"reference": "Customer #545",
"remarks": "VIP",
"type": "INDIVIDUAL"
}
Contact response
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
names | [name] | false | none | Names |
notes | [note] | false | none | Notes |
phoneNumber | integer | false | none | Phone number of the contact |
reference | string | false | none | Reference of the contact |
remarks | string | false | none | Comment for the contact |
type | string | false | none | Type of the contact |
conversationResponse
{
"assignee": "john@mycompany.com",
"channel": "string",
"contact": "string",
"createdAt": "2019-04-04T15:29:47.000000Z",
"labels": [],
"lastMessageReceivedAt": "2019-04-08T23:55:39.000000Z",
"lastMessageSentAt": "2019-04-07T17:12:00.000000Z",
"messagesReceived": 12,
"messagesSent": 8,
"status": "CLOSED",
"unreadCount": 5
}
Conversation response
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
assignee | string | false | none | Assistant to the agents |
channel | string | false | none | Channel to be used |
contact | string | false | none | Contact of the conversation |
createdAt | string(date-time) | false | none | Date and time the conversation is created |
labels | [allLabelsResponse] | false | none | Labels of the conversation |
lastMessageReceivedAt | string(date-time) | false | none | Date and time the last message is received |
lastMessageSentAt | string(date-time) | false | none | Date and time that the last message is sent |
messagesReceived | integer | false | none | Number of messages received |
messagesSent | integer | false | none | Number of messages sent |
status | string | false | none | Status of the conversation |
unreadCount | integer | false | none | Number of unread messages |
emailsResponse
[
"jane@mycompany1.com",
"jo@mycompany1.com",
"john@company2.com"
]
List all email addresses
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [email] | false | none | List all email addresses |
labelResponse
{
"color": 8,
"jid": "31611111111@company.com",
"name": "Support",
"priority": 0
}
Single Label Response
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
color | integer | false | none | Color |
jid | string(email) | false | none | ID |
name | string | false | none | Name of the label |
priority | integer | false | none | Priority of the channel |
listResponse
{
"jid": "31611111111@company.com",
"name": "Mailing list",
"remarks": "Support"
}
Single list response
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
jid | string(email) | false | none | ID |
name | string | false | none | Name of the list |
remarks | string | false | none | Comment for the list |
noteResponse
{
"body": "Return order received",
"createdAt": "2020-03-11T19:53:02.000000Z",
"createdBy": "john@mycompany.com",
"id": "280cbbe0-c08a-4606-bf8d-a30242c4eaa4",
"isPinned": false,
"isReadOnly": false,
"updatedAt": "2020-04-11T19:53:02.000000Z",
"referenceId": "CUSTOMER_NUMBER"
}
Single Note Response
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
body | string | false | none | Text/Body of the note |
createdAt | string(date-time) | false | none | Date and time the note is created |
createdBy | string(email) | false | none | Who created this note |
id | string | false | none | ID of the note |
isPinned | boolean | false | none | Is this note pinned? |
isReadOnly | boolean | false | none | Is this note read only or not? |
updatedAt | string(date-time) | false | none | Date and time the note is last updated |
referenceId | string | false | none | Reference ID of the note |
profileResponse
{
"about": "Welcome! We are here to help you 24/7",
"businessProfile": {
"address": "High Street 15, New York",
"description": "YourCompany Ltd.",
"email": "info@your-company.com",
"vertical": "Vertical",
"websites": [
"www.company1.com",
"www.company2.com"
]
},
"name": "YourCompany",
"phoneNumber": 31612345678,
"pictureUrl": "https://pps.whatsapp.net/v/t61.24694-24/s96x96/71527172_751740171986704_2078049712831220364_n.jpg?oe=5E2168E9&oh=174efd2076218dff633a1e748beac190"
}
WhatsApp for Business profile response
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
about | string | false | none | Description of what is this profile about. |
businessProfile | businessProfile | false | none | WhatsApp for Business profile response |
name | string | false | none | Name of the profile |
phoneNumber | integer | false | none | Phone number associated with the WhatsApp for Business profile |
pictureUrl | string | false | none | URL of the picture used in the profile |
qrCodeResponse
{
"code": "VETO8Y3SYCSFH1",
"createdAt": "2020-03-11T19:53:02.000000Z",
"image": "https://scontent.xx.fbcdn.net/...",
"message": "I have a question about product ABC",
"updatedAt": "2020-04-11T19:53:02.000000Z",
"url": "https://wa.me/message/VEKO8Y3SYCSFH1"
}
Single QR code response
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
code | string | false | none | QR code |
createdAt | string(date-time) | false | none | Date and time the note is created |
image | string(uri) | false | none | QR image URL |
message | string | false | none | QR message to be displayed |
updatedAt | string(date-time) | false | none | Date and time the note is last updated |
url | string(uri) | false | none | QR URL |
teamResponse
{
"channels": [
{
"dataRetentionInDays": 90,
"jid": "31611111111@company.com",
"name": "WhatApp",
"priority": 0
}
],
"color": 8,
"jid": "31611111111@company.com",
"metadata": "string",
"name": "Support"
}
Single team response
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
channels | [channelResponse] | false | none | Array of channels |
color | integer | false | none | Color |
jid | string(email) | false | none | ID |
metadata | string | false | none | Metadata information |
name | string | false | none | Name of the team |
webhookResponse
{
"assistant": "john@mycompany.com",
"cipherKey": "string",
"createdAt": "2019-04-04T15:29:47.000000Z",
"enabled": true,
"events": [],
"headers": {},
"id": "8520d8d6-7b28-4d6f-8631-ecd528a0246d",
"updatedAt": "2019-04-07T17:12:00.000000Z",
"url": "https://your.company.com/webhook"
}
Webhook response
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
assistant | string | false | none | Assistant to the agents |
cipherKey | string | false | none | Cipher key to be used in the webhook |
createdAt | string(date-time) | false | none | Date and time the Webhook is created |
enabled | boolean | false | none | Is the Webhook active or not? |
events | [events] | false | none | Array of event on the webhooks |
headers | object | false | none | Header parameters |
id | string | false | none | ID of the event |
updatedAt | string(date-time) | false | none | Date and time that the last message is sent |
url | string | false | none | URL of the webhook |
businessProfile
{
"address": "High Street 15, New York",
"description": "YourCompany Ltd.",
"email": "info@your-company.com",
"vertical": "Vertical",
"websites": [
"www.company1.com",
"www.company2.com"
]
}
WhatsApp for Business profile response
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
address | string | false | none | Address associated with the profile |
description | string | false | none | Description of the profile |
string(email) | false | none | email address associated with the WhatsApp for business profile | |
vertical | string | false | none | Vertical |
websites | [website] | false | none | Website list of URLs |
website
"https://your-company.com"
Website URL
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | string | false | none | Website URL |
quickRepliesResponse
[
{
"category": "Welcome Message",
"createdAt": "2021-07-05T06:20:33.000000Z",
"jids": [
"123152345245@whatsapp.eazy.im"
],
"message": "Hi {{1}}, how can we help you?",
"name": "welcome",
"updatedAt": "2021-07-05T06:28:33.000000Z"
}
]
List of quick replies
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [quickReply] | false | none | List of quick replies |
quickReply
{
"category": "Welcome Message",
"createdAt": "2021-07-05T06:20:33.000000Z",
"jids": [
"123152345245@whatsapp.eazy.im"
],
"message": "Hi {{1}}, how can we help you?",
"name": "welcome",
"updatedAt": "2021-07-05T06:28:33.000000Z"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
category | string | false | none | Custom category |
createdAt | string(date-time) | true | none | Creation date of the quick reply |
jids | [any] | false | none | List of channels the quick reply is assigned to |
message | string | true | none | Message of the quick reply |
name | string | true | none | Name of the quick reply |
updatedAt | string(date-time) | false | none | Last update of the quick reply |
unreadMessagesResponse
{
"unread": 100
}
How many messages are unread for the selected agent
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
unread | integer | true | none | How many messages are unread for the selected agent |
Web Hook Specifications
Web Hook Specifications
Base URLs
production https 78.110.226.11
Server address of tyntec, the events origin from
Received messages
Inbound Message (Basic)
Message received by us and delivered to your system via a webhook provided by your system.
Example payload
{
"from": {
"jid": "string",
"name": "string"
},
"message": {
"body": "string",
"id": "string",
"type": "text"
},
"timestamp": 0,
"to": "string",
"type": "message",
"version": 0
}
Properties
Name | Type | Required | Description |
---|
Name | Type | Required | Description |
---|---|---|---|
anonymous | BasicInboundMessage | false | No description |
» from | From | true | No description |
»» jid | string | false | No description |
»» name | string | false | No description |
» message | TextMessage | true | No description |
»» body | string | false | No description |
»» id | string | false | No description |
»» type | string | false | No description |
» timestamp | integer | true | No description |
» to | string | true | No description |
» type | string | true | No description |
» version | integer | true | No description |
Name | Type | Required | Description |
---|---|---|---|
anonymous | BasicInboundMediaMessage | false | No description |
» media | Media | true | No description |
»» size | integer | false | No description |
»» url | string | false | No description |
» message | object | false | refined per channel |
Enumerated values
Property | Value |
---|---|
type | text |
type | message |
Inbound Message (WhatsApp)
WhatsApp Message received by us and delivered to your system via a webhook provided by your system.
Example payload
{
"from": {
"jid": "123123@whatsapp.eazy.im",
"name": "John"
},
"message": {
"body": "Hi!",
"id": "455ca0457cc2b647d6c33954ab0ec27fbfd38661",
"type": "text"
},
"timestamp": 12313141,
"to": "432324@whatsapp.eazy.im",
"type": "message",
"version": 2
}
Properties
Name | Type | Required | Description |
---|
Name | Type | Required | Description |
---|---|---|---|
anonymous | WhatsAppInboundMessage | false | No description |
» contextInfo | WhatsAppContextInfo | false | No description |
»» quotedMessage | WhatsAppQuotedMessage | false | No description |
»»» id | string | false | No description |
»»» jid | string | false | No description |
» message | any | true | No description |
Name | Type | Required | Description |
---|---|---|---|
»» anonymous | TextMessage | false | No description |
»»» body | string | false | No description |
»»» id | string | false | No description |
»»» type | string | false | No description |
Name | Type | Required | Description |
---|---|---|---|
»» anonymous | ContactMessage | false | No description |
»»» contacts | object | false | No description |
»»» id | string | false | No description |
»»» type | string | false | No description |
Name | Type | Required | Description |
---|---|---|---|
»» anonymous | LocationMessage | false | No description |
»»» id | string | false | No description |
»»» latitude | integer | false | No description |
»»» longitude | integer | false | No description |
»»» name | string | false | No description |
»»» type | string | false | No description |
»»» url | string | false | No description |
Name | Type | Required | Description |
---|---|---|---|
anonymous | WhatsAppInboundMediaMessage | false | No description |
» contextInfo | WhatsAppContextInfo | false | No description |
» message | any | false | No description |
Name | Type | Required | Description |
---|---|---|---|
»» anonymous | AudioMessage | false | No description |
»»» id | string | false | No description |
»»» mimeType | string | false | No description |
»»» type | string | false | No description |
Name | Type | Required | Description |
---|---|---|---|
»» anonymous | DocumentMessage | false | No description |
»»» fileName | string | false | No description |
»»» id | string | false | No description |
»»» mimeType | string | false | No description |
»»» title | string | false | No description |
»»» type | string | false | No description |
Name | Type | Required | Description |
---|---|---|---|
»» anonymous | ImageMessage | false | No description |
»»» caption | string | false | No description |
»»» id | string | false | No description |
»»» mimeType | string | false | No description |
»»» type | string | false | No description |
Name | Type | Required | Description |
---|---|---|---|
»» anonymous | VoiceMessage | false | No description |
»»» id | string | false | No description |
»»» mimeType | string | false | No description |
»»» type | string | false | No description |
Name | Type | Required | Description |
---|---|---|---|
»» anonymous | StickerMessage | false | No description |
»»» id | string | false | No description |
»»» mimeType | string | false | No description |
»»» type | string | false | No description |
Name | Type | Required | Description |
---|---|---|---|
»» anonymous | VideoMessage | false | No description |
»»» id | string | false | No description |
»»» mimeType | string | false | No description |
»»» type | string | false | No description |
Enumerated values
Property | Value |
---|---|
type | text |
type | contact |
type | location |
type | audio |
type | document |
type | image |
type | ptt |
type | sticker |
type | video |
Inbound Message (Messenger)
Messenger Message received by us and delivered to your system via a webhook provided by your system.
Example payload
{
"from": {
"jid": "123123@messenger.eazy.im",
"name": "John"
},
"message": {
"body": "Hi!",
"id": "455ca0457cc2b647d6c33954ab0ec27fbfd38661",
"type": "text"
},
"timestamp": 12313141,
"to": "432324@messenger.eazy.im",
"type": "message",
"version": 2
}
Properties
Name | Type | Required | Description |
---|
Name | Type | Required | Description |
---|---|---|---|
anonymous | MessengerInboundMessage | false | No description |
» message | TextMessage | true | No description |
»» body | string | false | No description |
»» id | string | false | No description |
»» type | string | false | No description |
Name | Type | Required | Description |
---|---|---|---|
anonymous | MessengerInboundMediaMessage | false | No description |
» message | any | false | No description |
Name | Type | Required | Description |
---|---|---|---|
»» anonymous | AudioMessage | false | No description |
»»» id | string | false | No description |
»»» mimeType | string | false | No description |
»»» type | string | false | No description |
Name | Type | Required | Description |
---|---|---|---|
»» anonymous | DocumentMessage | false | No description |
»»» fileName | string | false | No description |
»»» id | string | false | No description |
»»» mimeType | string | false | No description |
»»» title | string | false | No description |
»»» type | string | false | No description |
Name | Type | Required | Description |
---|---|---|---|
»» anonymous | GifMessage | false | No description |
»»» caption | string | false | No description |
»»» id | string | false | No description |
»»» mimeType | string | false | No description |
»»» type | string | false | No description |
Name | Type | Required | Description |
---|---|---|---|
»» anonymous | ImageMessage | false | No description |
»»» caption | string | false | No description |
»»» id | string | false | No description |
»»» mimeType | string | false | No description |
»»» type | string | false | No description |
Name | Type | Required | Description |
---|---|---|---|
»» anonymous | VoiceMessage | false | No description |
»»» id | string | false | No description |
»»» mimeType | string | false | No description |
»»» type | string | false | No description |
Name | Type | Required | Description |
---|---|---|---|
»» anonymous | VideoMessage | false | No description |
»»» id | string | false | No description |
»»» mimeType | string | false | No description |
»»» type | string | false | No description |
Enumerated values
Property | Value |
---|---|
type | text |
type | audio |
type | document |
type | gif |
type | image |
type | ptt |
type | video |
Inbound Message (Twitter)
Twitter Message received by us and delivered to your system via a webhook provided by your system.
Example payload
{
"from": {
"jid": "123123@twitter.eazy.im",
"name": "John"
},
"message": {
"body": "Hi!",
"id": "455ca0457cc2b647d6c33954ab0ec27fbfd38661",
"type": "text"
},
"timestamp": 12313141,
"to": "432324@twitter.eazy.im",
"type": "message",
"version": 2
}
Properties
Name | Type | Required | Description |
---|
Name | Type | Required | Description |
---|---|---|---|
anonymous | TwitterInboundMessage | false | No description |
» message | TextMessage | true | No description |
»» body | string | false | No description |
»» id | string | false | No description |
»» type | string | false | No description |
Name | Type | Required | Description |
---|---|---|---|
anonymous | TwitterInboundMediaMessage | false | No description |
» message | any | false | No description |
Name | Type | Required | Description |
---|---|---|---|
»» anonymous | GifMessage | false | No description |
»»» caption | string | false | No description |
»»» id | string | false | No description |
»»» mimeType | string | false | No description |
»»» type | string | false | No description |
Name | Type | Required | Description |
---|---|---|---|
»» anonymous | ImageMessage | false | No description |
»»» caption | string | false | No description |
»»» id | string | false | No description |
»»» mimeType | string | false | No description |
»»» type | string | false | No description |
Name | Type | Required | Description |
---|---|---|---|
»» anonymous | VideoMessage | false | No description |
»»» id | string | false | No description |
»»» mimeType | string | false | No description |
»»» type | string | false | No description |
Enumerated values
Property | Value |
---|---|
type | text |
type | gif |
type | image |
type | video |
Inbound Message (Viber)
Viber Message received by us and delivered to your system via a webhook provided by your system.
Example payload
{
"from": {
"jid": "123123@viber.eazy.im",
"name": "John"
},
"message": {
"body": "Hi!",
"id": "455ca0457cc2b647d6c33954ab0ec27fbfd38661",
"type": "text"
},
"timestamp": 12313141,
"to": "432324@viber.eazy.im",
"type": "message",
"version": 2
}
Properties
Name | Type | Required | Description |
---|
Name | Type | Required | Description |
---|---|---|---|
anonymous | ViberInboundMessage | false | No description |
» message | any | true | No description |
Name | Type | Required | Description |
---|---|---|---|
»» anonymous | TextMessage | false | No description |
»»» body | string | false | No description |
»»» id | string | false | No description |
»»» type | string | false | No description |
Name | Type | Required | Description |
---|---|---|---|
»» anonymous | LocationMessage | false | No description |
»»» id | string | false | No description |
»»» latitude | integer | false | No description |
»»» longitude | integer | false | No description |
»»» name | string | false | No description |
»»» type | string | false | No description |
»»» url | string | false | No description |
Name | Type | Required | Description |
---|---|---|---|
anonymous | ViberInboundMediaMessage | false | No description |
» message | any | false | No description |
Name | Type | Required | Description |
---|---|---|---|
»» anonymous | DocumentMessage | false | No description |
»»» fileName | string | false | No description |
»»» id | string | false | No description |
»»» mimeType | string | false | No description |
»»» title | string | false | No description |
»»» type | string | false | No description |
Name | Type | Required | Description |
---|---|---|---|
»» anonymous | ImageMessage | false | No description |
»»» caption | string | false | No description |
»»» id | string | false | No description |
»»» mimeType | string | false | No description |
»»» type | string | false | No description |
Name | Type | Required | Description |
---|---|---|---|
»» anonymous | VideoMessage | false | No description |
»»» id | string | false | No description |
»»» mimeType | string | false | No description |
»»» type | string | false | No description |
Enumerated values
Property | Value |
---|---|
type | text |
type | location |
type | document |
type | image |
type | video |
Inbound Message (LiveChat)
LiveChat Message received by us and delivered to your system via a webhook provided by your system.
Example payload
{
"from": {
"jid": "123123@livechat.eazy.im",
"name": "John"
},
"message": {
"body": "Hi!",
"id": "455ca0457cc2b647d6c33954ab0ec27fbfd38661",
"type": "text"
},
"timestamp": 12313141,
"to": "432324@sms.livechat.im",
"type": "message",
"version": 2
}
Properties
Name | Type | Required | Descri |
---|