IDN SAAS saas_plat openapi analysis - nxtele/nxcloud-doc-en GitHub Wiki

Notification Analysis

Retrieve notification analysis data via API.

  • URL: https://api-idn.nxlink.ai/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 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

Query Parameters

Parameter Type Required Example 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 Page size
start_time String Yes 2024-05-01 Start date, format yyyy-MM-dd
end_time String Yes 2024-05-31 End date, format yyyy-MM-dd. Range must not exceed 6 months
dimension integer Yes 0 Dimension: 0 send method, 1 template name, 2 template language, 3 country
source integer No 0 Send method. Required when dimension=0. Values: 0 chat send, 1 bulk notification, 2 external API, 3 bot, 4 other, 6 automated notification flow
search String No key Search text. When dimension is template name or language, search by template name. When dimension is country, search by country code
channel integer Yes 2 Channel: 1 SMS, 2 WhatsApp, 3 Voice, 8 Line

Response Fields

Field Type Description
list array[data JsonObject] Result list
message string Message
code integer Result code
total integer Total count
page_number integer Page number
page_size integer Page size

data

Field Type Description
sendDate String Send date
channel integer Channel
templateName String Template name
templateLanguage String Template language
templateType String Template type
country String Country
source integer Send method. Values: 0 chat send, 1 bulk notification, 2 external API, 3 bot, 4 other, 6 automated notification flow
sendTotal Long Total sent
sent Long Sent
sentRate String Sent rate
deliver Long Delivered
deliverRate String Delivery rate
read Long Read
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 Codes

code message solution
0 Success -
-1 Failure Contact support
1000~100X Authentication error See authentication section
21058 Parameter error tenant_id is required
21059 Parameter error appkey is required
22016 Parameter error Merchant has not configured WhatsApp app
22072 Parameter error Invalid parameters
22215 Parameter error Query date range cannot exceed 6 months