SAAS saas_plat openapi customer_query - nxtele/nxcloud-doc-en GitHub Wiki

Query Customer List

Query customers.

  • URL: https://api-hk.nxlink.ai/saas/cdp/openapi/customers/query
  • Method: POST
  • Content-Type: application/json
  • Requires authentication: Yes

Request Parameters

Header Parameters

Parameter Type Required Example Description
accessKey String Yes fme2na3kdi3ki User identity key
ts String Yes 1655710885431 Timestamp in milliseconds. Max allowed time drift is 60 seconds.
bizType String Yes 2 WhatsApp business type, fixed value "2"
action String Yes mt WhatsApp action, fixed value "mt"
sign String Yes 6e9506557d1f289501d333ee2c365826 Signature, see common auth rules

Body Parameters

Parameter Type Required Example Description
tenant_id integer Yes 123 Tenant ID
app_key string Yes 46oKF=os App key
start_time string No 2024-05-07 00:00:00 Start time
end_time string No 2024-05-08 00:00:00 End time
tags array[data JsonObject] No - Tag IDs
his_tags array[data JsonObject] No - Historical tag IDs
source_type Integer No 1 Source: 0 unknown, 1 new, 2 Excel import, 3 customer initiated, 4 SMS blast, 5 voice blast, 6 third-party API, 7 callbot, 8 customer initiated - call center, 9 email channel, 10 form, 11 customer initiated, 12 customer initiated - Viber, 13 customer initiated - Messenger, 14 customer initiated - Instagram, 15 customer initiated - Line
name string No test First name
tags_logic_type string No and Logic for tags list: "and" / "or". Empty string if not selected
source_channel_key string No xx Source channel
sms_phone string No 8618593272678 SMS phone
whatsApp_phone string No 8618593272678 WhatsApp phone
email string No [email protected] Email
viber_phone string No 8618593272678 Viber phone
after Long No 693324 Cursor for next page
before Long No 693324 Cursor for previous page
limit Long Yes 25 Page size, 1-50
  • data fields:
Parameter Type Required Example Description
id Long Yes - Tag ID
tag_name String Yes - Tag name

Paging

Parameter Type Required Example Description
after Long Yes - Cursor at end of returned page
before Long Yes - Cursor at start of returned page
previous Long No - Cursor of previous page start. null means first page
next Long No - Cursor of next page start. null means last page
  • customers fields:
Parameter Type Required Example Description
id Long Yes 1021110718827683840 Customer ID (cursor value)
first_name String No simon First name
last_name String No kang Last name
full_name String No simon kang Full name
sms_phone String No 8618593271111 SMS phone
whatsApp_phone String No 8618593271111 WhatsApp phone
viber_phone String No 8618593271111 Viber phone
line String No xxx Line ID
messenger String No xxx Messenger ID
instagram String No xxx Instagram ID
email String No xxx Email
country String No CN Country
birthday String No 2024-08-01 Birthday
remark String No xxx Remark
source_type Integer No 1 Source (same as above)
source_channel_key string No xx Source channel
gender Integer No 0 0 female, 1 male
created_at String Yes 2024-07-19T17:29:27 Created time
updated_at String Yes 2024-07-19T17:29:27 Updated time
status Integer No 1 Status (0 disabled, 1 enabled)
whatApp_subscribe String No 1 WhatsApp subscription
sms_subscribe String No 1 SMS subscription
customize_field String No 1 Custom fields
tenant_id Long Yes 1 Tenant ID
weight Long No 1 Customer level
web String No https://example.com WebChat site URL

Request Example

Request Example

Body (application/json):

{
    "tenant_id": 123,
    "limit": 5,
    "after": 1022100838976413697,
    "whatsApp_phone": "861360301975912",
    "app_key": "8eos"
}

Response Parameters

Parameter Type Description
code Integer Result code
data JsonObject Result data
message String Message
traceId String Trace ID

Response Example

Success Example

{
    "code": 0,
    "message": null,
    "traceId": "44988d9de672422b920182d6960de0a0",
    "data": {
        "paging": {
            "after": 1021110718827683840,
            "before": 1021110718827683840,
            "previous": null,
            "next": null
        },
        "customer_list": [
            {
                "id": 1021110718827683840,
                "first_name": "Simon",
                "last_name": null,
                "full_name": "Simon",
                "sms_phone": null,
                "whatsApp_phone": "861360301975912",
                "viber_phone": null,
                "line": null,
                "messenger": null,
                "instagram": null,
                "email": null,
                "country": "CN",
                "birthday": null,
                "remark": null,
                "source_type": 3,
                "source_channel_key": "18506008399",
                "gender": null,
                "created_at": "2024-07-19T17:29:27",
                "status": 1,
                "updated_at": "2024-07-30T17:56:39",
                "web": "https://www.example.com",
                "tags": [
                    {
                        "id": 27237,
                        "user_id": 195,
                        "tenant_id": 123,
                        "group_id": 0,
                        "group_name": null,
                        "tag_name": "test",
                        "note": "",
                        "created_at": "2023-02-15T16:45:30",
                        "updated_at": "2023-02-15T16:45:30",
                        "customer_id": 1021110718827683840
                    }
                ],
                "whatApp_subscribe": "1",
                "sms_subscribe": "1",
                "customize_field": "{\"customize_4_52\": [\"1\"]}",
                "tenant_id": 123,
                "weight": 5
            }
        ]
    }
}