# ApiRing AntCrm apis description

![](https://2883279534-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDeVvlGozALEs84kVZd2q%2Fuploads%2FZV0iGcpkKk80xcaTTDq1%2F0.png?alt=media)

**AntCRM**

The document is used for integrating with the AntCRM system to synchronize customer information, order information, and ticket information.

**Domains used:**

* Production: <https://apiring.antbuddy.com>

**Security:**

* Secret key, to ensure safety, requests to AntCRM need to contain a pre-agreed secret key in the request header:

headers: {

“apikey”: “\<secret key>”

}

* **secret key**:

**List of APIs**

**1. Client API**

There are 3 types of customers on AntCrm:

* Lead (contactType: “lead")
* Contact (contactType: “customer", type: 0) - Account (contactType: “customer", type: 1)

a. Customer list or details of 1 customer via phone number or email or id on Ant CRM URL: /contacts

Method: GET

Content-Type: application/json

| **Parameters**          | **Type**      | **Required** | **Getting Explained**                                                                        |
| ----------------------- | ------------- | ------------ | -------------------------------------------------------------------------------------------- |
| contactType             | string        |              | “lead” or “customer”                                                                         |
| type                    | string        |              | Customer Type. (0: contact, 1: account)                                                      |
| phone                   | string        |              | phone number                                                                                 |
| customerId              | string        |              | Id of contact or account                                                                     |
| leadId                  | string        |              | lead id                                                                                      |
| email                   | string        |              | email                                                                                        |
| <p>page</p><p>limit</p> | number number |              | Sequence number of pages, each page has a maximum of 20 customers Number of records per page |

Results returned:

HTTP Response Code: 200

Response:

\[{

"name": “”,

"contactType": ””,

“type”: “”,

“leadId”: “”,

“customerId”: “”,

“dateOfBirth”: “”, “gender”: “”, addresses: \[], phones: \[], emails: \[], industry: “", in the: \[], bgInfo: “”, stage: “”, tags: \[], sourceContact: “”, responsibleStaff: “”, cusFields: \[], scoreAvailable: Number, // Accumulated points scoreRank: Number, // Rank score rankName: “” // Member rank, createdAt: “”, // Customer creation time updatedAt: “” // Customer update time

}]

1. Add customers URL: /contacts Method: POST

Content-Type: application/json

| **Parameters**    | **Type** | **Required** | **Explain**                                           |
| ----------------- | -------- | ------------ | ----------------------------------------------------- |
| name              | string   | AND          | Customer name                                         |
| customerIdApiRing | string   | AND          | Customer's code                                       |
| type              | string   |              | Customer Type. (0: contact, 1: account). Default is 0 |
| contactType       | string   |              | “lead" or “customer". Default is lead                 |
| dateOfBirth       | string   |              | Date of birth. (“March 15, 2000”)                     |

| gender addresses | string array |   | <p>Sex. (0: Male, 1: Female, 2: Other). Default is 2</p><p>Customer address.</p><p>\[{ city: "Ho Chi Minh City", state: "Tan Binh District", street: "319", (house number) streetName: "Nguyen Kiem", wards: "Ward 12",</p><p>"country": {</p><p>"code": "VN",</p><p>"name": "Vietnam"</p><p>}</p><p>}]</p><p>Record the same as the address on the system.</p> |
| ---------------- | ------------ | - | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| phones           | array        |   | <p>Phone number.</p><p>\[{type:”Work”, value: “01223223”} ]</p>                                                                                                                                                                                                                                                                                                 |
| emails           | array        |   | <p>Email</p><p>\[{type: “Work”, value: “<xyz@example.com>”}]</p>                                                                                                                                                                                                                                                                                                |
| industry         | string       |   | Industry (“Real Estate”)                                                                                                                                                                                                                                                                                                                                        |
| in the           | array        |   | <p>Social network.</p><p>\[{protocol: “Facebook”, “value”: “<https://abc.com”>}]</p>                                                                                                                                                                                                                                                                            |
| bgInfo           | string       |   | Note. (“VIP Customer”)                                                                                                                                                                                                                                                                                                                                          |
| stage            | string       |   | Status. ("A new customer")                                                                                                                                                                                                                                                                                                                                      |
| tags             | string       |   | <p>Label.</p><p>\[ “Not yet contacted”, “Contacted” ]</p>                                                                                                                                                                                                                                                                                                       |
| sourceContact    | string       |   | Contact source. ("Advertisement")                                                                                                                                                                                                                                                                                                                               |
| responsibleStaff | string       |   | <p>Email of the employee in charge.</p><p>(“<nhanvien1@gmail.com>”)</p>                                                                                                                                                                                                                                                                                         |
| cusFields        | array        |   | <p>Custom fields on AntCRM.</p><p>\[</p><p>{ name: "Shipping</p><p>unit",</p><p>value: “Fast delivery”</p><p>]</p>                                                                                                                                                                                                                                              |

}

Results returned:

HTTP Response Code: 200

Response:

{

"success": 1,

"leadId" or “customerId”: 9457 (customer id on antcrm) }

1. Edit customer

URL: /contacts

Method: PUT

Content-Type: application/json

| **Parameters**                            | **Type**                 | **Catch Setc** | **Explain**                                                                                                                                                                                                                                                                                                                                                            |
| ----------------------------------------- | ------------------------ | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| leadId or customerId or customerIdApiRing | string                   | AND            | Customer id on antcrm or customer code passed in                                                                                                                                                                                                                                                                                                                       |
| name                                      | string                   |                | Customer name                                                                                                                                                                                                                                                                                                                                                          |
| dateOfBirth                               | string                   |                | Date of birth. (“March 15, 2000”)                                                                                                                                                                                                                                                                                                                                      |
| gender                                    | string                   |                | Sex. (0: Male, 1: Female, 2: Other)                                                                                                                                                                                                                                                                                                                                    |
| <p>addresses</p><p>phones</p>             | <p>array</p><p>array</p> |                | <p>Customer address.</p><p>\[{ city: "Ho Chi Minh City", state: "Tan Binh District", street: "319", (house number) streetName: "Nguyen Kiem", wards: "Ward 12",</p><p>"country": {</p><p>"code": "VN",</p><p>"name": "Vietnam"</p><p>}</p><p>}]</p><p>Record the same as the address on the system.</p><p>Phone number.</p><p>\[{type:”Work”, value: “01223223”} ]</p> |
| emails                                    | array                    |                | <p>Email</p><p>\[type: “Work”, value:</p><p>““<xyz@example.com>””]</p>                                                                                                                                                                                                                                                                                                 |
| industry                                  | string                   |                | Industry (“Real Estate”)                                                                                                                                                                                                                                                                                                                                               |
| in the                                    | array                    |                | <p>Social network.</p><p>\[protocol: “Facebook”, “value”: “</p><p>“<https://abc.com””> ]</p>                                                                                                                                                                                                                                                                           |
| bgInfo                                    | string                   |                | Note. (“VIP Customer”)                                                                                                                                                                                                                                                                                                                                                 |
| stage                                     | string                   |                | Status. ("A new customer")                                                                                                                                                                                                                                                                                                                                             |
| tags                                      | string                   |                | <p>Label.</p><p>\[ “Not yet contacted”, “Contacted” ]</p>                                                                                                                                                                                                                                                                                                              |
| sourceContact                             | string                   |                | Contact source. ("Advertisement")                                                                                                                                                                                                                                                                                                                                      |
| responsibleStaff                          | string                   |                | <p>Email of the person in charge.</p><p>(“<nhanvien1@gmail.com>”)</p>                                                                                                                                                                                                                                                                                                  |
| cusFields                                 | array                    |                | <p>Custom fields on AntCRM.</p><p>\[</p><p>{</p><p>name: "Shipping unit",</p><p>value: “Fast delivery”</p><p>}</p><p>]</p>                                                                                                                                                                                                                                             |

Results returned:

HTTP Response Code: 200

Response:

{

"success": 1,

"leadId" or “customerId”: 9457 (customer id on antcrm) }

1. Delete customer

URL: /contacts

Method: DELETE

Content-Type: application/json

| **Parameters**                            | **Type** | **Cat ch set c**         | **Explain**                                      |
| ----------------------------------------- | -------- | ------------------------ | ------------------------------------------------ |
| leadId or customerId or customerIdApiRing | string   | <p>A</p><p>N</p><p>D</p> | Customer id on antcrm or customer code passed in |

Results returned:

HTTP Response Code: 200

Response:

{

"success": 1

}

1. Add customers in bulk

URL: /contacts/package

Method: POST

Content-Type: application/json

Limit 100 contacts per request

Body: \[{customer data A}, {customer data B}]

| **Parameters**    | **Type**     | **Cat ch set c**         | **Explain**                                                                                                                                                                                                                                                                                                                                                     |
| ----------------- | ------------ | ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name              | string       | <p>A</p><p>N</p><p>D</p> | Customer name                                                                                                                                                                                                                                                                                                                                                   |
| customerIdApiRing | string       | <p>A</p><p>N</p><p>D</p> | Customer's code                                                                                                                                                                                                                                                                                                                                                 |
| type              | string       |                          | Customer Type. (0: contact, 1: account). Default is 0                                                                                                                                                                                                                                                                                                           |
| contactType       | string       |                          | “lead" or “customer". Default is lead                                                                                                                                                                                                                                                                                                                           |
| dateOfBirth       | string       |                          | Date of birth. (“March 15, 2000”)                                                                                                                                                                                                                                                                                                                               |
| gender addresses  | string array |                          | <p>Sex. (0: Male, 1: Female, 2: Other). Default is 2</p><p>Customer address.</p><p>\[{ city: "Ho Chi Minh City", state: "Tan Binh District", street: "319", (house number) streetName: "Nguyen Kiem", wards: "Ward 12",</p><p>"country": {</p><p>"code": "VN",</p><p>"name": "Vietnam"</p><p>}</p><p>}]</p><p>Record the same as the address on the system.</p> |
| phones            | array        |                          | <p>Phone number.</p><p>\[{type:”Work”, value: “01223223”} ]</p>                                                                                                                                                                                                                                                                                                 |
| emails            | array        |                          | <p>Email</p><p>\[{type: “Work”, value: “<xyz@example.com>”}]</p>                                                                                                                                                                                                                                                                                                |
| industry          | string       |                          | Industry (“Real Estate”)                                                                                                                                                                                                                                                                                                                                        |
| in the            | array        |                          | <p>Social network.</p><p>\[{protocol: “Facebook”, “value”: “<https://abc.com”>}]</p>                                                                                                                                                                                                                                                                            |
| bgInfo            | string       |                          | Note. (“VIP Customer”)                                                                                                                                                                                                                                                                                                                                          |
| stage             | string       |                          | Status. ("A new customer")                                                                                                                                                                                                                                                                                                                                      |
| tags              | string       |                          | <p>Label.</p><p>\[ “Not yet contacted”, “Contacted” ]</p>                                                                                                                                                                                                                                                                                                       |
| sourceContact     | string       |                          | Contact source. ("Advertisement")                                                                                                                                                                                                                                                                                                                               |
| responsibleStaff  | string       |                          | Email of the person in charge. (“<nhanvien1@gmail.com>”)                                                                                                                                                                                                                                                                                                        |
| cusFields         | array        |                          | <p>Custom fields on AntCRM.</p><p>\[</p><p>{ name: "Shipping unit", value: “Fast delivery”</p><p>}</p><p>]</p>                                                                                                                                                                                                                                                  |

Results returned:

HTTP Response Code: 200

Response:

{

"success": 1,

"leadId" or “customerId”: \[9457, 9458, 9459] (customer id on antcrm) }

### 2. Trading API

1. List of transactions or details of a transaction via id on Ant CRM URL:

/opportunities

Method: GET

Content-Type: application/json

| **Parameters** | **Type** | **Cat ch set c** | **Explain**                                   |
| -------------- | -------- | ---------------- | --------------------------------------------- |
| number         | string   |                  | Id of opportunity                             |
| page           | number   |                  | Page number, maximum 20 transactions per page |
| limit          | number   |                  | Number of records per page                    |

Results returned:

| **Parameters**                      | **Type**                   | **Required** | **Explain**                                                                                                                                                                           |
| ----------------------------------- | -------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name                                | string                     | AND          | Trading name                                                                                                                                                                          |
| receiverName                        | string                     | AND          | Customer name                                                                                                                                                                         |
| opportunityIdApiRing                | string                     |              | Code orders                                                                                                                                                                           |
| dealByUsers                         | array                      |              | Officer in charge. For example: \[“<thong.nguyen@antbuddy.com>”]                                                                                                                      |
| <p>dealWith</p><p>receiverPhone</p> | <p>Object</p><p>string</p> |              | <p>{</p><p>“customerId”: “123”,</p><p>“name”: “thong”,</p><p>“phones”: \[{type: “Work”, value: “023232”}],</p><p>“customerIdApiRing”: “Customer Id” }</p><p>Customer phone number</p> |

HTTP Response Code: 200

Response:

\[{ cusFields: \[

{ name: "Shipping unit", value: “Fast delivery”

}

],

description: "", groupPackage: \[], name: "test", number: 3609, receiverAddressObj: {street: "", streetName: "", city: "", state: "", wards: "", cityCode: "", stateCode:

""}, receiverName: "Tuyen Do ", receiverPhone: "0123444534", stage: "", value: 4520000,

branch: “ // branch or store name, createdAt: “”, // Order creation time updatedAt: “” // Order update time

}]

1. Add transaction

URL: /opportunities

Method: POST

Content-Type: application/json

| receiverAddressObj | object |   | <p>Customer address. For example: {</p><p>city: "Ho Chi Minh City",</p><p>state: "Tan Binh district", street: "3", //(apartment number) streetName: "Nguyen Kiem",</p><p>wards: "Ward 12",</p><p>"country": {</p><p>"code": "VN",</p><p>"name": "Vietnam"</p><p>}</p><p>}</p><p>Record the same as the address on the system.</p>                                                                                                                                                                |
| ------------------ | ------ | - | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| groupPackage       | array  |   | <p>Information line. For example:</p><p>\[</p><p>{ name: "Beef combo", // product name quantity: 1, // quantity</p><p>typeDiscount: 1, (0: cash, 1: percent) // type of discount discount: 10, // discount amount or % discount value: 1000, // Product price productIdApiRing: “1”, // product id note: "Grilled beef" // Note, code: “Sku” // Product code</p><p>}</p><p>]</p><p>Note:</p><p>- The combo name and product in the combo must match the corresponding combo and product name</p> |
| value              | number |   | Value of the transaction. If there is no value, the system will calculate the value of the transaction according to the price on the system.                                                                                                                                                                                                                                                                                                                                                     |
| receiverNote       | string |   | Delivery notes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| description        | string |   | Transaction description                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| stage              | string |   | Transaction status                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| branch             | string |   | Store or branch name                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| cusFields          | array  |   | <p>AntCRM custom fields. \[</p><p>{</p><p>name: "Shipping unit", value: “Fast delivery”</p><p>}</p><p>]</p>                                                                                                                                                                                                                                                                                                                                                                                      |

Results returned:

| createdAt      | Number |   | <p>Creation time</p><p>Type: Timestamp</p> |
| -------------- | ------ | - | ------------------------------------------ |
| shipping\_cost | Number |   | Shipping Fee                               |

HTTP Response Code: 200

Response:

{

"success": 1,

"number”: 9457 (id of transaction on antcrm) }

1. Edit transaction

URL: /opportunities

Method: PUT

Content-Type: application/json

| **Parameters** | **Type** | **Required** | **Explain**           |
| -------------- | -------- | ------------ | --------------------- |
| number         | string   | AND          | id on crm             |
| name           | string   |              | Trading name          |
| receiverName   | string   |              | Customer name         |
| receiverPhone  | string   |              | Customer phone number |

| <p>receiverAddress Obj</p><p>groupPackage</p> | <p>object</p><p>array</p> |   | <p>Customer address. For example: {</p><p>city: "Ho Chi Minh City",</p><p>state: "Tan Binh district", street: "3", //(apartment number) streetName: "Nguyen Kiem",</p><p>wards: "Ward 12",</p><p>"country": {</p><p>"code": "VN",</p><p>"name": "Vietnam"</p><p>}</p><p>}</p><p>Record the same as the address on the system.</p><p>Information line. For example:</p><p>\[</p><p>{ name: "Beef combo", // product name quantity: 1, // quantity</p><p>typeDiscount: 1, (0: cash, 1: percent) //</p><p>type of discount discount: 10, // discount amount or % discount value: 1000, // Product price productIdApiRing: “1”, // product id note: "Grilled beef" // Note, code: “Sku” // Product code</p><p>}</p><p>]</p><p>Note:</p><p>- The combo name and product in the combo must match the corresponding combo and product name on the system.</p> |
| --------------------------------------------- | ------------------------- | - | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| value                                         | number                    |   | Value of the transaction. If there is no value, the system will calculate the value of the transaction according to the price on the system.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| receiverNote                                  | string                    |   | Delivery notes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| description                                   | string                    |   | Transaction description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| stage                                         | string                    |   | Transaction status                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| branch                                        | string                    |   | Store or branch name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| cusFields                                     | array                     |   | <p>Custom fields on AntCRM.</p><p>\[</p><p>{</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
|                                               |                           |   | <p>name: "Shipping unit", value: “Fast delivery”</p><p>}</p><p>]</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| shipping\_cost                                | Number                    |   | Shipping fee                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

Results returned:

HTTP Response Code: 200

Response:

{

"success": 1,

"number”: 9457 (id of transaction on antcrm) }

1. Delete transaction

URL: /opportunities

Method: DELETE

Content-Type: application/json

| **Parameters** | **Type** | **Cat ch set c**         | **Explain**                     |
| -------------- | -------- | ------------------------ | ------------------------------- |
| number         | string   | <p>A</p><p>N</p><p>D</p> | id of the transaction on antcrm |

Results returned: HTTP Response Code: 200

Response:

{

"success": 1 }

1. Add bulk transactions URL: /opportunities/package

Method: POST

Content-Type: application/json

Limit 100 orders per request

Body: \[{order data A}, {order data B}]

| **Parameters** | **Type** | **Required** | **Explain** |
| -------------- | -------- | ------------ | ----------- |

| name                                | string                     | AND | Trading name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ----------------------------------- | -------------------------- | --- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| receiverName                        | string                     | AND | Customer name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| opportunityIdApiRing                | string                     |     | Code orders                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| dealByUsers                         | array                      |     | Officer in charge. For example: \[“<thong.nguyen@antbuddy.com>”]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| <p>dealWith</p><p>receiverPhone</p> | <p>Object</p><p>string</p> |     | <p>{</p><p>“customerId”: “123”,</p><p>“name”: “thong”,</p><p>“phones”: \[{type: “Work”, value: “023232”}],</p><p>“customerIdApiRing”: “Customer Id” }</p><p>Customer phone number</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| receiverAddressObj                  | object                     |     | <p>Customer address. For example: {</p><p>city: "Ho Chi Minh City",</p><p>state: "Tan Binh district", street: "3", //(apartment number) streetName: "Nguyen Kiem",</p><p>wards: "Ward 12",</p><p>"country": {</p><p>"code": "VN",</p><p>"name": "Vietnam"</p><p>}</p><p>}</p><p>Record the same as the address on the system.</p>                                                                                                                                                                                                                                                                                                                                 |
| groupPackage                        | array                      |     | <p>Information line. For example:</p><p>\[</p><p>{name: "Beef combo", // product name quantity: 1, // quantity typeDiscount: 1, (0: cash, 1: percent) //</p><p>type of discount discount: 10, // discount amount or % discount value: 1000, // Product price productIdApiRing: “1”, // product id note: "Grilled beef" // Note, code: “Sku” // Product code</p><p>}</p><p>]</p><p>Note:</p><p>- The combo name and product in the combo must match the corresponding combo and product name on the system.</p><p>Value of the transaction. If there is no value, the system will calculate the value of the transaction according to the price on the system.</p> |
| value                               | number                     |     | The transaction value. If no value is provided, the system will calculate the transaction value based on the system's pricing                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| receiverNote                        | number                     |     | Delivery notes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| description                         | string                     |     | Transaction description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| stage                               | string                     |     | Transaction status                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| branch                              | string                     |     | Store or branch name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| cusFields                           | array                      |     | <p>Custom fields on AntCRM.</p><p>\[</p><p>{ name: "Shipping unit", value: “Fast delivery”</p><p>}</p><p>]</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| createdAt                           | Number                     |     | <p>Creation time</p><p>Type: Timestamp</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| shipping\_cost                      | Number                     |     | Shipping fee                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |

Results returned: HTTP Response Code: 200

Response:

{

"success": 1,

"number”: \[9457, 9458, 9459] (antcrm transaction id) }

1. Edit transaction URL: /opportunities/package

Method: PUT

Content-Type: application/json Limit 100 orders per request

Body: \[{order data A}, {order data B}]

| **Parameters**                                | **Type**                  | **Required** | **Explain**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| --------------------------------------------- | ------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| number                                        | string                    | AND          | id on crm                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| name                                          | string                    |              | Trading name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| receiverName                                  | string                    |              | Customer name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| receiverPhone                                 | string                    |              | Customer phone number                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| <p>receiverAddress Obj</p><p>groupPackage</p> | <p>object</p><p>array</p> |              | <p>Customer address. For example: {</p><p>city: "Ho Chi Minh City",</p><p>state: "Tan Binh district", street: "3", //(apartment number) streetName: "Nguyen Kiem",</p><p>wards: "Ward 12",</p><p>"country": {</p><p>"code": "VN",</p><p>"name": "Vietnam"</p><p>}</p><p>}</p><p>Record the same as the address on the system.</p><p>Information line. For example:</p><p>\[</p><p>{ name: "Beef combo", // product name quantity: 1, // quantity typeDiscount: 1, (0: cash, 1: percent) // type</p><p>of discount discount: 10, // discount amount or % discount value: 1000, // Product price productIdApiRing: “1”, // product id note: "Grilled beef" // Note,</p> |
|                                               |                           |              | <p>code: “Sku” // Product code</p><p>}</p><p>]</p><p>Note:</p><p>- The combo name and product in the combo must match the corresponding combo and product name on the system.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| value                                         | number                    |              | Value of the transaction. If there is no value, the system will calculate the value of the transaction according to the price on the system.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| receiverNote                                  | string                    |              | Delivery notes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| description                                   | string                    |              | Transaction description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| stage                                         | string                    |              | Transaction status                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| branch                                        | string                    |              | Store or branch name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| cusFields                                     | array                     |              | <p>AntCRM custom fields.</p><p>\[</p><p>{ name: "Shipping unit", value: “Fast delivery”</p><p>}</p><p>]</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| shipping\_cost                                | Number                    |              | Shipping Fee                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

Results returned:

HTTP Response Code: 200

Response:

{

"success": 1,

"number”: \[9457, 9458] (antcrm transaction id) }

### 3. Product API

1. List of products or details of a product via code on Ant CRM

URL: /products

Method: GET

Content-Type: application/json

| **Parameters** | **Type** | **Required** | **Explain**                                                                                                                                           |
| -------------- | -------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| code           | string   |              | product code                                                                                                                                          |
| type           | string   |              | Product type. If it is a combo, then the type is passed as combo, and for individual products, the type is product. If not passed, all will be taken. |
| page           | number   |              | Page number, maximum 20 products per page                                                                                                             |
| limit          | number   |              | Number of records per page                                                                                                                            |

Results returned: HTTP Response Code: 200

Response:

\[{ value: "",

name: "test", code: “3609”, productIdApiRing: “”,

\_id: “” }]

1. Add products URL: /products

Method: POST

Content-Type: application/json

| **Parameters**   | **Type** | **Required** | **Explain**                                             |
| ---------------- | -------- | ------------ | ------------------------------------------------------- |
| name             | string   | AND          | Product's name                                          |
| code             | string   | AND          | Product code on CRM                                     |
| productIdApiRing | string   | AND          | Product code                                            |
| value            | string   |              | Amount of money                                         |
| canEdit          | Boolean  |              | Can the product price be updated when placing an order? |

Results returned:

HTTP Response Code: 200

Response:

{

"success": 1,

"code”: 9457 (product code on antcrm) }

1. Repair products

URL: /products

Method: PUT

Content-Type: application/json

| **Parameters**   | **Type** | **Required** | **Explain**                                             |
| ---------------- | -------- | ------------ | ------------------------------------------------------- |
| name             | string   |              | Product's name                                          |
| code             | string   |              | Product code on CRM                                     |
| productIdApiRing | string   | AND          | Product code                                            |
| value            | string   |              | Amount of money                                         |
| canEdit          | Boolean  |              | Can the product price be updated when placing an order? |

Results returned:

HTTP Response Code: 200

Response:

{

"success": 1,

"code”: 9457 (product code on antcrm) }

1. Delete product

URL: /products

Method: DELETE

Content-Type: application/json

| **Parameters**   | **Type** | **Required** | **Explain** |
| ---------------- | -------- | ------------ | ----------- |
| productIdApiRing | string   | AND          |             |

Results returned:

HTTP Response Code: 200

Response:

{

"success": 1

}

### 4. API ticket

a. List of tickets or details of a ticket via id on Ant CRM

URL: /tickets

Method: GET

Content-Type: application/json

| **Parameters** | **Type** | **Required** | **Explain**                                   |
| -------------- | -------- | ------------ | --------------------------------------------- |
| TicketId       | string   |              | Id of ticket                                  |
| page           | number   |              | Page number, maximum 20 transactions per page |
| limit          | number   |              | Number of records per page                    |

Results returned: HTTP Response Code: 200

Response:

\[{

SLA: "", TicketId: 17464, assignedTo: "<thong.nguyen@antbuddy.com>", group: “”, category: “”, resolutionTypeOb: “”, contact: {}, cusFields: \[] deal: {}, files: \[]

priority: "Medium" status: "Assigned" summary: "\<p>test\</p>" title: "\[Phone] Clearance test", createdAt: “”, // Ticket creation time updatedAt: “” // Ticket update time

}]

1. Add tickets

URL: /tickets

Method: POST

Content-Type: application/json

| **Parameters**   | **Type** | **Required** | **Explain**                                                                                                                                                                                                                                                        |
| ---------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| title            | string   | AND          | Ticket name                                                                                                                                                                                                                                                        |
| ticketIdApiRing  | string   |              | Ticket code                                                                                                                                                                                                                                                        |
| summary          | string   |              | Summary/Summary                                                                                                                                                                                                                                                    |
| priority         | string   |              | Priority. Default: Medium                                                                                                                                                                                                                                          |
| SLA              | string   | AND          | Sla                                                                                                                                                                                                                                                                |
| contact          | object Y | Y            | <p>{</p><p>“id”: “661ca720f70843211b05712a” //</p><p>Customer id code If yes, it is not required.</p><p>“emails”: \[{type: “Work”, value:</p><p>“<xyz@example.com>”}], “name”: “thong”, // required</p><p>“phones”: \[{type: “Work”, value: “023232”}]</p><p>}</p> |
| deal             | object   |              |                                                                                                                                                                                                                                                                    |
| group            | string   |              |                                                                                                                                                                                                                                                                    |
| category         | string   |              |                                                                                                                                                                                                                                                                    |
| status           | string   |              |                                                                                                                                                                                                                                                                    |
| resolutionTypeOb | string   |              |                                                                                                                                                                                                                                                                    |
| files            | array    |              |                                                                                                                                                                                                                                                                    |
| cusFields        | array    |              | <p>AntCRM custom fields.</p><p>\[</p><p>{ name: "Shipping</p><p>unit",</p><p>value: “Fast delivery”</p><p>}</p><p>]</p>                                                                                                                                            |

Results returned:

HTTP Response Code: 200

Response:

{

"success": 1,

"TicketId”: 9457 (ticket id on antcrm) }

1. Edit tickets

URL: /tickets

Method: PUT

Content-Type: application/json

| **Parameters**   | **Type** | **Required** | **Explain**                                                                                                             |
| ---------------- | -------- | ------------ | ----------------------------------------------------------------------------------------------------------------------- |
| TicketId         | string   | AND          |                                                                                                                         |
| title            | string   |              | Ticket name                                                                                                             |
| summary          | string   |              | Summary/Summary                                                                                                         |
| priority         | string   |              | Priority                                                                                                                |
| SLA              | string   |              |                                                                                                                         |
| deal             | object   |              |                                                                                                                         |
| category         | string   |              |                                                                                                                         |
| status           | string   |              |                                                                                                                         |
| resolutionTypeOb | string   |              |                                                                                                                         |
| filed            | array    |              |                                                                                                                         |
| cusFields        | array    |              | <p>AntCRM custom fields.</p><p>\[</p><p>{ name: "Shipping</p><p>unit",</p><p>value: “Fast delivery”</p><p>}</p><p>]</p> |

Results returned:

HTTP Response Code: 200

Response:

{

"success": 1,

"number”: 9457 (id of transaction on antcrm) }

1. Delete tickets

URL: /tickets

Method: DELETE

Content-Type: application/json

| **Parameters** | **Type** | **Required** | **Explain**         |
| -------------- | -------- | ------------ | ------------------- |
| TicketId       | string   | AND          | ticket id on antcrm |

Results returned: HTTP Response Code: 200

Response:

{

"success": 1

}

### 5. Point accumulation API

1. Point accumulation history

URL: /history-point?type=point

Method: GET

Content-Type: application/json

| **Parameters**     | **Type** | **Required** | **Explain**                              |
| ------------------ | -------- | ------------ | ---------------------------------------- |
| createdAtRangeFrom | number   |              | Start time                               |
| createdAtRangeTo   | number   |              | End time                                 |
| phone              | String   |              | Customer phone number                    |
| email              | String   |              | Customer email                           |
| page               | number   |              | Page number, maximum 20 records per page |

Results returned:

HTTP Response Code: 200

Response:

\[{

"type": 1, // cumulative type

"score": 100, // accumulated points

"status": 1, // accumulated status (success: 1, failure: 0)

"product": {

"code": "TIVI01", // cumulative product code

"name": "TV", // cumulative product name

"id": "64d9f28b2b3ba308b322c710"

},

"contact": {

"phones": \[

{

"type": "Work",

"\_id": "64db290a7796fe24bfe876a8",

"value": "0867123456"

}

],

"name": "Garnacho",

"emails": \[

{

"type": "Work",

"\_id": "64db290a7796fe24bfe876a9",

"value": "<garnacho@gmail.com>"

}

],

"lastname": "",

"customerId": 475,

"id": "64db290a7796fe24bfe876a7"

},

"org": "62c10674cbe832bc9245a5b8",

"code": "TIVInpmx8b98pfg", // cumulative code

"serialNumber": "npmx8b98pfg", // serial number tích luỹ

"createdAt": 1692084490615, // accumulated time

"id": "64db290a7796fe24bfe876b4" }]

1. Accumulate points

URL: /accumulate

Method: POST

Content-Type: application/json

| **Parameters** | **Type** | **Required** | **Explain**                                                                                                                                                                                                                                                                    |
| -------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| code           | string   | AND          | Cumulative code                                                                                                                                                                                                                                                                |
| data           | object   | AND          | <p>{</p><p>“emails”: \[{type: “Work”, value:</p><p>“<xyz@example.com>”}], // customer email to redeem gift</p><p>“name”: “thong”, // name of customer redeeming gift</p><p>“phones”: \[{type: “Work”, value: “023232”}] // phone number of customer redeeming gift</p><p>}</p> |

Results returned: HTTP Response Code: 200

Response:

{

"success": 1, }

### 6. Redeem API

1. Point accumulation history

URL: /history-point

Method: GET

Content-Type: application/json

| **Parameters**     | **Type** | **Cat ch set c** | **Explain**                              |
| ------------------ | -------- | ---------------- | ---------------------------------------- |
| createdAtRangeFrom | number   |                  | Start time                               |
| createdAtRangeTo   | number   |                  | End time                                 |
| phone              | String   |                  | Customer phone number                    |
| email              | String   |                  | Customer email                           |
| page               | number   |                  | Page number, maximum 20 records per page |

Results returned:

HTTP Response Code: 200

Response:

\[{

"type": 2, // exchange type

"score": 10, // number of points used to redeem gifts

"status": 1, // redemption status (success: 1, failure: 0)

"gift": {

"code": "DAUMAY01", // gift code

"name": "Locomotive", // name of gift

"score": 10, // number of points to redeem gifts

"id": "64d9f2ec2b3ba308b322c782"

},

"contact": {

"phones": \[

{

"type": "Work",

"\_id": "64db290a7796fe24bfe876a8",

"value": "0867123456"

}

],

"name": "Garnacho",

"emails": \[

{

"type": "Work",

"\_id": "64db290a7796fe24bfe876a9",

"value": "<garnacho@gmail.com>"

}

],

"customerId": 475, // contact id on CRM

"id": "64db290a7796fe24bfe876a7"

},

"org": "62c10674cbe832bc9245a5b8",

"createdAt": 1692085265818, // redemption time

"id": "64db2c11cbad5f4fdd254567" }]

1. Accumulate points URL: /redeem

Method: POST

Content-Type: application/json

| **Parameters** | **Type** | **Required** | **Explain**                                                                                                                                     |
| -------------- | -------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| code           | string   | AND          | Gift code code                                                                                                                                  |
| data           | object   | AND          | <p>{</p><p>“email”: “<xyz@example.com>”, // email of customer redeeming gift “phone”: “023232” // phone number of customer redeeming gift }</p> |

Results returned: HTTP Response Code: 200

Response:

{

"success": 1,

}

### 7. API segment

URL: /segments/set-contact

Method: POST

Content-Type: application/json Limit 100 contacts per request

Body: { contacts: \[{customer data A}, {customer data B}], segmentId: “CRM segment id”

}

| **Parameters**    | **Type** | **Required** | **Explain**                                                                                                                                                                                                                          |
| ----------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| name              | string   | AND          | Customer name                                                                                                                                                                                                                        |
| customerIdApiRing | string   | N            | Customer's code                                                                                                                                                                                                                      |
| type              | string   |              | <p>Customer Type. (0: contact, 1: account). Default is</p><p>0</p>                                                                                                                                                                   |
| contactType       | string   |              | “lead" or “customer". Default is lead                                                                                                                                                                                                |
| dateOfBirth       | string   |              | Date of birth. (“March 15, 2000”)                                                                                                                                                                                                    |
| gender            | string   |              | Sex. (0: Male, 1: Female, 2: Other). Default is 2                                                                                                                                                                                    |
| dateOfBirth       | string   |              | Date of birth. (“March 15, 2000”)                                                                                                                                                                                                    |
| gender            | string   |              | Sex. (0: Male, 1: Female, 2: Other). Default is 2                                                                                                                                                                                    |
| addresses         | array    |              | <p>Customer address.</p><p>\[{ city: "Ho Chi Minh City", state: "Tan Binh District", street: "319", (house number) streetName: "Nguyen Kiem", wards: "Ward 12",</p><p>"country": {</p><p>"code": "VN",</p><p>"name": "Vietnam" }</p> |
|                   |          |              | <p>}]</p><p>Record the same as the address on the system.</p>                                                                                                                                                                        |
| phone             | array    |              | <p>Phone number.</p><p>\[{type:”Work”, value: “01223223”} ]</p>                                                                                                                                                                      |
| emails            | array    |              | <p>Phone number.</p><p>\[{type:”Work”, value: “01223223”} ]</p>                                                                                                                                                                      |
| industry          | string   |              | Industry (“Real Estate”)                                                                                                                                                                                                             |
| in the            | array    |              | <p>Social network.</p><p>\[{protocol: “Facebook”, “value”: “<https://abc.com”>}]</p>                                                                                                                                                 |
| bgInfo            | string   |              | Note. (“VIP Customer”)                                                                                                                                                                                                               |
| stage             | string   |              | Status. ("A new customer")                                                                                                                                                                                                           |
| tags              | string   |              | <p>Label.</p><p>\[ “Not yet contacted”, “Contacted” ]</p>                                                                                                                                                                            |
| sourceContact     | string   |              | Contact source. ("Advertisement")                                                                                                                                                                                                    |
| responsibleStaff  | string   |              | Email of the person in charge. (“<nhanvien1@gmail.com>”)                                                                                                                                                                             |
| cusFields         | array    |              | <p>Custom fields on AntCRM.</p><p>\[</p><p>{ name: "Shipping unit", value: “Fast delivery”</p><p>}</p><p>]</p>                                                                                                                       |

Results returned:

HTTP Response Code: 200

Response: Ok

8\. API get list of telesales

URL: /telesales

Method: GET

| **Parameters** | **Type** | **Cat ch set c**         | **Explain**                                                                    |
| -------------- | -------- | ------------------------ | ------------------------------------------------------------------------------ |
| campaignId     | string   | <p>A</p><p>N</p><p>D</p> | Campaign id                                                                    |
| survey         | Boolean  |                          | If survey is true, only telesales with values in the survey form will be taken |
| dateStart      | string   |                          | Telesale creation time. For example:2024-03-13T06:24:20.673Z                   |
| dateEnd        | string   |                          | Telesale creation time. For example:2024-03-19T06:24:20.673Z                   |

page Number Serial number of the page. limit Number Number of records per page. (Maximum 100 records)

Results returned:

{

"success": true,

"data": \[], // list of records

"total": 2,

"limit": 20

}

**Sample data:**

curl --location

'<https://apiring.antbuddy.com/telesales?campaignId=65f8faf6f829af63ddc831dc\\&survey=true\\&dateStart=202> 4-03-13T06%3A24%3A20.673Z\&dateEnd=2024-03-19T06%3A24%3A20.673Z' \ --header 'apikey:

### 9. API get list of telecalls

URL: /telecalls

Method: GET

| **Parameters** | **Type** | **Required** | **Explain**                                            |
| -------------- | -------- | ------------ | ------------------------------------------------------ |
| campaignId     | string   | AND          | Campaign id                                            |
| dateStart      | string   |              | Call making time. For example:2024-03-13T06:24:20.673Z |
| dateEnd        | string   |              | Call making time. For example:2024-03-19T06:24:20.673Z |
| page           | Number   |              | Page number.                                           |
| limit          | Number   |              | Number of records per page. (Maximum 100 records)      |

Results returned:

{

"success": true,

"data": \[], // list of records

"total": 2,

"limit": 20

}

**Sample data:** curl --location

'<https://apiring.antbuddy.com/telesales?campaignId=65f8faf6f829af63ddc831dc\\&survey=true\\&dateStart=202>

4-03-13T06%3A24%3A20.673Z\&dateEnd=2024-03-19T06%3A24%3A20.673Z' \ --header 'apikey:'

### 10.API get campaign list

URL: /telecalls

Method: GET

| **Parameters** | **Type** | **Required** | **Explain**                                            |
| -------------- | -------- | ------------ | ------------------------------------------------------ |
| dateStart      | string   |              | Call making time. For example:2024-03-13T06:24:20.673Z |
| dateEnd        | string   |              | Call making time. For example:2024-03-19T06:24:20.673Z |
| page           | Number   |              | Page number.                                           |
| limit          | Number   |              | Number of records per page. (Maximum 100 records)      |

Results returned:

{

"success": true,

"data": \[], // list of records

"total": 2,

"limit": 20

}

**Curl sample:** curl --location '<https://apiring.antbuddy.com/campaigns?limit=300\\&page=1>' \\

\--header 'apikey:' \\

\--data ''

### 11.API get rating list

URL: /rating

Method: GET

| **Parameters** | **Type** | **Required** | **Explain**                                                            |
| -------------- | -------- | ------------ | ---------------------------------------------------------------------- |
| dateStart      | string   |              | Rating time. For example:2024-03-13T06:24:20.673Z                      |
| dateEnd        | string   |              | Ratingi time. For example:2024-03-19T06:24:20.673Z                     |
| page           | Number   |              | Page number.                                                           |
| limit          | Number   |              | <p>Number of records per page. (Maximum</p><p>100 records)</p>         |
| type           | String   |              | <p>Rating source</p><p>VD: ticket, deal, call, omni, other</p>         |
| rating\_score  | Number   |              | <p>Rating score VD:</p><p>ZNS/EMAIL/ECOM/CALL/ZALO/F</p><p>ACEBOOK</p> |

Results returned:

{

"success": true,

"data": \[], // list of records

"total": 2,

"limit": 20

}

**Sample data:**

**{**

**"success": true,**

**"data": \[**

**{**

**"\_id": "6613a508dc31dd206d0239b5", "org": "62c10674cbe832bc9245a5b8",**

**"session": {**

**"\_id": "66139e5904bf311bf963a979",**

**"channel": "ZALO",**

**"normalize": "nguyen-dinh-minh-thong",**

**"isDone": true,**

**"rating\_value": 3,**

**"rating\_comment": "",**

**"conversationId": "36737553777762229502111865670400779963",**

**"conversationName": "RiskEhn Dinh Minh Thong",**

**"snippet": "test adidas dawda", "senderName": "RiskEhn Dinh Minh Thong",**

**"senderAvatar": "<https://s120-ava-talk.zadn.vn/1/e/4/8/0/120/16d1cfb17288a106fe9f0fe847173314.jpg>", "conversationAvatar": "<https://s120-ava-talk.zadn.vn/1/e/4/8/0/120/16d1cfb17288a106fe9f0fe847173314.jpg>",**

**"pageId": "3673755377776222950",**

**"doneAt": 1712738571708**

**},**

**"contact": {**

**"\_id": "66139e5804bf311bf963a975",**

**"contactType": "lead",**

**"type": 0,**

**"lastname": "",**

**"gender": 2,**

**"dateOfBirth": null,**

**"dateOfBirth2": "",**

**"name": "RiskEhn Dinh Minh Thong",**

**"addresses": \[**

**{**

**"type": "Work",**

**"street": "",**

**"city": "",**

**"state": "",**

**"zip": "",**

**"\_id": "66139e5804bf311bf963a976",**

**"country": {**

**"code": "VN",**

**"name": "Vietnam"**

**}**

**}**

**],**

**"phones": \[],**

**"emails": \[],**

**"leadId": 2964 },**

**"rating\_score": 3,**

**"comment": null,**

**"rating\_time": 1712563464292,**

**"type": "omni",**

**"source": "ZALO",**

**"\_\_in": 0**

**},**

**{**

**"\_id": "6613a4541da91b1fd51d67de", "org": "62c10674cbe832bc9245a5b8",**

**"session": {**

**"\_id": "66139e5904bf311bf963a979", // CRM customer id code**

**"channel": "ZALO",**

**"normalize": "nguyen-dinh-minh-thong",**

**"isDone": true,**

**"rating\_value": 3,**

**"rating\_comment": "",**

**"conversationId": "36737553777762229502111865670400779963",**

**"conversationName": "RiskEhn Dinh Minh Thong",**

**"snippet": "test adidas dawda", "senderName": "RiskEhn Dinh Minh Thong",**

**"senderAvatar": "<https://s120-ava-talk.zadn.vn/1/e/4/8/0/120/16d1cfb17288a106fe9f0fe847173314.jpg>", "conversationAvatar": "<https://s120-ava-talk.zadn.vn/1/e/4/8/0/120/16d1cfb17288a106fe9f0fe847173314.jpg>",**

**"pageId": "3673755377776222950",**

**"doneAt": 1712738571708**

**},**

**"contact": {**

**"\_id": "66139e5804bf311bf963a975",**

**"contactType": "lead",**

**"type": 0,**

**"lastname": "",**

**"gender": 2,**

**"dateOfBirth": null,**

**"dateOfBirth2": "",**

**"name": "RiskEhn Dinh Minh Thong",**

**"addresses": \[**

**{**

**"type": "Work",**

**"street": "",**

**"city": "",**

**"state": "",**

**"zip": "",**

**"\_id": "66139e5804bf311bf963a976",**

**"country": {**

**"code": "VN",**

**"name": "Vietnam"**

**}**

**}**

**],**

**"phones": \[],**

**"emails": \[],**

**"leadId": 2964 },**

**"rating\_score": 5,**

**"comment": null,**

**"rating\_time": 1712563284246,**

**"type": "omni",**

**"source": "ZALO",**

**"\_\_in": 0**

**},**

**{**

**"\_id": "6613a30300e6c11e1173dce4",**

**"org": "62c10674cbe832bc9245a5b8",**

**"session": {**

**"\_id": "66139e5904bf311bf963a979",**

**"channel": "ZALO",**

**"normalize": "nguyen-dinh-minh-thong",**

**"isDone": true,**

**"rating\_value": 3,**

**"rating\_comment": "",**

**"conversationId": "36737553777762229502111865670400779963",**

**"conversationName": "RiskEhn Dinh Minh Thong",**

**"snippet": "test adidas dawda", "senderName": "RiskEhn Dinh Minh Thong",**

**"senderAvatar": "<https://s120-ava-talk.zadn.vn/1/e/4/8/0/120/16d1cfb17288a106fe9f0fe847173314.jpg>", "conversationAvatar": "<https://s120-ava-talk.zadn.vn/1/e/4/8/0/120/16d1cfb17288a106fe9f0fe847173314.jpg>",**

**"pageId": "3673755377776222950",**

**"doneAt": 1712738571708**

**},**

**"contact": {**

**"\_id": "66139e5804bf311bf963a975",**

**"contactType": "lead",**

**"type": 0,**

**"lastname": "",**

**"gender": 2,**

**"dateOfBirth": null,**

**"dateOfBirth2": "",**

**"name": "RiskEhn Dinh Minh Thong",**

**"addresses": \[**

**{**

**"type": "Work",**

**"street": "",**

**"city": "",**

**"state": "",**

**"zip": "",**

**"\_id": "66139e5804bf311bf963a976",**

**"country": {**

**"code": "VN",**

**"name": "Vietnam"**

**}**

**}**

**],**

**"phones": \[],**

**"emails": \[],**

**"leadId": 2964 },**

**"rating\_score": 4,**

**"comment": null,**

**"rating\_time": 1712562947587,**

**"type": "omni",**

**"source": "ZALO",**

**"\_\_in": 0**

**}**

**],**

**"limit": 20**

**}**
