SAAS Notification Analysis - nxtele/nxcloud-doc-en GitHub Wiki

Notification Analysis API

Retrieve notification analysis via the API.

  • URL: https://api.nxcloud.com/saas/openapi/analysis/query?page_number={page_number}&page_size={page_size}&start_time={start_time}&end_time={end_time}&tenant_id={tenant_id}&appkey={appkey}&dimension={dimension}&channel={channel}&source={source}&search={search}
  • Method: GET
  • Content-Type: application/json
  • Requires Authentication: Yes

Request Parameters

Header Parameters:

Parameter Type Required Example Value Description
accessKey String Yes fme2na3kdi3ki User identity key
ts String Yes 1655710885431 Current request timestamp (in milliseconds), the server allows up to 60 seconds of time difference
bizType String Yes 2 WhatsApp business type, fixed value: "2"
action String Yes mt WhatsApp business action, fixed value: "mt"
sign String Yes 6e9506557d1f289501d333ee2c365826 API request parameter signature, agreed globally

Query Parameters:

Parameter Type Required Example Value Description
tenant_id Long Yes 1 Tenant ID
appkey String Yes pem28kje Application appkey
page_number Integer Yes 1 Page number
page_size Integer Yes 10 Number of records per page
start_time String Yes Start query date Format: yyyy-MM-dd
end_time String Yes End query date Format: yyyy-MM-dd (Time range cannot exceed 6 months)
dimension Integer Yes Statistics dimension 0: Sending method, 1: Template name, 2: Template language, 3: Country
source Integer No Sending method Required when dimension is "Sending method". Sending methods: 0: Chat, 1: Group notice, 2: External API, 3: Robot, 4: Other, 6: Automatic notification flow
search String No Search content When dimension is Template name or Template language, search by template name; when dimension is Country, search by country code
channel Integer Yes Channel 1: SMS, 2: WhatsApp, 3: Voice, 8: Line

Response Parameters

Parameter Type Description
list Array[data object] Result list
message String Response message
code Integer Response code
total Integer Total count
page_number Integer Page number
page_size Integer Records per page

Data Object:

Parameter Type Description
sendDate String Sending date
channel Integer Channel
templateName String Template name
templateLanguage String Template language
templateType String Template type
country String Country
source Integer Sending method (0: Chat, 1: Group notice, 2: External API, 3: Robot, 4: Other, 6: Automatic notification flow)
sendTotal Long Total sent
sent Long Number of sent messages
sentRate String Sent rate
deliver Long Delivered messages
deliverRate String Delivery rate
read Long Read messages
readRate String Read rate
chatReply Long Replies
chatReplyRate String Reply rate

Response Example

{
    "code": 0,
    "message": null,
    "traceId": "ee0e74276ff14dd58c43512c92ed9958.316.17223233548652651",
    "total": 4,
    "page_number": 1,
    "page_size": 10,
    "list": [
        {
            "sendDate": "2024-07-30",
            "channel": 2,
            "templateName": "",
            "templateLanguage": "",
            "templateType": "",
            "country": "",
            "sendTotal": 0,
            "sent": 0,
            "sentRate": "",
            "deliver": 0,
            "deliverRate": "",
            "read": 0,
            "readRate": "",
            "chatReply": 0,
            "chatReplyRate": "",
            "source": 0
        }
    ],
    "ext": null,
    "empty": false,
    "notEmpty": true,
    "totalPages": 4
}

Response Code Explanation

Code Message Solution
0 Request successful
-1 Request failed Contact technical support for assistance
1000~100X Authentication issues Check API authentication details
21058 Parameter error tenant_id is required
21059 Parameter error appkey is required
22016 Parameter error WhatsApp application not configured for tenant
22072 Parameter error General parameter error
22215 Parameter error Query date range cannot exceed 6 months