發信數據

最新更新:2023-04-10

發送數據統計(每天)

按天統計的短信數據

URL

https://sms.api.engagelab.cc/v1/stats_day
          https://sms.api.engagelab.cc/v1/stats_day

        
此代碼塊在浮窗中顯示

HTTP請求方式

GET
          GET

        
此代碼塊在浮窗中顯示

Request-Headers

Header 類型 必須 說明
Authorization string true Basic base64(sms_user:sms_key)

參數說明

參數 類型 必須 說明
time_zone string 時區。默認時區:+8
template_ids string 多個模板ID,用;分開, 如:template_ids=1;2;3 ,最大支持10個
sms_users string 獲取指定 SMS_USER 的統計數據, 多個 SMS_USER 用;分開, 如:sms_users=a;b;c ,最大支持10個
label_ids string 短信標籤ID列表,用;分開,如label_ids=123456;456789 ,最大支持10個
start_date string 開始日期,格式為 yyyy-MM-dd
end_date string 結束日期, 格式為 yyyy-MM-dd
msg_type string 短信類型,2表示國際短信
aggregate_by string 是否聚合,0不聚合,1聚合,默認為0

注意:

  1. 查詢的天數不超過90天
  2. 當 aggregate_by 為 1 時, 會按照 msg_type 做數據聚合;當 aggregate_by 為 0 時, 不做數據聚合

請求示例

curl -X GET "https://sms.api.engagelab.cc/v1/data/stats_day?start_date=2022-11-20&msg_types=0" --header "Authorization: Basic <<YOUR_SMS_KEY_HERE>>"
          curl -X GET "https://sms.api.engagelab.cc/v1/data/stats_day?start_date=2022-11-20&msg_types=0" 
--header "Authorization: Basic <<YOUR_SMS_KEY_HERE>>"

        
此代碼塊在浮窗中顯示

響應說明

字段 說明
send_date 發送日期
msg_type 短信類型
sms_user SMS_USER
template_id 短信模板ID
label_id 標籤ID
targets 目標總數
sent 發送數量
process_failed 處理失敗數量
delivered 送達數量
send_failed 發送失敗數量
wait_result 待回執數量
billing_count 計費數量
process_failed_percent 處理失敗比例
delivered_percent 送達比例
send_failed_percent 發送失敗比例
wait_result_percent 待回執比例

響應示例

不聚合情況下

{ "result" : [{ "send_date" : "2016-09-27", "msg_type" : "2", "sms_user" : "sms_user", "template_id" : 11, "label_id" : 110, "targets" : 1, "sent" : 0, "process_failed" : 0, "delivered" : 1, "send_failed" : 0, "wait_result" : 0, "billing_count" : 2, "process_failed_percent" : 0.0, "delivered_percent" : 0, "send_failed_percent" : 0, "wait_result_percent" : 0 } ], count:1 }
          {
        "result" : [{
                "send_date" : "2016-09-27",
                "msg_type" : "2",
                "sms_user" : "sms_user",
                "template_id" : 11,
                "label_id" : 110,
                "targets" : 1,
                "sent" : 0,
                "process_failed" : 0,
                "delivered" : 1,
                "send_failed" : 0,
                "wait_result" : 0,
                "billing_count" : 2,
                "process_failed_percent" : 0.0,
                "delivered_percent" : 0,
                "send_failed_percent" : 0,
                "wait_result_percent" : 0
            }
        ],
        count:1
}

        
此代碼塊在浮窗中顯示

聚合情況下

{ "result" : { "msg_type" : "2", "targets" : 1, "sent" : 0, "process_failed" : 0, "delivered" : 1, "send_failed" : 0, "wait_result" : 0, "billing_count" : 2, "process_failed_percent" : 0.0, "delivered_percent" : 0.0, "send_failed_percent" : 0.0, "wait_result_percent" : 0.0 } } }
          {
    "result" : {
              "msg_type" : "2",
              "targets" : 1,
              "sent" : 0,
              "process_failed" : 0,
              "delivered" : 1,
              "send_failed" : 0,
              "wait_result" : 0,
              "billing_count" : 2,
              "process_failed_percent" : 0.0,
              "delivered_percent" : 0.0,
              "send_failed_percent" : 0.0,
              "wait_result_percent" : 0.0
        }
    }
}

        
此代碼塊在浮窗中顯示

處理失敗統計

查詢處理失敗的分類統計信息

URL

https://sms.api.engagelab.cc/v1/stats/process_failed
          https://sms.api.engagelab.cc/v1/stats/process_failed

        
此代碼塊在浮窗中顯示

HTTP請求方式

GET
          GET

        
此代碼塊在浮窗中顯示

Request-Headers

Header 類型 必須 說明
Authorization String true Basic base64(smsUser:smsKey)

參數說明

參數 類型 必須 說明
time_zone string 時區,默認時區:+8
sms_users string 獲取指定 SMS_USER 的統計數據, 多個 SMS_USER 用;分開, 如:sms_users=a;b;c,最大支持10個
start_date string 開始日期,格式為 yyyy-MM-dd
end_date string 結束日期,格式為 yyyy-MM-dd
msg_type string 業務類型,2表示國際短信,默認2
label_ids string 短信標籤ID列表,用;分開,如 label_ids=123456;456789,最大支持10個
template_ids string 多個模板ID,用;分開,如:template_Ids=1;2;3,最大支持10個
aggregate_by string 是否聚合,0不聚合,1聚合,默認為0

注意:

  1. 查詢的天數不超過90天
  2. 當 aggregate_by 為 1 時, 會按照 msg_type 做數據聚合;當 aggregate_by 為 0 時, 不做數據聚合

請求示例

curl -X GET "https://sms.api.engagelab.cc/v1/stats/process_failed?start_date=2022-11-20&msgTypeStr=0" --header "Authorization: Basic <<YOUR_SMS_KEY_HERE>>"
          curl -X GET "https://sms.api.engagelab.cc/v1/stats/process_failed?start_date=2022-11-20&msgTypeStr=0" 
--header "Authorization: Basic <<YOUR_SMS_KEY_HERE>>"

        
此代碼塊在浮窗中顯示

響應說明

字段 說明
send_date 發送日期
label_id 標籤ID
msg_type 短信類型
sms_user SMS_USER
template_id 短信模板ID
global_block 全局攔截個數
partial_block 局部攔截個數
unsubscribe 取消訂閱個數
keyword_block 關鍵詞過濾個數
variable_error 替換變量錯誤個數
content_error 內容不符合規範個數
frequency_overrun 頻率超限個數
other 其他個數

響應示例

不聚合情況下

{ "result" : [{ "send_date" : "2016-09-09", "label_id" : 110, "msg_type" : "2", "sms_user":"sms", "template_id" : 122, "global_block": 133 "partial_block" : 0, "unsubscribe" : 0, "keyword_block" : 0, "variable_error" : 0, "content_error" : 0, "frequency_overrun" : 0, "other" : 0 } ], count:1 }
          {
    "result" : [{
                "send_date" : "2016-09-09",
                "label_id" : 110,
                "msg_type" : "2",
                "sms_user":"sms",
                "template_id" : 122,
                "global_block": 133
                "partial_block" : 0,
                "unsubscribe" : 0,
                "keyword_block" : 0,
                "variable_error" : 0,
                "content_error" : 0,
                "frequency_overrun" : 0,
                "other" : 0
            }
        ],
        count:1
}

        
此代碼塊在浮窗中顯示

聚合情況下

{ "result" : { "msg_type" : "2", "global_block": 133 "partial_block" : 0, "unsubscribe" : 0, "keyword_block" : 0, "variable_error" : 0, "content_error" : 0, "frequency_overrun" : 0, "other" : 0 } }
          {
    "result" : {
                "msg_type" : "2",
                "global_block": 133
                "partial_block" : 0,
                "unsubscribe" : 0,
                "keyword_block" : 0,
                "variable_error" : 0,
                "content_error" : 0,
                "frequency_overrun" : 0,
                "other" : 0
        }
}

        
此代碼塊在浮窗中顯示

发送失败统计

查询发送失败的分类统计信息

URL

https://sms.api.engagelab.cc/v1/stats/send_failed
          https://sms.api.engagelab.cc/v1/stats/send_failed

        
此代碼塊在浮窗中顯示

HTTP請求方式

GET
          GET

        
此代碼塊在浮窗中顯示

Request-Headers

Header 類型 必須 說明
Authorization String true Basic base64(sms_user:sms_key)

參數說明

參數 類型 必須 說明
time_zone string 時區,默認時區:+8
sms_users string 獲取指定 SMS_USER 的統計數據, 多個 SMS_USER 用;分開, 如:sms_users=a;b;c,最大支持10個
start_date string 開始日期, 格式為 yyyy-MM-dd
end_date string 結束日期, 格式為 yyyy-MM-dd
msg_type string 短信類型,2表示國際短信
label_ids string 短信標籤ID列表,用;分開,如 label_Ids=123456;456789 ,最大支持10個
template_ids string 多個模板ID,用;分開, 如:template_Ids=1;2;3 ,最大支持10個
aggregate_by string 是否聚合, 0不聚合,1聚合,默認為0

注意:

  1. 查詢的天數不超過90天
  2. 當 aggregate_by 為 1 時, 會按照 msg_type 做數據聚合;當 aggregate_by 為 0 時, 不做數據聚合

請求示例

curl -X GET "https://sms.api.engagelab.cc/v1/data/sendFailed?start_date=2022-11-20&msg_type=0" --header "Authorization: Basic <<YOUR_SMS_KEY_HERE>>"
          curl -X GET "https://sms.api.engagelab.cc/v1/data/sendFailed?start_date=2022-11-20&msg_type=0" 
--header "Authorization: Basic <<YOUR_SMS_KEY_HERE>>"

        
此代碼塊在浮窗中顯示

響應說明

字段 說明
send_date 發送日期
label_id 標籤ID
msg_type 短信類型
sms_user SMS_USER
template_id 短信模板ID
empty 空號個數
out_of_service 停機個數
blacklist 黑名單個數
busy 佔線個數
no_answer 無人接聽個數
interception 攔截個數
break_down 手機故障個數
not_in_service 不在服務區個數
power_off 關機個數
other 其他

響應示例

不聚合情況下

{ "result" : [ { "send_date" : "2016-09-09", "label_id" : 110, "msg_type" : "2", "sms_user":"sms", "template_id" : 10, "empty" : 0, "out_of_service" : 3, "blacklist" : 0, "busy" : 0, "no_answer" : 0, "interception" : 0, "break_down" : 0, "not_in_service" : 0, "power_off" : 0, "other" : 2 } ], "count":1 } }
          {
    "result" :  [
       {
                "send_date" : "2016-09-09",
                "label_id" : 110,
                "msg_type" : "2",
                "sms_user":"sms",
                "template_id" : 10,
                "empty" : 0,
                "out_of_service" : 3,
                "blacklist" : 0,
                "busy" : 0,
                "no_answer" : 0,
                "interception" : 0,
                "break_down" : 0,
                "not_in_service" : 0,
                "power_off" : 0,
                "other" : 2
            }
        ],
        "count":1
    }
}

        
此代碼塊在浮窗中顯示

聚合情况下

{ "result" : { "msg_type" : "2", "empty" : 0, "out_of_service" : 3, "blacklist" : 0, "busy" : 0, "no_answer" : 0, "interception" : 0, "break_down" : 0, "not_in_service" : 0, "power_off" : 0, "other" : 2 } }
          {
    "result" : {
                "msg_type" : "2",
                "empty" : 0,
                "out_of_service" : 3,
                "blacklist" : 0,
                "busy" : 0,
                "no_answer" : 0,
                "interception" : 0,
                "break_down" : 0,
                "not_in_service" : 0,
                "power_off" : 0,
                "other" : 2
        }
    
}

        
此代碼塊在浮窗中顯示
在文档中心打开