SMS Batch Query - nxtele/nxcloud-doc-en GitHub Wiki

Brief Description:

  • SMS batch query. Only support query recent 31 Days of SMS Record,Please Timely Query. If Need Full records, please use webhook to get all callbacks and save it to your database.

Request Method:

  • URL:http://api2.nxcloud.com/api/sms/getSmsCdr
  • Method:POST
  • Content-Type:application/x-www-form-urlencoded

Parameters:

Parameters Name Required Type Description
appkey Yes string SMS Application appkey
secretkey Yes string SMS Application secretkey
date Yes string Date(yyyyMMdd)
page_size Yes string Quantity (Less Than1000Items)
page Yes string StartPage
sort_type No string SortType: 0=Ascending,1=Descending;DefaultIs0

Request Example:

curl --location --request POST 'http://api2.nxcloud.com/api/sms/getSmsCdr' \
--data-urlencode 'appkey=asdf' \
--data-urlencode 'secretkey=qwer' \
--data-urlencode 'date=20230202' \
--data-urlencode 'page_size=10' \
--data-urlencode 'page=1'

ReturnExample

{
	"code": "0",
	"info": {
			"total": 1119,
			"page": 112,
			"pageSize": 2,
			"rows": [
				{
					"senderid": "",
					"body": "hello sms test 001.",
					"phone": "62833935195",
					"msgid": "5cd1397f-f3b2-95de-ed5e-27d5f39a230d",
					"dr_status": "Successful",
					"billing_size": 2,
					"billing_price": 0.09,
					"date": "2019-06-15 23:40:00",
					"dr_time": "2019-06-15 23:42:00",
					"billing_status": "Yes",
					"network": 893,
					"dr":"DELIVRD"
				},
				{
					"senderid": "",
					"body": "hello sms test 002.",
					"phone": "62844049494",
					"msgid": "f76bc33281124f8aa8bca33ce54b01ad",
					"dr_status": "Successful",
					"billing_size": 2,
					"billing_price": 0.09,
					"date": "2019-06-15 23:50:04",
					"dr_time": "2019-06-15 23:53:00",
					"billing_status": "Yes",
					"network": 791,
					"dr":"DELIVRD"
				}
				]
		}
}

Response Description

Parameter Name Type Description
code string status code, 0 for success
senderid string sender / source address
body string content
phone string phone number, WithCountry Code, may not be the same format as commited
msgid string Message Id
dr_status string SubmitStatus
billing_size number billing size
billing_price number billing Price
date string SendDate
dr_time string drDate
billing_status string BillingStatus
network string Operator
dr string Delivery report

Remarks

  • Error Code
code Description
0 success
1 params invalid
2 keys invalid
3 page_size or page_index invalid
4 page_size or page_index invalid
5 api request times invalid