Introduction
Welcome to the OmniCXM API! You can use our API to access OmniCXM API endpoints, which can get information on many services in our database.
We have language bindings in Shell, PHP, and NodeJs - Axios! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.
This example API documentation page was created with South Telecom. Feel free to edit it and use it as a base for your own API's documentation.
Authentication
Login
curl --location --request GET 'https://omni-api-uat.worldfone.cloud/login' \
--header 'Authorization: Basic YWRtaW46YWRtaW4='
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/login',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => ['Authorization: Basic YWRtaW46YWRtaW4='],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var config = {
method: 'get',
url: 'https://omni-api-uat.worldfone.cloud/login',
headers: {
Authorization: 'Basic YWRtaW46YWRtaW4=',
},
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"token": "8baeb4c3ca6d29fe7b42236f436f74b3-c8cbeaa0-bb57-47ec-a4b6-b7e1d929f8c0",
"userinfo": {
"customer_code": "C0001",
"name": "Worldfone4x Cloud",
"phone": "1900545463",
"email": "[email protected]",
"sex": "male",
"avatar": "https://omnicxm.worldfone.cloud/public/img/crm/default/avatar_default.png",
"language": "vietnamese",
"timezone": "Asia/Bangkok",
"extension": "8001",
"usertype": "owner"
}
}
OmniCXM use "token" to allow access. You can login by username, password to get a new OmniCXM token by this API.
Authorization: Basic base64_encode(username:password)
HTTP Request
GET /login
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
token | String | TOKEN_LOGIN_API - token authentication for APIs |
userinfo | Object | Information of user |
Logout
curl --location --request GET 'https://omni-api-uat.worldfone.cloud/logout' \
--header 'X-API-KEY: TOKEN_LOGIN_API'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/logout',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => ['X-API-KEY: TOKEN_LOGIN_API'],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var config = {
method: 'get',
url: 'https://omni-api-uat.worldfone.cloud/logout',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
},
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true
}
Logout user, destroy token
HTTP Request
GET /logout
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
Permission
Get modules open
curl --location --request GET 'https://omni-api-uat.worldfone.cloud/permission/module' \
--header 'X-API-KEY: TOKEN_LOGIN_API'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/permission/module',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => ['X-API-KEY: TOKEN_LOGIN_API'],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var config = {
method: 'get',
url: 'https://omni-api-uat.worldfone.cloud/permission/module',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
},
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"modules": [
"tickets",
"omnichat",
"reportticketinflowsbytime",
"reportticketinflowsbysourceandtime",
"reportticketinflowsbycategoryandtime",
"reportticketinflowsbyuserandtime",
"reportcdr",
"reportticketinflowsbysourcecategoryandtime"
]
}
Get list modules open
HTTP Request
GET /permission/module
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API or SECRET_KEY |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
modules | Array | List modules key |
Get permission module
curl --location --request GET 'https://omni-api-uat.worldfone.cloud/permission/module/permission/tickets' \
--header 'X-API-KEY: TOKEN_LOGIN_API'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/permission/module/permission/tickets',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => ['X-API-KEY: TOKEN_LOGIN_API'],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var config = {
method: 'get',
url: 'https://omni-api-uat.worldfone.cloud/permission/module/permission/tickets',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
},
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"permission": [
"view",
"create",
"update",
"comment",
"viewfile",
"downloadfile",
"removefile",
"merge",
"delete"
]
}
Get list permission of module
HTTP Request
GET /permission/module/permission/<module>
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API or SECRET_KEY |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
permission | Array | List permission of module |
Check permission module
curl --location --request POST 'https://omni-api-uat.worldfone.cloud/permission/module/permission' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json' \
--data-raw '{
"module": "tickets",
"permission": "view"
}'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/permission/module/permission',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"module": "tickets",
"permission": "view"
}',
CURLOPT_HTTPHEADER => [
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var data = JSON.stringify({
module: 'tickets',
permission: 'view',
})
var config = {
method: 'post',
url: 'https://omni-api-uat.worldfone.cloud/permission/module/permission',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
'Content-Type': 'application/json',
},
data: data,
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"module": "tickets",
"permission": "view",
"response": true
}
Check permission of module
HTTP Request
POST /permission/module/permission
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API or SECRET_KEY |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
module | String | Module input |
permission | String | Permission input |
response | Boolean | Permission of module response |
Check permission special
curl --location --request GET 'https://omni-api-uat.worldfone.cloud/permission/special/click2call' \
--header 'X-API-KEY: TOKEN_LOGIN_API'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/permission/special/click2call',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => ['X-API-KEY: TOKEN_LOGIN_API'],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var config = {
method: 'get',
url: 'https://omni-api-uat.worldfone.cloud/permission/special/click2call',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
},
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true
}
Check permission special of user
HTTP Request
GET /permission/special/<action>
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API or SECRET_KEY |
Query Parameters
Key | Type | Required | Description |
---|---|---|---|
action | String | ✅ | String special permission (sendsms, sendemail, click2call, ...) |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
Users
Get infomation
curl --location --request GET 'https://omni-api-uat.worldfone.cloud/users/getinformation' \
--header 'X-API-KEY: TOKEN_LOGIN_API'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/users/getinformation',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => ['X-API-KEY: TOKEN_LOGIN_API'],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var config = {
method: 'get',
url: 'https://omni-api-uat.worldfone.cloud/users/getinformation',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
},
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"data": {
"id": "60f04042ef7372af76345c2b",
"username": "admin.C0001",
"name": "Worldfone4x Cloud",
"phone": "1900545463",
"email": "[email protected]",
"sex": "male",
"avatar": "https://omnicxm.worldfone.cloud/public/img/crm/default/avatar_default.png",
"language": "vietnamese",
"timezone": "Asia/Bangkok",
"usertype": "owner"
}
}
Get user information through Token
HTTP Request
GET /users/getinformation
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Get user permission
curl --location --request GET 'https://omni-api-uat.worldfone.cloud/users/getuserpermission' \
--header 'X-API-KEY: TOKEN_LOGIN_API'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/users/getuserpermission',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => ['X-API-KEY: TOKEN_LOGIN_API'],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var config = {
method: 'get',
url: 'https://omni-api-uat.worldfone.cloud/users/getuserpermission',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
},
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"data": [
{
"type": "bu",
"name": "BOD",
"value": "bu_61ea514ddc4883646320f24f"
},
{
"type": "bu",
"name": "Sale Department",
"value": "bu_61d45ac06a31026117215716"
},
{
"type": "user",
"username": "admin.C0001",
"name": "Worldfone4x Cloud",
"value": "user_6272238633ef36ebf50126c0"
}
]
}
Get all business unit, users in system
HTTP Request
GET /users/getuserpermission
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API or SECRET_KEY |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
data.\$.type | String | user or bu |
data.\$.name | String | Name of user or bu |
data.\$.value | String | Value of user or bu |
data.\$.username | String | Username of user |
Update password
curl --location --request PUT 'https://omni-api-uat.worldfone.cloud/users/updatepassword' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json' \
--data-raw '{
"oldpassword": "admin",
"newpassword": "000000000",
"confirmpassword" : "000000000"
}'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/users/updatepassword',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS => '{
"oldpassword": "admin",
"newpassword": "000000000",
"confirmpassword" : "000000000"
}',
CURLOPT_HTTPHEADER => [
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var data = JSON.stringify({
oldpassword: 'admin',
newpassword: '000000000',
confirmpassword: '000000000',
})
var config = {
method: 'put',
url: 'https://omni-api-uat.worldfone.cloud/users/updatepassword',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
'Content-Type': 'application/json',
},
data: data,
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": false,
"error": "Password must be at least 8 characters in length and should include at least one upper case letter, one number, and one special character"
}
Update password
HTTP Request
PUT /users/updatepassword
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Request Body
Key | Type | Description |
---|---|---|
oldpassword | String | Current password |
newpassword | String | New password |
confirmpassword | String | Confirm new password |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
Update information
curl --location --request PUT 'https://omni-api-uat.worldfone.cloud/users/updateinformation' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json' \
--data-raw '{
"name" : "4xCloud",
"phone" : "02836222789",
"email" : "[email protected]",
"language" : "vietnamese",
"timezone" : "Asia/Bangkok",
"sex" : "male"
}'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/users/updateinformation',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS => '{
"name" : "4xCloud",
"phone" : "02836222789",
"email" : "[email protected]",
"language" : "vietnamese",
"timezone" : "Asia/Bangkok",
"sex" : "male"
}',
CURLOPT_HTTPHEADER => [
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var data = JSON.stringify({
name: '4xCloud',
phone: '02836222789',
email: '[email protected]',
language: 'vietnamese',
timezone: 'Asia/Bangkok',
sex: 'male',
})
var config = {
method: 'put',
url: 'https://omni-api-uat.worldfone.cloud/users/updateinformation',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
'Content-Type': 'application/json',
},
data: data,
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true
}
Update information user
HTTP Request
PUT /users/updateinformation
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Request Body
Key | Type | Description |
---|---|---|
name | String | Name |
phone | String | Phone number |
String | ||
language | String | vietnamese or english |
timezone | String | Timezone. Ex: Asia/Bangkok |
sex | String | male or female |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
Update avatar
curl --location --request POST 'https://omni-api-uat.worldfone.cloud/users/updateavatar' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--form 'file=@"/path/to/file"'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/users/updateavatar',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => ['file' => new CURLFILE('/path/to/file')],
CURLOPT_HTTPHEADER => ['X-API-KEY: TOKEN_LOGIN_API'],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var FormData = require('form-data')
var fs = require('fs')
var data = new FormData()
data.append('file', fs.createReadStream('/path/to/file'))
var config = {
method: 'post',
url: 'https://omni-api-uat.worldfone.cloud/users/updateavatar',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
...data.getHeaders(),
},
data: data,
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"avatar": "DOMAIN_AVATAR"
}
Update avatar
HTTP Request
POST /users/updateavatar
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Request Body
Key | Type | Description |
---|---|---|
file | String | File image avatar |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
avatar | String | Domain avatar |
Get PBX users
curl --location --request GET 'https://omni-api-uat.worldfone.cloud/users/getuserpbx?pbx_customer_code=C0384' \
--header 'X-API-KEY: SECRET_KEY'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/users/getuserpbx?pbx_customer_code=C0384',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['X-API-KEY: SECRET_KEY'],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var FormData = require('form-data')
var fs = require('fs')
var config = {
method: 'post',
url: 'https://omni-api-uat.worldfone.cloud/users/getuserpbx?pbx_customer_code=C0384',
headers: {
'X-API-KEY': 'SECRET_KEY'
},
data: data,
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"version": "3.1",
"usersGeneral": 316,
"usersOwer": 66,
"users": [
{
"type": "users",
"username": "admin.C0384",
"name": "Admin C0384",
"value": "user_61ed0f472eb3d94a29f6beca"
},
{
"type": "users",
"username": "stpo.hannguyen.C0384",
"name": "Nguyễn Hân",
"value": "user_6205ee9296d68a633b33db41"
},
...
]
}
Update avatar
HTTP Request
POST /users/getuserpbx?pbx_customer_code=C0384
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | SECRET_KEY |
Request Body
Key | Type | Description |
---|---|---|
pbx_customer_code | String | Customer code |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
version | String | version of customer |
usersGeneral | Int | amount of normal users |
usersOwer | Int | amount of owner users |
users | Array | users data |
Fields
Get fields
curl --location --request GET 'https://omni-api-uat.worldfone.cloud/settings/customfields/field' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/settings/customfields/field',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'X-API-KEY: TOKEN_LOGIN_API'
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios');
var data = '';
var config = {
method: 'get',
url: 'https://omni-api-uat.worldfone.cloud/settings/customfields/field',
headers: {
'X-API-KEY: TOKEN_LOGIN_API'
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
The above command returns JSON structured like this:
{
"status": true,
"data": [
{
"name": "Basic information",
"alias": "basicinfo",
"show": 1,
"position": 0,
"positionoverview": 0,
"default": 1,
"module": "tickets",
"coladd": "onecolumn",
"coldetail": "onecolumn",
"id": "62bea0c2976d684cdaed736d",
"field": [
{
"name": "Requester",
"alias": "requester",
"type": "combobox",
"default": 1,
"pageShow": {
"showgrid": 0,
"viewadd": 1,
"overview": 1
},
"property": {
"required": 0,
"unique": 0,
"readonly": 0
},
"tooltip": "",
"note": "",
"show": 1,
"col": 1,
"coldetail": 1,
"poscol1": 0,
"positionadd": 1,
"module": "tickets",
"positionoverview": 0,
"id": "62c3e9eb1a888ce1314ada94"
},
{
"name": "Account",
"alias": "relatedaccount",
"type": "combobox",
"default": 1,
"pageShow": {
"showgrid": 0,
"viewadd": 1,
"overview": 1
},
"property": {
"required": 0,
"unique": 0,
"readonly": 0
},
"tooltip": "",
"note": "",
"show": 1,
"col": 1,
"coldetail": 1,
"poscol1": 1,
"positionadd": 2,
"module": "tickets",
"positionoverview": 4,
"id": "62c3ea361a888ce1314ada95"
},
...
]
}
API get customfield is get fields with more options such as: lang, module , or get with category from API get customfield
HTTP Request
GET /settings/customfields/field
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API or SECRET_KEY |
Request Body
Key | Type | Required | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
module | String | ✅ | Module of customfield (accounts | contacts | leads | tickets ) | |||
lang | String | ⬜️ | vietnamese or english | ||||||
category | String | ⬜️ | Filter category of ticket |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
data | Array | Data of tickets |
Get values link
curl --location --request POST 'https://omni-api-uat.worldfone.cloud/settings/customfields/field/link' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json' \
--data-raw '{
"id" : "6322db807585fd104f370dcb"
}'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/settings/customfields/field/link',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{"id" : "6322db807585fd104f370dcb"}',
CURLOPT_HTTPHEADER => [
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios');
var data = JSON.stringify({"id":"6322db807585fd104f370dcb"});
var config = {
method: 'post',
url: 'https://omni-api-uat.worldfone.cloud/settings/customfields/field/link',
headers: {
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
The above command returns JSON structured like this:
{
"status": true,
"data": {
"typelink": "droptotext", // droptotext or droptodrop
"fieldmain": {
"_id": "6322db35e80741113112acb8",
"name": "dropdown_link_1",
"alias": "dropdown_link_1",
"arrDropDown": ["1", "2", "3"],
"type": "dropdown"
},
"showValue": [
{
"value": "1",
"show": 1
},
{
"value": "2",
"show": 0
},
{
"value": "3",
"show": 1
}
]
}
}
API get link field is get link with option such as: id from API get customfield
HTTP Request
GET /settings/customfields/field/link
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API or SECRET_KEY |
Request Body
Key | Type | Required | Description |
---|---|---|---|
id | String | ✅ | id of field |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
data | Array | Data of tickets |
Get data source
curl --location --request GET 'https://omni-api-uat.worldfone.cloud/settings/customfields/DataSource?id=63199d46e42384d4b409b5d4' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/settings/customfields/DataSource?id=63199d46e42384d4b409b5d4',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var data = ''
var config = {
method: 'get',
url:
'https://omni-api-uat.worldfone.cloud/settings/customfields/DataSource?id=63199d46e42384d4b409b5d4',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
'Content-Type': 'application/json',
},
data: data,
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"data": {
"arrDropDown": ["Value 1", "Value 2"]
}
}
API get customfield is get fields with more options such as: lang, module or get with category from API get customfield
HTTP Request
GET /settings/customfields/DataSource
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Request Body
Key | Type | Required | Description |
---|---|---|---|
id | String | ✅ | get api customfield with index idDropDown ) |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
data | Array | Data of tickets |
CURL sample
curl --location --request POST 'https://omni-api-uat.worldfone.cloud/settings/customfields/field/apisample' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json' \
--data-raw '{
"module": "tickets",
"type": "create",
"required": false
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/settings/customfields/field/apisample',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"module": "tickets",
"type": "create",
"required": false
}'
CURLOPT_HTTPHEADER => array(
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var data = JSON.stringify({
module: 'tickets',
type: 'create',
required: false,
})
var config = {
method: 'post',
url: 'https://omni-api-uat.worldfone.cloud/settings/customfields/field/apisample',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
'Content-Type': 'application/json',
},
data: data,
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns CURL raw
API get sample data field is get data with options such as: module, type or required from API get customfield
HTTP Request
POST /settings/customfields/field/apisample
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Request Body
Key | Type | Required | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
type | String | ✅ | create or update | ||||||
module | String | ✅ | tickets | accounts | contacts | leads | |||
required | String | ⬜️ | get fields required |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
data | Array | Data of tickets |
Relationship
Get Objects
curl --location 'https://omni-api-uat.worldfone.cloud/relationship/objects/<module>?take=10&page=1' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/relationship/objects/<module>?take=10&page=1',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var data = JSON.stringify({
take: 10,
page: 1,
})
var config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://omni-api-uat.worldfone.cloud/relationship/objects/<module>?take=10&page=1',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
'Content-Type': 'application/json',
},
data: data,
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"total": 72024,
"totalPage": 72024,
"data": [
{
"_id": "6407f7610cf579eec70aaf72",
"first_name": "Example Name",
"last_name": "",
"phone": "0342002040",
"email": "",
"companyname": "",
"owner": "user_636dd401642d18c9b500f9b2",
"sdtnharieng": "",
"testaray": [],
"thongtinkhac": {
"salutation": "",
"jobtitle": "",
"gender": [],
"department": "",
"business_phone": "19001000",
"business_email": "",
"rating": "",
"leadstatus": "",
"reason": "",
"leadsource": "",
"product_interest": "",
"annualrevenue": "",
"business_type": "",
"industry": "",
"employees": "",
"vatcode": "",
"conversiondate": [],
"description": "",
"scorenumber": "",
"tags": ""
},
"address": {
"street": "",
"zipcode": "",
"country": "",
"city": "",
"district": "",
"ward": ""
},
"assignto": "user_636dd401642d18c9b500f9b2",
"assign_history": [
"user_6335665f2eaf7a415f05eccc",
"user_636dd401642d18c9b500f9b2"
],
"first_namesearch": "example name",
"created": {
"byid": "6335665f2eaf7a415f05eccc",
"buid": "636ca7a5e73061044303e183",
"time": 1678243681,
"options": []
},
"last_modified": {
"byid": "636dd401642d18c9b500f9b2",
"buid": "636ca7a5e73061044303e183",
"time": 1678417621,
"options": []
},
"mangxahoi": {
"facebook": "",
"twitter": "",
"instagram": "",
"linkedin": "",
"youtube": "",
"skypeid": "",
"website": ""
},
"_collection": "C0001_leads",
"created_username": "admin.C0001",
"last_modified_username": "Admin (admin.C0001)",
"tags_string": "",
"owner_username": "Admin (admin.C0001)"
}
]
}
Get all objects of module (account, contact, lead) with pagination by 2 query parameters (take and page)
HTTP Request
GET relationship/objects/<module>
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Query Parameters
Key | Type | Required | Description |
---|---|---|---|
take | Number | ⬜️ | Number of tickets response (maximum is 100) |
page | Number | ⬜️ | Page response |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | True or Fasle |
msg | String | Message error when API failed |
data | Array | Description of data |
Get Objects By Id
curl --location 'https://omni-api-uat.worldfone.cloud/crm/objects/<id>' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/crm/objects/<id>',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://omni-api-uat.worldfone.cloud/crm/objects/<id>',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
'Content-Type': 'application/json',
},
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"module": "<module>",
"data": {
"_id": "64f0782a5a707517ad4f5ec2",
"testnumber": "",
"business_email": [
""
],
"business_phone": [
""
],
"owner": "user_64531ed5c9adc2e9170036e2",
"companyname": "abc",
"thongtinkhac": {
"fax": [
""
],
"product_interest": "",
"business_type": "",
"account_status": "",
"industry": ""
},
"address": [
{
"country": "",
"city": "",
"zipcode": "",
"district": "",
"street": "",
"ward": ""
}
],
"test123": {
"testmoney": "",
"testphantram": "",
"testso1": "",
"test123": ""
},
"groupfieldother": {
"lydo": "",
"taotracuutest": "",
"tet": ""
},
"fax": [
""
],
"contact": [
"6570b256b7566667f84d8132",
"659cf32445be9d17ce796cf2",
"6886e91061a2f837d052f034"
],
"source": "system",
"businessphonesearch": [
""
],
"companynamesearch": "abc",
"main_business_phone": "",
"main_business_email": "",
"assignto": "user_64531ed5c9adc2e9170036e2",
"assign_history": [
"",
"user_6462f168e95eb3aa3005af63"
],
"created": {
"byid": "63c1126596a2737f135af64f",
"time": 1693481002,
"options": [],
"owner": true
},
"last_modified": {
"byid": "64f7014443dc10df04090fd3",
"time": 1753672305,
"options": [],
"owner": true
},
"assignfrom": "64531ed5c9adc2e9170036e2",
"assign_from_multi": "user_6462f168e95eb3aa3005af63",
"assign_lasttime": 1732091154,
"idrun": "673d9d1024f56d2319002612"
}
}
Get objects by id of module (account, contact, lead)
HTTP Request
GET crm/objects/<id>
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Query Parameters
Key | Type | Required | Description |
---|
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | True or Fasle |
module | String | Module of object |
data | Array | Description of data |
Read Objects
curl --location 'https://omni-api-uat.worldfone.cloud/relationship/objects/read/<module>' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json' \
--data '{
"take" : 10,
"page" : 1,
"filter": {
"logic" : "and",
"filters" : [
{
"field": "last_modified.time",
"operator": "gte",
"value": 1688144400
}
]
},
"sort": [
{
"field": "last_modified.time",
"dir": "desc"
}
]
}'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/relationship/objects/read/<module>',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"take" : 10,
"page" : 1,
"filter": {
"logic" : "and",
"filters" : [
{
"field": "last_modified.time",
"operator": "gte",
"value": 1688144400
}
]
},
"sort": [
{
"field": "last_modified.time",
"dir": "desc"
}
]
}',
CURLOPT_HTTPHEADER => [
'X-API-KEY: aTOKEN_LOGIN_API',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
const axios = require('axios')
let data = JSON.stringify({
take: 10,
page: 1,
filter: {
logic: 'and',
filters: [
{
field: 'last_modified.time',
operator: 'gte',
value: 1688144400,
},
],
},
sort: [
{
field: 'last_modified.time',
dir: 'desc',
},
],
})
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://omni-api-uat.worldfone.cloud/relationship/objects/read/<module>',
headers: {
'X-API-KEY': 'aTOKEN_LOGIN_API',
'Content-Type': 'application/json',
},
data: data,
}
axios
.request(config)
.then((response) => {
console.log(JSON.stringify(response.data))
})
.catch((error) => {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"take": 1,
"page": 1,
"total": 1,
"totalPage": 1,
"data": [
{
"_id": "62973bd89c36f9070147a868",
"gender": "Female",
"first_name": "Test contact",
"last_name": "",
"salutation": "Ms.",
"product_interest": "Devices",
"owner": "user_62e897d1885e7a576003c165",
"address": {
"street": "136/12 Vườn chuối",
"zipcode": "700000",
"country": "Vietnam",
"city": "Thành phố Hồ Chí Minh",
"district": "Quận 3",
"ward": "Phường 4"
},
"account": ["64b13d82a122f33b2671a1b9"],
"phone": ["0389922201"],
"email": ["[email protected]"],
"specialday": ["30/01/1995"],
"mobi_phone": "0389922201",
"main_email": "[email protected]",
"first_namesearch": "test contact",
"assignto": "user_62e897d1885e7a576003c165",
"assign_history": [
"user_62973aae7924987a31016992",
"bu_636ca7a5e73061044303e183"
],
"created": {
"byid": "62973aae7924987a31016992",
"buid": "6215da08aba7b40b19588da6",
"time": 1654078424,
"options": []
},
"last_modified": {
"byid": "64531ed5c9adc2e9170036e2",
"buid": "636ca7a5e73061044303e183",
"time": 1689665127,
"options": []
},
"ticket_requester_id": "62973bdf9e9d8c3b716abf93",
"department": "",
"facebook": "",
"_collection": "C0384_contacts",
"created_username": "CamTu (camtu.C0384)",
"last_modified_username": "CamTu (camtu.C0384)",
"tags_string": "",
"thongtinkhac": {
"tags": ""
},
"owner_username": "Nam Nguyễn (mkt.namnguyen.C0384)"
}
]
}
API read objects is get objects with more options such as: sort, filter from API get view object
HTTP Request
POST /relationship/objects/read/
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Request Body
Key | Type | Required | Description |
---|---|---|---|
take | Number | ⬜️ | Number of objects response (maximum is 100) |
page | Number | ⬜️ | Page response |
sort | Array | ⬜️ | Sort array with multiple objects. Field and dir (desc or asc) |
filter | Object | ⬜️ | Filter object multiple conditions |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
take | Number | Number of objects response |
page | Number | Current page |
totalPages | Number | Total pages |
total | Number | Total objects |
data | Array | Data of objects |
Create object
curl --location 'https://omni-api-uat.worldfone.cloud/relationship/objects/<module>' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json' \
--data '{
"basicinfo" : {
"first_name": "Example Name",
"last_name": "Example Last Name",
"email": "Example Email",
"phone": "0912345678",
"account": "61cab7131d3c606e9c2268d3",
"owner": "user_60f04042ef7372af76345c2b",
"danhxung": "Mr."
},
"thongtinkhac": {
"specialday": 1678357704,
"salutation": "Mr.",
"gender": "Male",
"jobtitle": "Example",
"department": "Example",
"company": "Example",
"workphone": "0912345678",
"product_interest": "VAS Services",
"contactsource": "Call",
"relationshiptype": "Prospect",
"contactstatus": "New",
"idnumber": 123,
"scorenumber": 123,
"description": "Example",
"tags": [
"#tag1",
"tag2"
],
"dongia": 123,
"chuso": 123
},
"address": [
{
"country": "",
"city": "",
"district": "",
"ward": "",
"street": "",
"zipcode": ""
}
],
"mangxahoi": {
"facebook": "Example",
"twitter": "Example",
"instagram": "Example",
"linkedin": "Example",
"youtube": "Example",
"skypeid": "Example",
"website": "Example"
},
"groupfieldother": {
"socmndcccd": "Example",
"hokhauthuongtru": "Example",
"sotaikhoan": "Example",
"nganhangdangky": "Example",
"masothue": "Example",
"tien2": 123
}
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/relationship/objects/<module>',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"basicinfo" : {
"first_name": "Example Name",
"last_name": "Example Last Name",
"email": "Example Email",
"phone": "0912345678",
"account": "61cab7131d3c606e9c2268d3",
"owner": "user_60f04042ef7372af76345c2b",
"danhxung": "Mr."
},
"thongtinkhac": {
"specialday": 1678357704,
"salutation": "Mr.",
"gender": "Male",
"jobtitle": "Example",
"department": "Example",
"company": "Example",
"workphone": "0912345678",
"product_interest": "VAS Services",
"contactsource": "Call",
"relationshiptype": "Prospect",
"contactstatus": "New",
"idnumber": 123,
"scorenumber": 123,
"description": "Example",
"tags": [
"#tag1",
"tag2"
],
"dongia": 123,
"chuso": 123
},
"address": [
{
"country": "",
"city": "",
"district": "",
"ward": "",
"street": "",
"zipcode": ""
}
],
"mangxahoi": {
"facebook": "Example",
"twitter": "Example",
"instagram": "Example",
"linkedin": "Example",
"youtube": "Example",
"skypeid": "Example",
"website": "Example"
},
"groupfieldother": {
"socmndcccd": "Example",
"hokhauthuongtru": "Example",
"sotaikhoan": "Example",
"nganhangdangky": "Example",
"masothue": "Example",
"tien2": 123
}
}',
CURLOPT_HTTPHEADER => array(
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios');
var data = JSON.stringify({
"basicinfo" : {
"first_name": "Example Name",
"last_name": "Example Last Name",
"email": "Example Email",
"phone": "0912345678",
"account": "61cab7131d3c606e9c2268d3",
"owner": "user_60f04042ef7372af76345c2b",
"danhxung": "Mr."
},
"thongtinkhac": {
"specialday": 1678357704,
"salutation": "Mr.",
"gender": "Male",
"jobtitle": "Example",
"department": "Example",
"company": "Example",
"workphone": "0912345678",
"product_interest": "VAS Services",
"contactsource": "Call",
"relationshiptype": "Prospect",
"contactstatus": "New",
"idnumber": 123,
"scorenumber": 123,
"description": "Example",
"tags": [
"#tag1",
"tag2"
],
"dongia": 123,
"chuso": 123
},
"address": [
{
"country": "",
"city": "",
"district": "",
"ward": "",
"street": "",
"zipcode": ""
}
],
"mangxahoi": {
"facebook": "Example",
"twitter": "Example",
"instagram": "Example",
"linkedin": "Example",
"youtube": "Example",
"skypeid": "Example",
"website": "Example"
},
"groupfieldother": {
"socmndcccd": "Example",
"hokhauthuongtru": "Example",
"sotaikhoan": "Example",
"nganhangdangky": "Example",
"masothue": "Example",
"tien2": 123
}
});
var config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://omni-api-uat.worldfone.cloud/relationship/objects/<module>/',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
The above command returns JSON structured like this:
{
"status": true,
"data": "640ae7d78eaa9514ed2ff6d2"
}
Create object
HTTP Request
POST relationship/objects/[module]
module = [accounts,contacts,leads,....]
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Request Body (If has data payload)
Key | Type | Required | Description |
---|
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | True or Fasle |
msg | String | Message error when API failed |
data | Array | Description of data |
curl --location 'https://omni-api-uat.worldfone.cloud/services/omnichat/action/unlinkobject' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json' \
--data '{
"module": "contacts",
"id": "63e32a4f8392da2bf1286576",
"people_id": "63ec3e11bb3174b5cead484e",
"room_id": "63ec3e130073973eb07148cd",
"page_id": "63ad5254a33095790bc44320",
"session_id": "63ec3f4a6dc77e2bea438beb"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/omnichat/action/unlinkobject',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"module": "contacts",
"id": "63e32a4f8392da2bf1286576",
"people_id": "63ec3e11bb3174b5cead484e",
"room_id": "63ec3e130073973eb07148cd",
"page_id": "63ad5254a33095790bc44320",
"session_id": "63ec3f4a6dc77e2bea438beb"
}',
CURLOPT_HTTPHEADER => array(
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios');
var data = JSON.stringify({
"module": "contacts",
"id": "63e32a4f8392da2bf1286576",
"people_id": "63ec3e11bb3174b5cead484e",
"room_id": "63ec3e130073973eb07148cd",
"page_id": "63ad5254a33095790bc44320",
"session_id": "63ec3f4a6dc77e2bea438beb"
});
var config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://omni-api-uat.worldfone.cloud/services/omnichat/action/unlinkobject',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
The above command returns JSON structured like this:
{
"status": true,
"data":[]
}
Unlink object
HTTP Request
POST services/omnichat/action/unlinkobject
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Request Body (If has data payload)
Key | Type | Required | Description |
---|---|---|---|
module | string | ✅ | accounts,contacts,leads |
id | string | ✅ | |
people_id | string | ✅ | |
room_id | string | ✅ | |
page_id | string | ✅ | |
session_id | string | ✅ |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | True or Fasle |
msg | String | Message error when API failed |
data | Array | Description of data |
Update Object
curl --location --request PUT 'https://omni-api-uat.worldfone.cloud/relationship/Objects/contacts/688c86e868ca51681f0353c2' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--form 'basicinfo[firstname]="Example First Name"' \
--form 'basicinfo[last_name]="Example Last Name"' \
--form 'basicinfo[email]="[email protected]"' \
--form 'basicinfo[phone]="09128771718"' \
--form 'basicinfo[owner]="user_60f04042ef7372af76345c2b"' \
--form 'basicinfo[account]="61cab7131d3c606e9c2268d3"' \
--form 'basicinfo[sourcedisplay]="Source Display"' \
--form 'basicinfo[status_basic]="New"' \
--form 'custom_group_field_1[textfield]="TEXT"'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/relationship/Objects/contacts/62fb08237f384bae6d07f022',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS => [
'basicinfo[firstname]' => 'Example First Name',
'basicinfo[last_name]' => 'Example Last Name',
'basicinfo[email]' => '[email protected]',
'basicinfo[phone]' => '09128771718',
'basicinfo[owner]' => 'user_60f04042ef7372af76345c2b',
'basicinfo[account]' => '61cab7131d3c606e9c2268d3',
'basicinfo[sourcedisplay]' => 'Source Display',
'basicinfo[status_basic]' => 'New',
'custom_group_field_1[textfield]' => 'TEXT',
],
CURLOPT_HTTPHEADER => ['X-API-KEY: TOKEN_LOGIN_API'],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var FormData = require('form-data')
var fs = require('fs')
var data = new FormData()
data.append('basicinfo[firstname]', 'Example First Name')
data.append('basicinfo[last_name]', 'Example Last Name')
data.append('basicinfo[email]', '[email protected]')
data.append('basicinfo[phone]', '09128771718')
data.append('basicinfo[owner]', 'user_60f04042ef7372af76345c2b')
data.append('basicinfo[account]', '61cab7131d3c606e9c2268d3')
data.append('basicinfo[sourcedisplay]', 'Source Display')
data.append('basicinfo[status_basic]', 'New')
data.append('custom_group_field_1[textfield]', 'TEXT')
var config = {
method: 'put',
url: 'https://omni-api-uat.worldfone.cloud/relationship/Objects/contacts/62fb08237f384bae6d07f022',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
...data.getHeaders(),
},
data: data,
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"message": "update_success"
}
Update object
HTTP Request
PUT /relationship/Objects/<module>/<id_object>
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API or SECRET_KEY |
Request Body
Key | Type | Description |
---|---|---|
group['fieldname'] | Data of field | basicinfo['content'] |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
Tickets
Get category
curl --location --request GET 'https://omni-api-uat.worldfone.cloud/services/tickets/category' \
--header 'X-API-KEY: TOKEN_LOGIN_API'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/tickets/category',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => ['X-API-KEY: TOKEN_LOGIN_API'],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var config = {
method: 'get',
url: 'https://omni-api-uat.worldfone.cloud/services/tickets/category',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
},
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"data": [
{
"id": "61d69c9abbaac35c221424f2",
"name": "Parent category",
"created": {
"id": "6110df60ef7372af76ce9eb8",
"username": "admin.C0001",
"name": "Worldfone4x Cloud",
"time": 1641454746
},
"last_modified": {
"id": "6110df60ef7372af76ce9eb8",
"username": "admin.C0001",
"name": "Worldfone4x Cloud",
"time": 1647399180
},
"items": [
{
"id": "61d69cb614e27a2d99093845",
"name": "Subcategory 1",
"created": {
"id": "61690935007df19d0e40ca1a",
"username": "admin.C0001",
"name": "Worldfone4x Cloud",
"time": 1641454774
},
"last_modified": {
"id": "61690935007df19d0e40ca1a",
"username": "admin.C0001",
"name": "Worldfone4x Cloud",
"time": 1652692320
}
},
{
"id": "61d69cce7ed97d0c0c6e0f22",
"name": "Subcategory 2",
"created": {
"id": "6110df60ef7372af76ce9eb8",
"username": "admin.C0001",
"name": "Worldfone4x Cloud",
"time": 1641454798
},
"last_modified": {
"id": "6110df60ef7372af76ce9eb8",
"username": "admin.C0001",
"name": "Worldfone4x Cloud",
"time": 1652692330
}
}
]
}
]
}
Get list categories of ticket (tree view 2 class) or get category by id
HTTP Request
GET /services/tickets/category/<id_category>
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API or SECRET_KEY |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
data | Array | Data of category |
Get views ticket
curl --location --request GET 'https://omni-api-uat.worldfone.cloud/services/tickets/view' \
--header 'X-API-KEY: TOKEN_LOGIN_API'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/tickets/view',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => ['X-API-KEY: TOKEN_LOGIN_API'],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var config = {
method: 'get',
url: 'https://omni-api-uat.worldfone.cloud/services/tickets/view',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
},
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"data": [
{
"key": "system_bookmarked",
"name": "",
"type": "system"
},
{
"key": "system_mineticket",
"name": "",
"type": "system"
},
{
"key": "system_ticketstatusnew",
"name": "",
"type": "system"
},
{
"key": "system_ticketstatusend",
"name": "",
"type": "system"
},
{
"key": "system_assigned2me",
"name": "",
"type": "system"
},
{
"key": "6268eb9f1f60ca68e1596a14",
"name": "Get view list ticket processing",
"type": "custom"
},
{
"key": "6268ebb729e2610e5737f6c4",
"name": "List tickets assign my group",
"type": "custom"
},
{
"key": "6268f162146e3a71db799e28",
"name": "List tickets of South Telecom",
"type": "custom"
}
]
}
Get list views ticket defined by user on web portal for filter (serve for API read ticket)
HTTP Request
GET /services/tickets/view
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
data | Array | Data of list view |
data.\$.key | String | Key serve for API read ticket |
Get tickets
curl --location --request GET 'https://omni-api-uat.worldfone.cloud/services/tickets/ticket?take=100&page=1' \
--header 'X-API-KEY: TOKEN_LOGIN_API'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/tickets/ticket?take=100&page=1',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => ['X-API-KEY: TOKEN_LOGIN_API'],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var config = {
method: 'get',
url: 'https://omni-api-uat.worldfone.cloud/services/tickets/ticket?take=100&page=1',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
},
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"take": 10,
"page": 2,
"totalPages": 3,
"total": 22,
"prevPage": "https://omni-api-uat.worldfone.cloud/services/tickets/ticket?take=10&page=1",
"nextPage": "https://omni-api-uat.worldfone.cloud/services/tickets/ticket?take=10&page=3",
"data": [
{
"basicinfo": {
"requester": {
"name": "4xCloud",
"phone": [
"1900545463"
],
"email": [
"[email protected]"
],
"id": "6360ca2d0ed22f4a69068ca4"
},
"relatedaccount": {
"name": "South Telecom JSC",
"phone": "842836222789",
"email": "[email protected]",
"id": "63647dbc41a153ed3207cf02"
},
"priority": "normal",
"category": {
"id": "621f176bb6b1b56daf594632",
"name": "Category API"
},
"parent_category": {
"id": "621f176bb6b1b56daf594632",
"name": "Category"
},
"assignee": {
"id": "6360c1abbdbad519870bd618",
"name": "John Due",
"username": "john.C0001",
"type": "user"
},
"tags": [],
"duedate": "",
"cc": [],
"owner": {
"id": "6360c1abbdbad519870bd618",
"name": "John Due",
"username": "john.C0001",
"type": "user"
},
"ticket_id": "180963647fcb43180",
"id": "63647fcbfc092a21cc0b3dc2",
"status": "New",
"source": "manual",
"sourcedisplay": "manual",
"subject": "Ticket Subject",
"content": "<p>Ticket content</p>",
"attachment": []
},
"custom_group_field_1": {
"textfield": "Text Input",
"textarea": "Text Area",
"checkbox": [
"1",
"2"
],
"phone": "1900545463",
"combobox": "61f811da6a79850f63397d36",
"url": "google.com",
"money": "20",
"percent": "5%"
},
"custom_group_field_2": {
"dropdown_1": "value",
"dropdown_2": "value_1"
},
"custom_group_field_3": {
"datetime": 1667754000
},
"created": {
"id": "6360c1abbdbad519870bd618",
"username": "john.C0001",
"name": "John Due",
"time": 1667530699,
"avatar": ""
},
"last_modified": {
"id": "62a2f2ad491c582650570b72",
"username": "member4xcloud.C0001",
"name": "4xCloud Member",
"time": 1667536093,
"avatar": ""
},
"currentState": false
}
...
]
}
Get all tickets with pagination by 2 query parameters (take and page)
HTTP Request
GET /services/tickets/ticket
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API or SECRET_KEY |
Query Parameters
Key | Type | Required | Description |
---|---|---|---|
take | Number | ⬜️ | Number of tickets response (maximum is 100) |
page | Number | ⬜️ | Page response |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
take | Number | Number of tickets response |
page | Number | Current page |
totalPages | Number | Total pages |
total | Number | Total tickets |
prevPage | String | URL previous page |
nextPage | String | URL next page |
data | Array | Data of tickets |
Get ticket by id
curl --location --request GET 'https://omni-api-uat.worldfone.cloud/services/tickets/ticket/624d56321f6e7326151916f2' \
--header 'X-API-KEY: TOKEN_LOGIN_API'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/tickets/ticket/624d56321f6e7326151916f2',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => ['X-API-KEY: TOKEN_LOGIN_API'],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var config = {
method: 'get',
url: 'https://omni-api-uat.worldfone.cloud/services/tickets/ticket/624d56321f6e7326151916f2',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
},
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"data": {
"basicinfo": {
"requester": {
"name": "4xCloud",
"phone": ["1900545463"],
"email": ["[email protected]"],
"id": "6360ca2d0ed22f4a69068ca4"
},
"relatedaccount": {
"name": "South Telecom JSC",
"phone": "842836222789",
"email": "[email protected]",
"id": "63647dbc41a153ed3207cf02"
},
"priority": "normal",
"category": {
"id": "621f176bb6b1b56daf594632",
"name": "Category API"
},
"parent_category": {
"id": "621f176bb6b1b56daf594632",
"name": "Category"
},
"assignee": {
"id": "6360c1abbdbad519870bd618",
"name": "John Due",
"username": "john.C0001",
"type": "user"
},
"tags": [],
"duedate": "",
"cc": [],
"owner": {
"id": "6360c1abbdbad519870bd618",
"name": "John Due",
"username": "john.C0001",
"type": "user"
},
"ticket_id": "180963647fcb43180",
"id": "63647fcbfc092a21cc0b3dc2",
"status": "New",
"source": "manual",
"sourcedisplay": "manual",
"subject": "Ticket Subject",
"content": "<p>Ticket content</p>",
"attachment": []
},
"custom_group_field_1": {
"textfield": "Text Input",
"textarea": "Text Area",
"checkbox": ["1", "2"],
"phone": "1900545463",
"combobox": "61f811da6a79850f63397d36",
"url": "google.com",
"money": "20",
"percent": "5%"
},
"custom_group_field_2": {
"dropdown_1": "value",
"dropdown_2": "value_1"
},
"custom_group_field_3": {
"datetime": 1667754000
},
"created": {
"id": "6360c1abbdbad519870bd618",
"username": "john.C0001",
"name": "John Due",
"time": 1667530699,
"avatar": ""
},
"last_modified": {
"id": "62a2f2ad491c582650570b72",
"username": "member4xcloud.C0001",
"name": "4xCloud Member",
"time": 1667536093,
"avatar": ""
},
"currentState": false
}
}
Get ticket by id
HTTP Request
GET /services/tickets/ticket/<id_ticket>
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API or SECRET_KEY |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
data | Object | Ticket data |
Read tickets
curl --location --request POST 'https://omni-api-uat.worldfone.cloud/services/tickets/ticket/read' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json' \
--data-raw '{
"take": 15,
"page": 1,
"sort": [
{
"field": "created.time",
"dir": "desc"
}
],
"filter": {
"logic": "and",
"filters": [
{
"field": "last_modified.time",
"operator": "gte",
"value": 1648746000
},
{
"field": "last_modified.time",
"operator": "lte",
"value": 1651337999
}
]
},
"keyview": "6268f162146e3a71db799e28"
}'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/tickets/ticket/read',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"take": 15,
"page": 1,
"sort": [
{
"field": "created.time",
"dir": "desc"
}
],
"filter": {
"logic": "and",
"filters": [
{
"field": "last_modified.time",
"operator": "gte",
"value": 1648746000
},
{
"field": "last_modified.time",
"operator": "lte",
"value": 1651337999
}
]
},
"keyview": "6268f162146e3a71db799e28"
}',
CURLOPT_HTTPHEADER => [
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var data = JSON.stringify({
take: 15,
page: 1,
sort: [
{
field: 'created.time',
dir: 'desc',
},
],
filter: {
logic: 'and',
filters: [
{
field: 'last_modified.time',
operator: 'gte',
value: 1648746000,
},
{
field: 'last_modified.time',
operator: 'lte',
value: 1651337999,
},
],
},
keyview: '6268f162146e3a71db799e28',
})
var config = {
method: 'post',
url: 'https://omni-api-uat.worldfone.cloud/services/tickets/ticket/read',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
'Content-Type': 'application/json',
},
data: data,
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"take": 15,
"page": 1,
"totalPages": 1,
"total": 1,
"data": [
{
"basicinfo": {
"requester": {
"name": "4xCloud",
"phone": ["1900545463"],
"email": ["[email protected]"],
"id": "6360ca2d0ed22f4a69068ca4"
},
"relatedaccount": {
"name": "South Telecom JSC",
"phone": "842836222789",
"email": "[email protected]",
"id": "63647dbc41a153ed3207cf02"
},
"priority": "normal",
"category": {
"id": "621f176bb6b1b56daf594632",
"name": "Category API"
},
"parent_category": {
"id": "621f176bb6b1b56daf594632",
"name": "Category"
},
"assignee": {
"id": "6360c1abbdbad519870bd618",
"name": "John Due",
"username": "john.C0001",
"type": "user"
},
"tags": [],
"duedate": "",
"cc": [],
"owner": {
"id": "6360c1abbdbad519870bd618",
"name": "John Due",
"username": "john.C0001",
"type": "user"
},
"ticket_id": "180963647fcb43180",
"id": "63647fcbfc092a21cc0b3dc2",
"status": "New",
"source": "manual",
"sourcedisplay": "manual",
"subject": "Ticket Subject",
"content": "<p>Ticket content</p>",
"attachment": []
},
"custom_group_field_1": {
"textfield": "Text Input",
"textarea": "Text Area",
"checkbox": ["1", "2"],
"phone": "1900545463",
"combobox": "61f811da6a79850f63397d36",
"url": "google.com",
"money": "20",
"percent": "5%"
},
"custom_group_field_2": {
"dropdown_1": "value",
"dropdown_2": "value_1"
},
"custom_group_field_3": {
"datetime": 1667754000
},
"created": {
"id": "6360c1abbdbad519870bd618",
"username": "john.C0001",
"name": "John Due",
"time": 1667530699,
"avatar": ""
},
"last_modified": {
"id": "62a2f2ad491c582650570b72",
"username": "member4xcloud.C0001",
"name": "4xCloud Member",
"time": 1667536093,
"avatar": ""
},
"currentState": false
}
]
}
API read tickets is get tickets with more options such as: sort, filter or get with keyview from API get view ticket
HTTP Request
POST /services/tickets/ticket/read
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Request Body
Key | Type | Required | Description |
---|---|---|---|
take | Number | ⬜️ | Number of tickets response (maximum is 100) |
page | Number | ⬜️ | Page response |
sort | Array | ⬜️ | Sort array with multiple objects. Field and dir (desc or asc) |
filter | Object | ⬜️ | Filter object multiple conditions |
keyview | String | ⬜️ | Key from API get views ticket |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
take | Number | Number of tickets response |
page | Number | Current page |
totalPages | Number | Total pages |
total | Number | Total tickets |
prevPage | String | URL previous page |
nextPage | String | URL next page |
data | Array | Data of tickets |
Create ticket
curl --location --request POST 'https://omni-api-uat.worldfone.cloudservices/tickets/ticket' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--form 'basicinfo[requester]="62a9b3faa129f66b4b3fbae4"' \
--form 'basicinfo[account_related]="62c4f9fc812b99e9960d1aca"' \
--form 'basicinfo[subject]="Subject Ticket"' \
--form 'basicinfo[content]="Content"' \
--form 'basicinfo[category]="621f176bb6b1b56daf594632"' \
--form 'basicinfo[assignee]="user_627b6be2494061156f798eb4"' \
--form 'basicinfo[sourcedisplay]="call"' \
--form 'basicinfo[priority]="normal"' \
--form 'basicinfo[ccs][]="bu_61ea514ddc4883646320f24f"' \
--form 'basicinfo[ccs][]="user_627b6a7ecc82dc1c2104a7c2"' \
--form 'basicinfo[duedate]="1667157924"' \
--form 'basicinfo[tags][]="#tag1"' \
--form 'basicinfo[tags][]="tag2"' \
--form 'basicinfo[files][]=@"/path/to/file"' \
--form 'custom_group_field_1[textfield]="TEXT"'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/tickets/ticket',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => [
'basicinfo[requester]' => '62a9b3faa129f66b4b3fbae4',
'basicinfo[account_related]' => '62c4f9fc812b99e9960d1aca',
'basicinfo[subject]' => 'Subject Ticket',
'basicinfo[content]' => 'Content',
'basicinfo[category]' => '621f176bb6b1b56daf594632',
'basicinfo[assignee]' => 'user_627b6be2494061156f798eb4',
'basicinfo[sourcedisplay]' => 'call',
'basicinfo[priority]' => 'normal',
'basicinfo[ccs][]' => 'bu_61ea514ddc4883646320f24f',
'basicinfo[ccs][]' => 'user_627b6a7ecc82dc1c2104a7c2',
'basicinfo[duedate]' => '1667157924',
'basicinfo[tags][]' => '#tag1',
'basicinfo[tags][]' => 'tag2',
'basicinfo[files][]' => new CURLFILE('/path/to/file'),
'custom_group_field_1[textfield]' => 'TEXT',
],
CURLOPT_HTTPHEADER => ['X-API-KEY: TOKEN_LOGIN_API'],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var FormData = require('form-data')
var fs = require('fs')
var data = new FormData()
data.append('basicinfo[requester]', '617a0db45cfb5c149b279fa6')
data.append('basicinfo[account_related]', '61cab7131d3c606e9c2268d3')
data.append('basicinfo[subject]', 'Subject Ticket')
data.append('basicinfo[content]', 'Content')
data.append('basicinfo[category]', '621f176bb6b1b56daf594632')
data.append('basicinfo[assignee]', 'user_627b6be2494061156f798eb4')
data.append('basicinfo[sourcedisplay]', 'call')
data.append('basicinfo[priority]', 'normal')
data.append('basicinfo[ccs][]', 'bu_61ea514ddc4883646320f24f')
data.append('basicinfo[ccs][]', 'user_627b6a7ecc82dc1c2104a7c2')
data.append('basicinfo[duedate]', '1667157924')
data.append('basicinfo[tags][]', '#tag1')
data.append('basicinfo[tags][]', 'tag2')
data.append('basicinfo[files][]', fs.createReadStream('/path/to/file'))
data.append('custom_group_field_1[textfield]', 'TEXT')
var config = {
method: 'post',
url: 'https://omni-api-uat.worldfone.cloud/services/tickets/ticket',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
...data.getHeaders(),
},
data: data,
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"id": "62fa21088b11cb67fa14266a"
}
Create ticket
HTTP Request
POST /services/tickets/ticket
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API or SECRET_KEY |
Request Body
Key | Type | Description |
---|---|---|
group['fieldname'] | Data of field | basicinfo['content'] |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
id | String | ID of ticket |
Update ticket
curl --location --request PUT 'https://omni-api-uat.worldfone.cloud/services/tickets/ticket/62fb08237f384bae6d07f022' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--form 'basicinfo[requester]="62a9b3faa129f66b4b3fbae4"' \
--form 'basicinfo[account_related]="62c4f9fc812b99e9960d1aca"' \
--form 'basicinfo[subject]="Change Subject Ticket"' \
--form 'basicinfo[content]="Change Content"' \
--form 'basicinfo[category]="621f176bb6b1b56daf594632"' \
--form 'basicinfo[assignee]="user_627b6be2494061156f798eb4"' \
--form 'basicinfo[sourcedisplay]="call"' \
--form 'basicinfo[priority]="high"' \
--form 'basicinfo[ccs][]="bu_61ea514ddc4883646320f24f"' \
--form 'basicinfo[ccs][]="user_627b6a7ecc82dc1c2104a7c2"' \
--form 'basicinfo[duedate]="1667157924"' \
--form 'basicinfo[tags][]="#tag1"' \
--form 'basicinfo[tags][]="tag2"' \
--form 'basicinfo[deletefileindex]="0, 1"' \
--form 'basicinfo[files][]=@"/path/to/file"' \
--form 'custom_group_field_1[textfield]="TEXT"'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/tickets/ticket/62fb08237f384bae6d07f022',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS => [
'basicinfo[requester]' => '62a9b3faa129f66b4b3fbae4',
'basicinfo[account_related]' => '62c4f9fc812b99e9960d1aca',
'basicinfo[subject]' => 'Change Subject Ticket',
'basicinfo[content]' => 'Change Content',
'basicinfo[category]' => '621f176bb6b1b56daf594632',
'basicinfo[assignee]' => 'user_627b6be2494061156f798eb4',
'basicinfo[sourcedisplay]' => 'call',
'basicinfo[priority]' => 'normal',
'basicinfo[ccs][]' => 'bu_61ea514ddc4883646320f24f',
'basicinfo[ccs][]' => 'user_627b6a7ecc82dc1c2104a7c2',
'basicinfo[duedate]' => '1667157924',
'basicinfo[tags][]' => '#tag1',
'basicinfo[tags][]' => 'tag2',
'basicinfo[deletefileindex]' => '0, 1',
'basicinfo[files][]' => new CURLFILE('/path/to/file'),
'custom_group_field_1[textfield]' => 'TEXT',
],
CURLOPT_HTTPHEADER => ['X-API-KEY: TOKEN_LOGIN_API'],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var FormData = require('form-data')
var fs = require('fs')
var data = new FormData()
data.append('basicinfo[requester]', '617a0db45cfb5c149b279fa6')
data.append('basicinfo[account_related]', '61cab7131d3c606e9c2268d3')
data.append('basicinfo[subject]', 'Subject Ticket')
data.append('basicinfo[content]', 'Content')
data.append('basicinfo[category]', '621f176bb6b1b56daf594632')
data.append('basicinfo[assignee]', 'user_627b6be2494061156f798eb4')
data.append('basicinfo[sourcedisplay]', 'call')
data.append('basicinfo[priority]', 'normal')
data.append('basicinfo[ccs][]', 'bu_61ea514ddc4883646320f24f')
data.append('basicinfo[ccs][]', 'user_627b6a7ecc82dc1c2104a7c2')
data.append('basicinfo[duedate]', '1667157924')
data.append('basicinfo[tags][]', '#tag1')
data.append('basicinfo[tags][]', 'tag2')
data.append('basicinfo[deletefileindex]', '0, 1')
data.append('basicinfo[files][]', fs.createReadStream('/path/to/file'))
data.append('custom_group_field_1[textfield]', 'TEXT')
var config = {
method: 'put',
url: 'https://omni-api-uat.worldfone.cloud/services/tickets/ticket/62fb08237f384bae6d07f022',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
...data.getHeaders(),
},
data: data,
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true
}
Update ticket
HTTP Request
PUT /services/tickets/ticket/<id_ticket>
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API or SECRET_KEY |
Request Body
Key | Type | Description |
---|---|---|
group['fieldname'] | Data of field | basicinfo['content'] |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
Get log
curl --location --request GET 'https://omni-api-uat.worldfone.cloud/services/tickets/log/62cd3c8f6d95a586080e5342' \
--header 'X-API-KEY: TOKEN_LOGIN_API'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/tickets/log/62cd3c8f6d95a586080e5342',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => ['X-API-KEY: TOKEN_LOGIN_API'],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var config = {
method: 'get',
url: 'https://omni-api-uat.worldfone.cloud/services/tickets/log/62cd3c8f6d95a586080e5342',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
},
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"take": 10,
"page": 1,
"totalPages": 5,
"total": 45,
"nextPage": "https://omni-api-uat.worldfone.cloud/services/tickets/log?take=10&page=2",
"data": [
{
"_id": "62f9ac67ac43cc7b9f4f19e2",
"ticket_id": "62cd3c8f6d95a586080e5342",
"comment_id": "62f690d5b378194b095210ff",
"type": "deletecommentnote",
"comment": {
"_id": "62f690d5b378194b095210ff",
"ticket_id": "62cd3c8f6d95a586080e5342",
"content": "<p>Content sub</p>\n",
"type": "note",
"notetype": "public",
"replycomments": 0,
"tagusers": [],
"raw_content": "Content sub\n",
"raw_content4search": "content sub",
"upload_data": [
{
"nameReal": "ggext.txt",
"nameCDN": "ggext.txt",
"extension": "txt",
"filesize": 1000
},
{
"nameReal": "note_plan.txt",
"nameCDN": "note-plan.txt",
"extension": "txt",
"filesize": 1000
}
],
"created": {
"byid": "60f04042ef7372af76345c2b",
"time": 1660326101,
"options": [],
"owner": true
},
"last_modified": {
"byid": "60f04042ef7372af76345c2b",
"time": 1660326101,
"options": [],
"owner": true
}
},
"created": {
"byid": "60f04042ef7372af76345c2b",
"time": 1660529767,
"username": "admin.C0001",
"name": "Worldfone4x Cloud"
}
},
...
]
}
Get log of ticket
HTTP Request
GET /services/tickets/log/<id_ticket>
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API or SECRET_KEY |
Query Parameters
Key | Type | Description |
---|---|---|
take | Number | Number of tickets response |
page | Number | Current page |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
take | Number | Number of tickets response |
page | Number | Current page |
totalPages | Number | Total pages |
total | Number | Total tickets |
prevPage | String | URL previous page |
nextPage | String | URL next page |
data | Array | Data of tickets |
Get list requesters
curl --location --request GET 'https://omni-api-uat.worldfone.cloud/services/tickets/requester/getlist' \
--header 'X-API-KEY: TOKEN_LOGIN_API'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/tickets/requester/getlist',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => ['X-API-KEY: TOKEN_LOGIN_API'],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var config = {
method: 'get',
url: 'https://omni-api-uat.worldfone.cloud/services/tickets/requester/getlist',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
},
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"data": [
{
"id": "6168e47bbae4e771a01c5b93",
"name": "South Telecom Contact",
"phone": "0909111222",
"email": "[email protected]",
"frommodule": "contacts",
"idmodule": "6166a96f2af0cd327c2aaa26",
"tickets": 0,
"created": {
"byid": "60f04042ef7372af76345c2b",
"time": 1634264187
},
"namecustom": "South Telecom Contact - 0909111222 - [email protected]"
},
{
"id": "61bab7f2da176b497a6d7c2d",
"name": "Requester",
"phone": "0388811122",
"email": "",
"frommodule": "contacts",
"idmodule": "61a89e93ef20445608402680",
"tickets": 0,
"created": {
"byid": "61690935007df19d0e40ca1a",
"time": 1639626738,
"options": [],
"owner": true
},
"namecustom": "Requester - 0388811122"
}
]
}
Get list requesters, who request tickets before
HTTP Request
GET /services/tickets/requester/getlist
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API or SECRET_KEY |
Query Parameters
Key | Type | Description |
---|---|---|
value | String | Find contains name, phone, email |
idrequester | String | Find by id requester |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
data | Array | Data of requesters |
Search requesters
curl --location -g --request GET 'https://omni-api-uat.worldfone.cloud/services/tickets/requester/search?modules[]=contacts&modules[]=leads&phone=083&email&take=20&page=1&modules[]=users' \
--header 'X-API-KEY: TOKEN_LOGIN_API'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/tickets/requester/search?modules[]=contacts&modules[]=leads&phone=083&email&take=20&page=1&modules[]=users',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => ['X-API-KEY: TOKEN_LOGIN_API'],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var config = {
method: 'get',
url:
'https://omni-api-uat.worldfone.cloud/services/tickets/requester/search?modules[]=contacts&modules[]=leads&phone=083&email&take=20&page=1&modules[]=users',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
},
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"take": 5,
"page": 1,
"totalPages": 3,
"total": 14,
"data": [
{
"module": "contacts",
"name": "Contact 1",
"phone": "0909111222",
"email": "",
"id": "621b9368b798e1568b6f3ee6"
},
{
"module": "leads",
"name": "Miss Nhu",
"phone": "0981222111",
"email": "[email protected]",
"id": "62133742c234ac41e9169ea6"
},
{
"ticket_requester_id": "621bc274523dc71855390936",
"module": "contacts",
"name": "Mr Tam",
"phone": "0837305730",
"email": "",
"id": "621bc274523dc71855390934"
}
]
}
API will response list data from Contacts, Leads, Users
After response, use API convert requester to convert data (Contacts, Leads, Users) to Requester Ticket
HTTP Request
GET /services/tickets/requester/search
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API or SECRET_KEY |
Query Parameters
Key | Type | Description |
---|---|---|
modules | Array | contacts, leads, users |
name | String | Find name contains |
phone | String | Find phone contains |
String | Find email contains | |
take | Number | Number of tickets response (maximum is 100) |
page | Number | Page response |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
take | Number | Number of tickets response |
page | Number | Current page |
totalPages | Number | Total pages |
total | Number | Total tickets |
prevPage | String | URL previous page |
nextPage | String | URL next page |
data | Array | Data of tickets |
Convert requester
curl --location --request POST 'https://omni-api-uat.worldfone.cloud/services/tickets/requester/convert' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json' \
--data-raw '{
"module":"contacts",
"id":"621c126a19284e75485f9d42"
}'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/tickets/requester/convert',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"module":"contacts",
"id":"621c126a19284e75485f9d42"
}',
CURLOPT_HTTPHEADER => [
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var data = JSON.stringify({
module: 'contacts',
id: '621c126a19284e75485f9d42',
})
var config = {
method: 'post',
url: 'https://omni-api-uat.worldfone.cloud/services/tickets/requester/convert',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
'Content-Type': 'application/json',
},
data: data,
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"data": {
"name": "Leads 1",
"phone": "0987666555",
"email": "",
"frommodule": "leads",
"idmodule": "621c126a19284e75485f9d42",
"id": "624179ef4d50fb454c77dcb4"
}
}
API will response a requester convert from contacts, leads, users.
You can get id of requester
HTTP Request
POST /services/tickets/requester/convert
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API or SECRET_KEY |
Request Body
Key | Type | Description |
---|---|---|
module | String | contacts, leads, users |
id | String | Id of data (contacts, leads, users) |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
data | Object | Data of requester |
Add requester by module
curl --location --request POST 'https://omni-api-uat.worldfone.cloud/services/tickets/requester/addbymodule' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json' \
--data-raw '{
"name" : "Name add requester",
"type" : "contacts"
}'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/tickets/requester/addbymodule',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"name" : "Name add requester",
"type" : "contacts"
}',
CURLOPT_HTTPHEADER => [
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var data = JSON.stringify({
name: 'Name add requester',
type: 'contacts',
})
var config = {
method: 'post',
url: 'https://omni-api-uat.worldfone.cloud/services/tickets/requester/addbymodule',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
'Content-Type': 'application/json',
},
data: data,
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"data": {
"name": "Name add requester",
"phone": "",
"email": "",
"tickets": 0,
"created": {
"byid": "61690935007df19d0e40ca1a",
"time": 1651139193,
"options": [],
"owner": true
},
"last_modified": {
"byid": "61690935007df19d0e40ca1a",
"time": 1651139193,
"options": [],
"owner": true
},
"id": "626a6279293e98776c328fea",
"type": "contacts"
}
}
Add requester by module
HTTP Request
POST /services/tickets/requester/addbymodule
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API or SECRET_KEY |
Request Body
Key | Type | Description |
---|---|---|
name | String | Name of requester |
type | String | contacts or leads |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
data | Object | Data of requester |
Get actions
curl --location --request GET 'https://omni-api-uat.worldfone.cloud/services/tickets/action/62cd3c8f6d95a586080e5342' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/tickets/action/62cd3c8f6d95a586080e5342',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var config = {
method: 'get',
url: 'https://omni-api-uat.worldfone.cloud/services/tickets/action/62cd3c8f6d95a586080e5342',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
'Content-Type': 'application/json',
},
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"data": [
{
"name": "In Progress",
"token": "DefaultFlow_InProgress",
"extendConfig": {
"status": "In Progress",
"typeColor": "default",
"backgroundColor": "#f7be64",
"textColor": "#ffffff"
},
"stepactiontoken": "ce0580eb6850229f2fa2525e85b95da4"
},
{
"name": "Cancel",
"token": "DefaultFlow_Cancel",
"extendConfig": {
"status": "Cancel",
"typeColor": "default",
"backgroundColor": "#ef8a80",
"textColor": "#ffffff"
},
"stepactiontoken": "ce0580eb6850229f2fa2525e85b95da4"
}
]
}
API response list current actions in state of ticket BPM
HTTP Request
GET /services/tickets/action/<id_ticket>
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API or SECRET_KEY |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
data | Array | Data of actions |
Doing action
curl --location --request POST 'https://omni-api-uat.worldfone.cloud/services/tickets/action/doing/62cd3c8f6d95a586080e5342' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--form 'token="DefaultFlow_InProgress"' \
--form 'stepactiontoken="aedc3cdd517d1e797f2bf0d0984e0f53"' \
--form 'comment_content="Comment when action In Progress"' \
--form 'comment_type="public"' \
--form 'assignee="bu_61d45ac06a31026117215716"' \
--form 'files[]=@"/path/to/file"'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/tickets/action/doing/62cd3c8f6d95a586080e5342',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => [
'token' => 'DefaultFlow_InProgress',
'stepactiontoken' => 'aedc3cdd517d1e797f2bf0d0984e0f53',
'comment_content' => 'Comment when action In Progress',
'comment_type' => 'public',
'assignee' => 'bu_61d45ac06a31026117215716',
'files[]' => new CURLFILE('/path/to/file'),
],
CURLOPT_HTTPHEADER => ['X-API-KEY: TOKEN_LOGIN_API'],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var FormData = require('form-data')
var fs = require('fs')
var data = new FormData()
data.append('token', 'DefaultFlow_InProgress')
data.append('stepactiontoken', 'aedc3cdd517d1e797f2bf0d0984e0f53')
data.append('comment_content', 'Comment when action In Progress')
data.append('comment_type', 'public')
data.append('assignee', 'bu_61d45ac06a31026117215716')
data.append('files[]', fs.createReadStream('/path/to/file'))
var config = {
method: 'post',
url:
'https://omni-api-uat.worldfone.cloud/services/tickets/action/doing/62cd3c8f6d95a586080e5342',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
...data.getHeaders(),
},
data: data,
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"data": {
"comment": {
"ticket_id": "62cd3c8f6d95a586080e5342",
"content": "<p>Comment when action In Progress</p>\n",
"type": "note",
"notetype": "public",
"replycomments": 0,
"last_modified": {
"byid": "60f04042ef7372af76345c2b",
"time": 1660301664,
"options": [],
"owner": true
},
"created": {
"byid": "60f04042ef7372af76345c2b",
"time": 1660301664,
"options": [],
"owner": true,
"avatar": "DOMAIN_AVATAR"
},
"timetext": "justnow. Friday, 12 August 05:54 PM",
"id": "62f63160df5ad7060e7d1b02",
"usersubmit_info": {
"username": "admin.C0001",
"owner": true,
"extension": "8001",
"email": "",
"name": "Worldfone4x Cloud",
"phone": "",
"last_modified": {
"byid": "60f04042ef7372af76345c2b",
"time": 1649231706,
"options": [],
"owner": true
},
"ticket_requester_id": "621d9820f5cd5c6b9c06ac86",
"ticket_submitter_id": "626b9dda8b56a14a8671b895"
}
},
"usersubmit_info": {
"username": "admin.C0001",
"owner": true,
"extension": "8001",
"email": "",
"name": "Worldfone4x Cloud",
"phone": "",
"last_modified": {
"byid": "60f04042ef7372af76345c2b",
"time": 1649231706,
"options": [],
"owner": true
},
"ticket_requester_id": "621d9820f5cd5c6b9c06ac86",
"ticket_submitter_id": "626b9dda8b56a14a8671b895"
}
}
}
Action ticket state BPM by token
HTTP Request
POST /services/tickets/action/<id_ticket>
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Request Body
Key | Type | Description |
---|---|---|
token | String | Token of action |
stepactiontoken | String | State token of action |
comment_content | String | Content of comment on action |
comment_type | String | Type of comment: public or private |
assignee | String | Value of API get user permission |
files[] | File | Files on comment |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
data | Object | Comment, User submit |
Get comments
curl --location --request GET 'https://omni-api-uat.worldfone.cloud/services/tickets/comment/62cd3c8f6d95a586080e5342?take=10&page=1' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/tickets/comment/62cd3c8f6d95a586080e5342?take=10&page=1',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var config = {
method: 'get',
url:
'https://omni-api-uat.worldfone.cloud/services/tickets/comment/62cd3c8f6d95a586080e5342?take=10&page=1',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
'Content-Type': 'application/json',
},
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"take": 10,
"page": 1,
"totalPages": 2,
"total": 11,
"nextPage": "https://omni-api-uat.worldfone.cloud/services/tickets/comment/62cd3c8f6d95a586080e5342?take=10&page=2",
"data": [
{
"ticket_id": "62cd3c8f6d95a586080e5342",
"content": "<p>Content sub</p>\n",
"type": "note",
"notetype": "public",
"replycomments": 0,
"created": {
"byid": "60f04042ef7372af76345c2b",
"time": 1660318132,
"options": [],
"owner": true,
"avatar": "DOMAIN_AVATAR"
},
"last_modified": {
"byid": "60f04042ef7372af76345c2b",
"time": 1660318132,
"options": [],
"owner": true
},
"timetext": "4 minutes ago. Friday, 12 August 10:28 PM",
"usersubmit_info": {
"username": "admin.C0001",
"owner": true,
"extension": "8001",
"email": "",
"name": "Worldfone4x Cloud",
"phone": "",
"last_modified": {
"byid": "60f04042ef7372af76345c2b",
"time": 1649231706,
"options": [],
"owner": true
},
"ticket_requester_id": "621d9820f5cd5c6b9c06ac86",
"ticket_submitter_id": "626b9dda8b56a14a8671b895",
"status": true
},
"id": "62f671b426adab555568a389"
},
...
]
}
Get list comments of ticket id with pagination
HTTP Request
GET /services/tickets/comment/<id_ticket>
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API or SECRET_KEY |
Query Parameters
Key | Type | Description |
---|---|---|
take | Number | Number of tickets response (maximum is 100) |
page | Number | Page response |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
take | Number | Number of tickets response |
page | Number | Current page |
totalPages | Number | Total pages |
total | Number | Total tickets |
prevPage | String | URL previous page |
nextPage | String | URL next page |
data | Array | Data of tickets |
Create comment
curl --location --request POST 'https://omni-api-uat.worldfone.cloud/services/tickets/comment/62cd3c8f6d95a586080e5342' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json' \
--form 'content="Content"' \
--form 'notetype="private"' \
--form 'files[]=@"/path/to/file"'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/tickets/comment/62cd3c8f6d95a586080e5342',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => [
'content' => 'Content',
'notetype' => 'private',
'files[]' => new CURLFILE('/path/to/file'),
],
CURLOPT_HTTPHEADER => [
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var FormData = require('form-data')
var fs = require('fs')
var data = new FormData()
data.append('content', 'Content')
data.append('notetype', 'private')
data.append('files[]', fs.createReadStream('/path/to/file'))
var config = {
method: 'post',
url: 'https://omni-api-uat.worldfone.cloud/services/tickets/comment/62cd3c8f6d95a586080e5342',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
'Content-Type': 'application/json',
...data.getHeaders(),
},
data: data,
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"data": {
"ticket_id": "62cd3c8f6d95a586080e5342",
"content": "<p>Content</p>\n",
"type": "note",
"notetype": "private",
"replycomments": 0,
"tagusers": [],
"raw_content": "Content\n",
"last_modified": {
"byid": "60f04042ef7372af76345c2b",
"time": 1660318132,
"options": [],
"owner": true
},
"created": {
"byid": "60f04042ef7372af76345c2b",
"time": 1660318132,
"options": [],
"owner": true,
"avatar": "DOMAIN_AVATAR"
},
"timetext": "justnow. Friday, 12 August 10:28 PM",
"ccs_updated": [],
"id": "62f671b426adab555568a389",
"usersubmit_info": {
"username": "admin.C0001",
"owner": true,
"extension": "8001",
"email": "",
"name": "Worldfone4x Cloud",
"phone": "",
"last_modified": {
"byid": "60f04042ef7372af76345c2b",
"time": 1649231706,
"options": [],
"owner": true
},
"ticket_requester_id": "621d9820f5cd5c6b9c06ac86",
"ticket_submitter_id": "626b9dda8b56a14a8671b895"
}
}
}
Create comment of ticket
HTTP Request
POST /services/tickets/comment/<id_ticket>
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Request Body
Key | Type | Description |
---|---|---|
notetype | String | Type of comment: public or private |
content | String | Content of comment |
parentcomment | String | ID of parent comment |
files[] | File | Files on comment |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
data | Object | Data of comment |
Update comment
curl --location --request PUT 'https://omni-api-uat.worldfone.cloud/services/tickets/comment/62cd3c8f6d95a586080e5342' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--form 'content="Content update"' \
--form 'notetype="public"' \
--form 'idcomment="62f69192e2a80f35bd5a9b90"' \
--form 'deletefileindex="0,1"' \
--form 'files[]=@"/path/to/file"'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/tickets/comment/62cd3c8f6d95a586080e5342',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS => [
'content' => 'Content update',
'notetype' => 'public',
'idcomment' => '62f69192e2a80f35bd5a9b90',
'deletefileindex' => '0,1',
'files[]' => new CURLFILE('/path/to/file'),
],
CURLOPT_HTTPHEADER => ['X-API-KEY: TOKEN_LOGIN_API'],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var FormData = require('form-data')
var fs = require('fs')
var data = new FormData()
data.append('content', 'Content update')
data.append('notetype', 'public')
data.append('idcomment', '62f69192e2a80f35bd5a9b90')
data.append('deletefileindex', '0,1')
data.append('files[]', fs.createReadStream('/path/to/file'))
var config = {
method: 'put',
url: 'https://omni-api-uat.worldfone.cloud/services/tickets/comment/62cd3c8f6d95a586080e5342',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
...data.getHeaders(),
},
data: data,
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"data": {
"last_modified": {
"byid": "60f04042ef7372af76345c2b",
"time": 1660326501,
"options": [],
"owner": true
},
"content": "<p>Content update</p>\n",
"notetype": "public",
"upload_data": [
{
"extension": "txt",
"path": "DOMAIN_FILE",
"filesize": 1113,
"name": "FILENAME"
}
],
"ccs_updated": [],
"usersubmit_info": {
"username": "admin.C0001",
"owner": true,
"extension": "8001",
"email": "",
"name": "Worldfone4x Cloud",
"phone": "",
"last_modified": {
"byid": "60f04042ef7372af76345c2b",
"time": 1649231706,
"options": [],
"owner": true
},
"ticket_requester_id": "621d9820f5cd5c6b9c06ac86",
"ticket_submitter_id": "626b9dda8b56a14a8671b895",
"status": true
}
}
}
Update comment
HTTP Request
PUT /services/tickets/comment/<id_ticket>
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Request Body
Key | Type | Description |
---|---|---|
idcomment | String | ID comment |
content | String | Content of comment |
notetype | String | public or private |
deletefileindex | String | Index of files delete |
files | File | Files on comment |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
Delete comment
curl --location --request DELETE 'https://omni-api-uat.worldfone.cloud/services/tickets/comment/62cd3c8f6d95a586080e5342/62f690d5b378194b095210ff' \
--header 'X-API-KEY: TOKEN_LOGIN_API'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/tickets/comment/62cd3c8f6d95a586080e5342/62f690d5b378194b095210ff',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => ['X-API-KEY: TOKEN_LOGIN_API'],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var config = {
method: 'delete',
url:
'https://omni-api-uat.worldfone.cloud/services/tickets/comment/62cd3c8f6d95a586080e5342/62f690d5b378194b095210ff',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
},
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true
}
Delete comment
HTTP Request
DELETE /services/tickets/comment/<id_ticket>/<id_comment>
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
Read files
curl --location --request POST 'https://omni-api-uat.worldfone.cloud/services/tickets/files/read/6304a1f7e9e86adbb00ddd02' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json' \
--data-raw '{
"take": 5,
"page": 1
}'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/tickets/files/read/6304a1f7e9e86adbb00ddd02',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"take": 5,
"page": 1
}',
CURLOPT_HTTPHEADER => [
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var data = JSON.stringify({
take: 5,
page: 1,
})
var config = {
method: 'post',
url:
'https://omni-api-uat.worldfone.cloud/services/tickets/files/read/6304a1f7e9e86adbb00ddd02',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
'Content-Type': 'application/json',
},
data: data,
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"take": 5,
"page": 1,
"total": 0,
"totalPages": 0,
"data": []
}
Get list files in ticket
HTTP Request
POST /services/tickets/files/read/<id_ticket>
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API or SECRET_KEY |
Request Body
Key | Type | Required | Description |
---|---|---|---|
take | Number | ⬜️ | Number of tags response |
page | Number | ⬜️ | Current page |
sort | String | ⬜️ | desc or asc |
namefile | String | ⬜️ | Name of file |
startdate | Timestamp | ⬜️ | Created time start |
enddate | Timestamp | ⬜️ | Created time end |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
data | Array | Description of data |
Add files
curl --location --request POST 'https://omni-api-uat.worldfone.cloud/services/tickets/files/6304a1f7e9e86adbb00ddd02' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--form 'files[]=@"photo_2022-07-29_15-46-07.jpg"'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/tickets/files/6304a1f7e9e86adbb00ddd02',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => [
'files[]' => new CURLFILE('photo_2022-07-29_15-46-07.jpg'),
],
CURLOPT_HTTPHEADER => ['X-API-KEY: TOKEN_LOGIN_API'],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var FormData = require('form-data')
var fs = require('fs')
var data = new FormData()
data.append('files[]', fs.createReadStream('photo_2022-07-29_15-46-07.jpg'))
var config = {
method: 'post',
url: 'https://omni-api-uat.worldfone.cloud/services/tickets/files/6304a1f7e9e86adbb00ddd02',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
...data.getHeaders(),
},
data: data,
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true
}
Add files to ticket manual
HTTP Request
POST /services/tickets/files/<id_ticket>
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Request Body
Key | Type | Required | Description |
---|---|---|---|
files | array | ✅ | list file of tickets |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
Remove files
curl --location --request DELETE 'https://omni-api-uat.worldfone.cloud/services/tickets/files/6304a1f7e9e86adbb00ddd02' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json' \
--data-raw '{
"file_id": "6304b05af3329f689f54ebb6"
}'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/tickets/files/6304a1f7e9e86adbb00ddd02',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_POSTFIELDS => '{
"file_id": "6304b05af3329f689f54ebb6"
}',
CURLOPT_HTTPHEADER => [
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var data = JSON.stringify({
file_id: '6304b05af3329f689f54ebb6',
})
var config = {
method: 'delete',
url: 'https://omni-api-uat.worldfone.cloud/services/tickets/files/6304a1f7e9e86adbb00ddd02',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
'Content-Type': 'application/json',
},
data: data,
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true
}
Delete files by id
HTTP Request
DELETE /services/tickets/files/<id_ticket>
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Request Body
Key | Type | Required | Description |
---|---|---|---|
file_id | array | ✅ | List id file of tickets |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
Pause SLA
curl --location 'https://omni-api-uat.worldfone.cloud/services/tickets/SLATicket/' \
--header 'X-API-KEY: 0774b94dcadd6812936c19b4a7d489c4-657eddf9-7742-476e-b556-36bfd4dc6c22' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'choosetype=resumeafterrangetimeconfig' \
--data-urlencode 'timepending=1748508020' \
--data-urlencode 'comment=okii' \
--data-urlencode 'ticket_id=68396eead59f95320154b472' \
--data-urlencode 'idticket=513468396eeaa0286'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/tickets/SLATicket/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"choosetype": "resumeafterrangetimeconfig",
"timepending": 1748508020,
"comment": "okii",
"ticket_id": "68396eead59f95320154b472",
"idticket": "513468396eeaa0286"
}',
CURLOPT_HTTPHEADER => [
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var data = JSON.stringify({
choosetype: 'resumeafterrangetimeconfig',
timepending: 1748508020,
comment: 'okii',
ticket_id: '68396eead59f95320154b472',
idticket: '513468396eeaa0286'
})
var config = {
method: 'post',
url: 'https://omni-api-uat.worldfone.cloud/services/tickets/SLATicket/',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
'Content-Type': 'application/json',
},
data: data,
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"stt": true,
"msg": "update_success",
"last_modified": {
"byid": "64f7014443dc10df04090fd3",
"time": 1748594840,
"options": [],
"owner": true
}
}
Pause SLA
HTTP Request
POST /services/tickets/SLATicket/
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Request Body
Key | Type | Required | Description |
---|---|---|---|
choosetype | string | ✅ | Choose type: resumeafterrangetimeconfig |
timepending | int | ✅ | Timestamp resume |
comment | string | ✅ | Comment |
ticket_id | string | ✅ | Ticket ID generated |
idticket | string | ✅ | Ticket ID custom |
Response Data
Key | Type | Description |
---|---|---|
stt | Boolean | Success or Failed |
msg | String | Message success or failed |
last_modified | Object | Last modified |
Tags
Get tags
curl --location --request GET 'https://omni-api-uat.worldfone.cloud/settings/generalconfig/tags' \
--header 'X-API-KEY: TOKEN_LOGIN_API'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/settings/generalconfig/tags',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => ['X-API-KEY: TOKEN_LOGIN_API'],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var config = {
method: 'get',
url: 'https://omni-api-uat.worldfone.cloud/settings/generalconfig/tags',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
},
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"data": []
}
Get list tags or get tag by id
HTTP Request
GET /settings/generalconfig/tags
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API or SECRET_KEY |
Query Parameters
Key | Type | Required | Description |
---|---|---|---|
module | String | ⬜️ | Alias of module |
take | Number | ⬜️ | Number of tags response |
page | Number | ⬜️ | Current page |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
data | Array | List tags |
Read tags
curl --location --request POST 'https://omni-api-uat.worldfone.cloud/settings/generalconfig/tags/read' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json'
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/settings/generalconfig/tags/read',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"take": 5,
"page": 1,
"sort": {
"field": "last_modified.time",
"dir": "desc"
},
"startdate": 1643241600,
"enddate": 1658908044,
"searchtext": ""
}',
CURLOPT_HTTPHEADER => [
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var data = JSON.stringify({
take: 5,
page: 1,
sort: {
field: 'last_modified.time',
dir: 'desc',
},
startdate: 1643241600,
enddate: 1658908044,
searchtext: '',
})
var config = {
method: 'post',
url: 'https://omni-api-uat.worldfone.cloud/settings/generalconfig/tags/read',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
'Content-Type': 'application/json',
},
data: data,
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"take": 5,
"page": 1,
"total": 0,
"totalPages": 0,
"data": []
}
Get list tags with filter
HTTP Request
POST /settings/generalconfig/tags/read
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API or SECRET_KEY |
Request Body
Key | Type | Required | Description |
---|---|---|---|
take | Number | ⬜️ | Number of tags response |
page | Number | ⬜️ | Current page |
sort | array | ⬜️ | sort of tags |
startdate | timestamp | ⬜️ | The start date of tags |
enddate | timestamp | ⬜️ | The end date of tags |
searchtext | timestamp | ⬜️ | Search string tags |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
data | Array | List tags |
Omnichat
Get rooms
curl --location 'https://omni-api-uat.worldfone.cloud/services/omnichat/rooms/getrooms' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json' \
--data '{
"state": "new"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/omnichat/rooms/getrooms',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"state": "new"
}',
CURLOPT_HTTPHEADER => array(
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var settings = {
"url": "https://omni-api-uat.worldfone.cloud/services/omnichat/rooms/getrooms",
"method": "POST",
"timeout": 0,
"headers": {
"X-API-KEY": TOKEN_LOGIN_API,
"Content-Type": "application/json"
},
"data": JSON.stringify({
"state": "new"
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
The above command returns JSON structured like this:
{
"status": true,
"totalPage": 1,
"total": 1,
"data": [
{
"_id": "66b42f7260c1ca443b0af56756",
"page_id": "66b2c00bb79b6b1700092822",
"people_id": "66b42f6f714cdd1d5e0847576",
"source": "messenger",
"starttime": 1723084655,
"state": "assigned",
"totalMessage": 763,
"lastmessage": {
"_id": "686dd9f24598a586312432242",
"message_app_id": "Qe9Xbi0-gKBaASOM5GLdgQ7Peoe-wYnKVAKJJDDzA",
"date_app": 1752029681,
"createdtime": 1752029682,
"sender_info": {
"_id": "66b2c0503c3144a9180fa37d",
"type": "page",
"type_int": 2
},
"text": "",
"textEmptyBecause": "file",
"session_id": "67a5743153c7b3026308b7456"
},
"people_name": "Scott Newton III",
"people_name_non_utf8": "scott newton iii",
"totalSession": 7,
"currentsession": {
"_id": "67a5743153c7b3026303123",
"collection_session": "",
"starttime": 1738896433,
"userid": "63fc8876f8cabd92864b7882",
"startfrom": "new",
"namecustom": "stcloud.ba1.C0384"
},
"pagename": "Enlightened Business People in Favor of a Local Burger Joint",
"pageavatar": "",
"peopleavatar": "",
"_unread": 0,
"tags": []
}
]
}
Get list rooms
HTTP Request
POST /services/omnichat/rooms/getrooms
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Query Parameters
Key | Type | Required | Description |
---|---|---|---|
state | String | ✅ | State of room |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
msg | String | Message error when API failed |
data | Array | List rooms |
Count rooms by state
curl --location 'https://omni-api-uat.worldfone.cloud/services/omnichat/rooms/countsourceroomsbystate' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json' \
--data '{
"state": "received"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/omnichat/rooms/countsourceroomsbystate',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"state": "received"
}',
CURLOPT_HTTPHEADER => array(
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var settings = {
"url": "https://omni-api-uat.worldfone.cloud/services/omnichat/rooms/countsourceroomsbystate",
"method": "POST",
"timeout": 0,
"headers": {
"X-API-KEY": TOKEN_LOGIN_API,
"Content-Type": "application/json"
},
"data": JSON.stringify({
"state": "received"
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
The above command returns JSON structured like this:
{
"status": true,
"data": {
"total": 862,
"facebook": 18,
"messenger": 50,
"zalo": 15,
"partner_viber": 6,
"telegram": 5,
"line": 0,
"google_business_messages": 6,
"livechat": 757
}
}
Count rooms by state
HTTP Request
GET /services/omnichat/rooms/countsourceroomsbystate
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Query Parameters
Key | Type | Required | Description |
---|---|---|---|
state | String | ✅ | State of room |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
msg | String | Message error when API failed |
data | Array | List channel |
Count state rooms
curl --location --request GET 'https://omni-api-uat.worldfone.cloud/services/omnichat/rooms/countstaterooms' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json' \
--data '{
"state": "received"
}'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/omnichat/rooms/countstaterooms,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => ['X-API-KEY: TOKEN_LOGIN_API'],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var settings = {
"url": "https://omni-api-uat.worldfone.cloud/services/omnichat/rooms/countstaterooms",
"method": "GET",
"timeout": 0,
"headers": {
"X-API-KEY": TOKEN_LOGIN_API,
"Content-Type": "application/json"
},
"data": JSON.stringify({
"state": "received"
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
The above command returns JSON structured like this:
{
"status": true,
"data": {
"total": 4126,
"new": 352,
"received": 863,
"assigned": 2,
"spam": 175,
"solved": 2510
}
}
Count state rooms
HTTP Request
GET /services/omnichat/rooms/countstaterooms
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Query Parameters
Key | Type | Required | Description |
---|---|---|---|
state | String | ✅ | State of room |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
msg | String | Message error when API failed |
data | Array | List state of rooms |
Get unread messages
curl --location 'https://omni-api-uat.worldfone.cloud/services/omnichat/rooms/getunreadmessagelistroom' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json' \
--data '{
"listunreadroom": {
"686cef518424edb10b023b33": {
"startTime": 1751969612,
"state": "new",
"lasttime": 1751969619,
"totalMessage": 1
},
"686cee886db4a56d100a8823": {
"startTime": 1751969414,
"state": "new",
"lasttime": 1751969418,
"totalMessage": 1
}
}
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/omnichat/rooms/getunreadmessagelistroom',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"listunreadroom": {
"686cef518424edb10b023b33": {
"startTime": 1751969612,
"state": "new",
"lasttime": 1751969619,
"totalMessage": 1
},
"686cee886db4a56d100a8823": {
"startTime": 1751969414,
"state": "new",
"lasttime": 1751969418,
"totalMessage": 1
}
}
}',
CURLOPT_HTTPHEADER => array(
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type: application/json',
'Authorization: ••••••'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var settings = {
"url": "https://omni-api-uat.worldfone.cloud/services/omnichat/rooms/getunreadmessagelistroom",
"method": "POST",
"timeout": 0,
"headers": {
"X-API-KEY": TOKEN_LOGIN_API,
"Content-Type": "application/json",
"Authorization": "Basic c3RjbG91ZC50dW9uZ25ndXllbi5DMjEyMzoxMjM0NTY="
},
"data": JSON.stringify({
"listunreadroom": {
"686cef518424edb10b023b33": {
"startTime": 1751969612,
"state": "new",
"lasttime": 1751969619,
"totalMessage": 1
},
"686cee886db4a56d100a8823": {
"startTime": 1751969414,
"state": "new",
"lasttime": 1751969418,
"totalMessage": 1
}
}
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
The above command returns JSON structured like this:
{
"status": true,
"data": {
"686cef518424edb10b023b33": 0,
"686cee886db4a56d100a8823": 0
}
}
Get unread message list rooms
HTTP Request
GET /services/omnichat/rooms/getunreadmessagelistroom
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Query Parameters
Key | Type | Required | Description |
---|---|---|---|
listunreadroom | String | ✅ | list room |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
msg | String | Message error when API failed |
data | Array | List id rooms |
Get messages
curl --location 'https://omni-api-uat.worldfone.cloud/services/omnichat/messages/getmessages' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic c3RjbG91ZC50dW9uZ25ndXllbi5DMjEyMzoxMjM0NTY=' \
--data '{
"room_id": "686cef518424edb10b023b33",
"page_id": "671f527112fa851c00ff0b7b",
"source": "livechat"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/omnichat/messages/getmessages',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"room_id": "686cef518424edb10b023b33",
"page_id": "671f527112fa851c00ff0b7b",
"source": "livechat"
}',
CURLOPT_HTTPHEADER => array(
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type: application/json',
'Authorization: ••••••'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var settings = {
"url": "https://omni-api-uat.worldfone.cloud/services/omnichat/messages/getmessages",
"method": "POST",
"timeout": 0,
"headers": {
"X-API-KEY": TOKEN_LOGIN_API,
"Content-Type": "application/json",
"Authorization": "Basic c3RjbG91ZC50dW9uZ25ndXllbi5DMjEyMzoxMjM0NTY="
},
"data": JSON.stringify({
"room_id": "686cef518424edb10b023b33",
"page_id": "671f527112fa851c00ff0b7b",
"source": "livechat"
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
The above command returns JSON structured like this:
{
"status": true,
"total": 1,
"totalPage": 1,
"messageFor": "686cef518424edb10b023b33",
"data": [
{
"type": "divide",
"date_app": 1751969612,
"message": "08/07/2025"
},
{
"_id": "686cef5374162be6360047ac",
"message_app_id": null,
"type": "text",
"date_app": 1751969612,
"createdtime": 1751969619,
"source": "livechat",
"people_id": "686cef4c4234324243874c71",
"page_id": "671f527112fa8123143124b7b",
"room_id": "686cef518424edb112312b33",
"sender_info": {
"_id": "686cef518424edb10b031232",
"type": "people",
"type_int": 1,
"name": "OTT-147-ZNS",
"avatar": ""
},
"text": "Bắt đầu",
"_collection": "",
"_me": false,
"_noava": false,
"date_app_text": "2025/07/08 17:13:32",
"timedisplay": "17:13"
}
]
}
Get list message
HTTP Request
POST /services/omnichat/messages/getmessages
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Query Parameters
Key | Type | Required | Description |
---|---|---|---|
room_id | String | ✅ | Room id |
page_id | String | ✅ | Page id of room |
source | String | ✅ | Source of room |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
total | Number | Total message |
totalPage | Number | Total page |
messageFor | String | Room id |
msg | String | Message error when API failed |
data | Array | List message |
Search messages
curl --location 'https://omni-api-uat.worldfone.cloud/services/omnichat/messages/search' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json' \
--data '{
"room_id": "686cef518424edb10b023b33",
"page_id": "671f527112fa851c00ff0b7b",
"source": "livechat",
"lasttimemessage": 1751969612
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/omnichat/messages/search',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"room_id": "686cef518424edb10b023b33",
"page_id": "671f527112fa851c00ff0b7b",
"source": "livechat",
"lasttimemessage": 1751969612
}',
CURLOPT_HTTPHEADER => array(
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var settings = {
"url": "https://omni-api-uat.worldfone.cloud/services/omnichat/messages/search",
"method": "POST",
"timeout": 0,
"headers": {
"X-API-KEY": TOKEN_LOGIN_API,
"Content-Type": "application/json"
},
"data": JSON.stringify({
"room_id": "686cef518424edb10b023b33",
"page_id": "671f527112fa851c00ff0b7b",
"source": "livechat",
"lasttimemessage": 1751969612
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
The above command returns JSON structured like this:
{
"stt": true,
"listModules": {
"C0384_message_202507": 1
},
"total": 1,
"listModulesMessages": {
"C0384_message_202507": 1
},
"totalMessages": 1,
"takeNextPage": [
1
]
}
Search messages
HTTP Request
POST /services/omnichat/messages/search
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Query Parameters
Key | Type | Required | Description |
---|---|---|---|
room_id | String | ✅ | Room id |
page_id | String | ✅ | Page id of room |
source | String | ✅ | Source of room |
lasttimemessage | Number | ✅ | Time of message |
Response Data
Key | Type | Description |
---|---|---|
stt | Boolean | Success or Failed |
listModules | Object | List module |
total | Number | Total message |
listModulesMessages | Object | List module messages |
msg | String | Message error when API failed |
Get Pages
curl --location 'https://omni-api-uat.worldfone.cloud/services/omnichat/pages' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/omnichat/pages',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'X-API-KEY: TOKEN_LOGIN_API'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var settings = {
"url": "https://omni-api-uat.worldfone.cloud/services/omnichat/pages",
"method": "GET",
"timeout": 0,
"headers": {
"X-API-KEY": TOKEN_LOGIN_API
},
};
$.ajax(settings).done(function (response) {
console.log(response);
});
The above command returns JSON structured like this:
{
"status": true,
"data": {
"listsourcepages": [
"facebook",
"livechat",
"telegram",
"whatsapp",
"zalo",
"app_google",
"google_business_messages",
"zalo_personal",
"partner_viber",
"line",
"messenger"
],
"listpagenames": [
{
"page_id": "66c6bc53cc89a71b004123123",
"name": "OmniCXM",
"channel": "whatsapp"
},
{
"page_id": "624d72c9b9be381a0053534534",
"name": "Worldmeetingvn",
"channel": "zalo"
},
]
}
}
Get page
HTTP Request
POST /services/omnichat/pages
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
data | String | Data |
Get quick response
curl --location 'https://omni-api-uat.worldfone.cloud/services/omnichat/general/readQuickResponses' \
--header 'X-API-KEY: TOKEN_LOGIN_API' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic c3RjbG91ZC50dW9uZ25ndXllbi5DMjEyMzoxMjM0NTY=' \
--data '{
"textsearch": "phản hồi nhanh"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/services/omnichat/general/readQuickResponses',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"textsearch": "phản hồi nhanh"
}',
CURLOPT_HTTPHEADER => array(
'X-API-KEY: TOKEN_LOGIN_API',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var settings = {
"url": "https://omni-api-uat.worldfone.cloud/services/omnichat/general/readQuickResponses",
"method": "POST",
"timeout": 0,
"headers": {
"X-API-KEY": TOKEN_LOGIN_API,
"Content-Type": "application/json"
},
"data": JSON.stringify({
"textsearch": "phản hồi nhanh"
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
The above command returns JSON structured like this:
{{
"status": true,
"totalpage": 1,
"total": 1,
"data": [
{
"_id": "67e504b8b7bb5f709e011d66",
"title": "Text phản hồi nhanh",
"shortcode": "/phn",
"content": "Phản hồi nhanh",
"share": [
"user_674d15bd723545121f058cb2"
],
"status": true,
"attachments": [],
"created": {
"byid": "674d15bd723545121f058cb2",
"buid": "636ca7a5e73061044303e183",
"time": 1743062200,
"options": []
},
"last_modified": {
"byid": "674d15bd723545121f058cb2",
"buid": "636ca7a5e73061044303e183",
"time": 1743062243,
"options": []
}
}
]
}
Get quick response
HTTP Request
POST services/omnichat/general/readQuickResponses
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API |
Query Parameters
Key | Type | Required | Description |
---|---|---|---|
textsearch | String | ⬜️ | Content search |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
totalpage | Number | Total page |
total | Number | Total response |
data | Array | List response |
msg | String | Message error when API failed |
CDR
Get CDR
curl --location --request POST 'https://omni-api-uat.worldfone.cloud/call/CDR?take=100&page=1&startdate=1690832892&enddate=1693338492' \
--header 'X-API-KEY: TOKEN_LOGIN_API'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://omni-api-uat.worldfone.cloud/call/CDR?take=100&page=1&startdate=1690832892&enddate=1693338492',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['X-API-KEY: TOKEN_LOGIN_API'],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios')
var config = {
method: 'post',
url: 'https://omni-api-uat.worldfone.cloud/call/CDR?take=100&page=1&startdate=1690832892&enddate=1693338492',
headers: {
'X-API-KEY': 'TOKEN_LOGIN_API',
},
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
The above command returns JSON structured like this:
{
"status": true,
"take": 100,
"page": 1,
"total": 1188,
"totalpage": 12,
"startdate": 1690832892,
"enddate": 1693338492,
"prevPage": "https://omni-api-uat.worldfone.cloud/call/CDR?take=100&page=1&startdate=1690832892&enddate=1693338492",
"nextPage": "https://omni-api-uat.worldfone.cloud/call/CDR?take=100&page=3&startdate=1690832892&enddate=1693338492",
"data" : [
{
"_id" : "64f0f64692d9e04e3d31a93d",
"dst" : "s",
"src" : "8001",
"uniqueid" : "1693513271.12862022",
"billsec" : 3,
"calldate" : 1693513271,
"calldatetime" : "2023-09-01 03:21:11",
"calltype" : "",
"carrier" : "",
"did_number" : "0980000010",
"disposition" : "ANSWERED",
"duration" : 4,
"hangup_by" : "8001",
"hangup_by_text" : "agent",
"holdtime" : 0,
"in_out" : "outbound",
"moh_time" : 0,
"queue" : "NONE",
"talktime" : 3,
"user4x" : [],
"waitingtime" : 1,
"waitingtime_inqueue" : 0,
"_collection" : "C0384_cdr_st_202309"
}
...
]
}
Get CDR in 1 month with pagination by 4 query parameters (take, page, startdate, enddate)
HTTP Request
POST /call/CDR
Request Headers
Key | Value |
---|---|
Content-Type | application/json |
X-API-KEY | TOKEN_LOGIN_API or SECRET_KEY |
Query Parameters
Key | Type | Required | Description |
---|---|---|---|
take | Number | ⬜️ | Number of call log response |
page | Number | ⬜️ | Page response |
startdate | timestamp | ⬜️ | Time response |
enddate | timestamp | ⬜️ | Time response |
Response Data
Key | Type | Description |
---|---|---|
status | Boolean | Success or Failed |
error | String | Message error when API failed |
take | Number | Number of call logs response |
totalPages | Number | Total pages |
total | Number | Total call logs |
data | Array | Data of call logs |
HTTP Code
The OmniCXM API uses the following http codes:
HTTP Code | Meaning |
---|---|
200 | OK -- API response OK |
201 | Created -- Request OK but API is not already success |
202 | Accepted -- Request OK but API limited |
304 | Not Modified |
400 | Bad Request -- Your request sucks |
401 | Unauthorized -- Your API key is wrong |
403 | Forbidden -- Maybe permission is not open |
404 | Not Found -- The specified could not be found |
405 | Method Not Allowed -- You tried to access api with an invalid method |
406 | Not Acceptable -- You requested a format that isn't json |
500 | Internal Server Error -- We had a problem with our server. Try again later. |
502 | Bad Gateway -- We had a problem with our server. Try again later. |
503 | Service Unavailable -- We're temporarially offline for maintanance. Please try again later. |