標籤
最新更新:2023-04-10
通過以下接口可以對短信標籤進行查詢,添加修改和刪除操作。
查詢單個標籤
返回短信標籤的基本信息
URL
https://sms.api.engagelab.cc/v1/labels/{label_id}
https://sms.api.engagelab.cc/v1/labels/{label_id}
此代碼塊在浮窗中顯示
HTTP請求方式
GET
GET
此代碼塊在浮窗中顯示
Request-Headers
Header | 類型 | 必須 | 說明 |
---|---|---|---|
Authorization | string | true | Basic base64(sms_user:sms_key) |
請求示例
curl -X GET "https://sms.api.engagelab.cc/v1/labels/598802"
--header "Authorization: Basic <<YOUR_SMS_KEY_HERE>>"
curl -X GET "https://sms.api.engagelab.cc/v1/labels/598802"
--header "Authorization: Basic <<YOUR_SMS_KEY_HERE>>"
此代碼塊在浮窗中顯示
響應說明
字段 | 說明 |
---|---|
label_id | 標籤ID |
label_name | 標籤名稱 |
create_time | 創建時間 |
update_time | 更新時間 |
響應示例
Response-success
HTTP Status: 200
{
"result":
{
"label_id": 598802,
"label_name": "xjm226",
"create_time": "2022-11-14T14:27:48+0800",
"update_time": "2022-11-14T14:27:48+0800"
}
}
{
"result":
{
"label_id": 598802,
"label_name": "xjm226",
"create_time": "2022-11-14T14:27:48+0800",
"update_time": "2022-11-14T14:27:48+0800"
}
}
此代碼塊在浮窗中顯示
Response-error
HTTP Status :400
{
"code": 34020,
"message": "label_id must be a integer"
}
{
"code": 34020,
"message": "label_id must be a integer"
}
此代碼塊在浮窗中顯示
查詢多個標籤
返回短信標籤的基本信息
URL
https://sms.api.engagelab.cc/v1/labels
https://sms.api.engagelab.cc/v1/labels
此代碼塊在浮窗中顯示
HTTP請求方式
GET
GET
此代碼塊在浮窗中顯示
Request-Headers
Header | 類型 | 必須 | 說明 |
---|---|---|---|
Authorization | String | true | Basic base64(sms_user:sms_key) |
Query參數說明
參數 | 類型 | 必须 | 說明 |
---|---|---|---|
offset | Integer | 否 | 查詢起始位置,取值區間 [0-],默認為 0 |
limit | Integer | 否 | 查詢個數,取值區間 [0-100],默認為 100 |
label_name | string | 否 | 標籤名稱,支持模糊查詢 |
請求示例
curl -X GET "https://sms.api.engagelab.cc/v1/labels?label_name=test"
--header "Authorization: Basic <<YOUR_AUTHORIZATION_KEY>>"
curl -X GET "https://sms.api.engagelab.cc/v1/labels?label_name=test"
--header "Authorization: Basic <<YOUR_AUTHORIZATION_KEY>>"
此代碼塊在浮窗中顯示
響應說明
字段 | 說明 |
---|---|
label_id | 標籤ID |
label_name | 標籤名稱 |
create_time | 創建時間 |
update_time | 更新時間 |
響應示例
Response-success
HTTP Status: 200
{
"result": [
{
"create_time": "2022-11-14T14:27:48+0800",
"label_id": 10,
"label_name": "test",
"update_time": "2022-11-14T14:27:48+0800"
}
]
"total": 28,
"count": 1
}
{
"result": [
{
"create_time": "2022-11-14T14:27:48+0800",
"label_id": 10,
"label_name": "test",
"update_time": "2022-11-14T14:27:48+0800"
}
]
"total": 28,
"count": 1
}
此代碼塊在浮窗中顯示
Response-error
HTTP Status :401
{
"code": 30000,
"message": "Unauthorized."
}
{
"code": 30000,
"message": "Unauthorized."
}
此代碼塊在浮窗中顯示
添加標籤
返回添加成功後的短信標籤基本信息
URL
https://sms.api.engagelab.cc/v1/labels
https://sms.api.engagelab.cc/v1/labels
此代碼塊在浮窗中顯示
HTTP請求方式
POST
POST
此代碼塊在浮窗中顯示
Content-type
application/json
application/json
此代碼塊在浮窗中顯示
Request-Headers
Header | 類型 | 必須 | 說明 |
---|---|---|---|
Authorization | string | true | Basic base64(sms_user:sms_key) |
參數說明
參數 | 類型 | 必须 | 說明 |
---|---|---|---|
label_name | string | 是 | 標籤名稱,最長64個字符 |
說明:
- label創建限制上限為10萬個
請求示例
curl -X POST "https://sms.api.engagelab.cc/v1/labels"
--header "Authorization: Basic <<YOUR_SMS_KEY_HERE>>"
--header "Content-Type: application/json"
--data '{
"label_name": "test2"
}'
curl -X POST "https://sms.api.engagelab.cc/v1/labels"
--header "Authorization: Basic <<YOUR_SMS_KEY_HERE>>"
--header "Content-Type: application/json"
--data '{
"label_name": "test2"
}'
此代碼塊在浮窗中顯示
響應說明
字段 | 說明 |
---|---|
label_id | 標籤ID |
label_name | 標籤名稱 |
create_time | 創建時間 |
update_time | 更新時間 |
響應示例
Response-success
HTTP Status: 200
{
"result": {
"label_id": 11,
"label_name": "test",
"create_time": "2022-11-14T14:27:48+0800",
"update_time": "2022-11-14T14:27:48+0800"
}
}
{
"result": {
"label_id": 11,
"label_name": "test",
"create_time": "2022-11-14T14:27:48+0800",
"update_time": "2022-11-14T14:27:48+0800"
}
}
此代碼塊在浮窗中顯示
Response-error
HTTP Status :401
{
"code": 30000,
"message": "Unauthorized."
}
{
"code": 30000,
"message": "Unauthorized."
}
此代碼塊在浮窗中顯示
更新標籤
返回更新成功之後的短信標籤的基本信息
URL
https://sms.api.engagelab.cc/v1/labels/{label_id}
https://sms.api.engagelab.cc/v1/labels/{label_id}
此代碼塊在浮窗中顯示
HTTP請求方式
PUT
PUT
此代碼塊在浮窗中顯示
Content-type
application/json
application/json
此代碼塊在浮窗中顯示
Request-Headers
Header | 類型 | 必須 | 說明 |
---|---|---|---|
Authorization | String | true | Basic base64(sms_user:sms_key) |
參數說明
參數 | 類型 | 必须 | 說明 |
---|---|---|---|
label_name | string | 是 | 標籤名稱,最長64個字符 |
請求示例
curl -X PUT "https://sms.api.engagelab.cc/v1/labels/11"
--header "Authorization: Basic <<YOUR_SMS_KEY_HERE>>"
--header "Content-Type: application/json"
--data '{
"label_name": "test3"
}'
curl -X PUT "https://sms.api.engagelab.cc/v1/labels/11"
--header "Authorization: Basic <<YOUR_SMS_KEY_HERE>>"
--header "Content-Type: application/json"
--data '{
"label_name": "test3"
}'
此代碼塊在浮窗中顯示
響應說明
參數 | 說明 |
---|---|
count | 修改成功的個數 |
響應示例
Response-success
HTTP Status: 200
{
"count":1
}
{
"count":1
}
此代碼塊在浮窗中顯示
Response-error
HTTP Status :401
{
"code": 30000,
"message": "Unauthorized."
}
{
"code": 30000,
"message": "Unauthorized."
}
此代碼塊在浮窗中顯示
删除标签
URL
https://sms.api.engagelab.cc/v1/labels/{label_id}
https://sms.api.engagelab.cc/v1/labels/{label_id}
此代碼塊在浮窗中顯示
HTTP請求方式
DELETE
DELETE
此代碼塊在浮窗中顯示
Request-Headers
Header | 類型 | 必須 | 說明 |
---|---|---|---|
Authorization | String | true | Basic base64(sms_user:sms_key) |
請求示例
curl -X DELETE "https://sms.api.engagelab.cc/v1/labels/11"
--header "Authorization: Basic <<YOUR_SMS_KEY_HERE>>"
curl -X DELETE "https://sms.api.engagelab.cc/v1/labels/11"
--header "Authorization: Basic <<YOUR_SMS_KEY_HERE>>"
此代碼塊在浮窗中顯示
響應說明
參數 | 說明 |
---|---|
count | 成功刪除的個數 |
響應示例
Response-success
HTTP Status: 200
{
"count": 1
}
{
"count": 1
}
此代碼塊在浮窗中顯示
Response-error
HTTP Status :401
{
"code": 30000,
"message": "Unauthorized."
}
{
"code": 30000,
"message": "Unauthorized."
}
此代碼塊在浮窗中顯示