标签

最新更新: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个字符

说明:
1..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."
}

        
此代码块在浮窗中显示
在文档中心打开
icon
联系销售