SMS Label

Last updated:2023-04-10

You can query, add, modify, and delete SMS labels through the following interface.

Query

Return basic information of SMS labels.

URL

https://sms.api.engagelab.cc/v1/labels/{label_id}
          https://sms.api.engagelab.cc/v1/labels/{label_id}

        
This code block in the floating window

HTTP Request Method

GET
          GET

        
This code block in the floating window

Request-Headers

Header Type Required or not Description
Authorization string true Basic base64(sms_user:sms_key)

Request Example

curl -X GET "https://sms.api.engagelab.cc/v1/labels/598802" --header "Authorization: Basic <<YOUR_API_KEY_HERE>>"
          curl -X GET "https://sms.api.engagelab.cc/v1/labels/598802" 
--header "Authorization: Basic <<YOUR_API_KEY_HERE>>"

        
This code block in the floating window

Returned Value Description

Parameter Description
label_id label ID
label_name label name
create_time time of label creation
update_time time of label modification

Returned Value Example

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"
            }
}

        
This code block in the floating window

Response-error

HTTP Status :400

{ "code": 34020, "message": "label_id must be a integer" }
          {
  "code": 34020,
  "message": "label_id must be a integer"
}

        
This code block in the floating window

Query(Batch)

List of returned labels

URL

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

        
This code block in the floating window

HTTP Request Method

GET
          GET

        
This code block in the floating window

Request-Headers

Header Type Required or not Description
Authorization String true Basic base64(sms_user:sms_key)

Query Parameter Description

Parameter Type Required or not Description
offset Integer no offset position, [0-], defaults to 0
limit Integer no amount, [0-100],defaults to 100
label_name string no fuzzy query

Request Example

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>>"

        
This code block in the floating window

Returned Value Description

Parameter Description
label_id label ID
label_name label name
create_time time of label creation
update_time time of label modification

Returned Value Example

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
}

        
This code block in the floating window

Response-error

HTTP Status :401

{ "code": 30000, "message": "Unauthorized." }
          {  
    "code": 30000,
    "message": "Unauthorized."
}

        
This code block in the floating window

Add

Return the basic information of the SMS label after successful addition.

URL

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

        
This code block in the floating window

HTTP Request Method

POST
          POST

        
This code block in the floating window

Content-type

application/json
          application/json

        
This code block in the floating window

Request-Headers

Header Type Required Description
Authorization string true Basic base64(sms_user:sms_key)

Parameter Description

Parameter Type Required or not Description
label_name string yes label name to be added. Maximum 64 characters.

Tips

  1. The upper limit of label creation is 100000

Request Example

curl -X POST "https://sms.api.engagelab.cc/v1/labels" --header "Authorization: Basic <<YOUR_API_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_API_KEY_HERE>>" 
--header "Content-Type: application/json" 
--data '{
    "label_name": "test2"
}'  

        
This code block in the floating window

Returned Value Description

Parameter Description
label_id label ID
label_name label name
create_time time of label creation
update_time time of label modification

Returned Value Example

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"
        }
}

        
This code block in the floating window

Response-error

HTTP Status :401

{ "code": 30000, "message": "Unauthorized." }
          {
    "code": 30000,
    "message": "Unauthorized."
}

        
This code block in the floating window

Modify

URL

https://sms.api.engagelab.cc/v1/labels/{label_id}
          https://sms.api.engagelab.cc/v1/labels/{label_id}

        
This code block in the floating window

HTTP Request Method

PUT
          PUT

        
This code block in the floating window

Content-type

application/json
          application/json

        
This code block in the floating window

Request-Headers

Header Type Required Description
Authorization String true Basic base64(sms_user:sms_key)

Parameter Description

Parameter Type Required or not Description
label_name string yes new label name. Maximum 64 characters.

Request Example

curl -X PUT "https://sms.api.engagelab.cc/v1/labels/11" --header "Authorization: Basic <<YOUR_API_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_API_KEY_HERE>>" 
--header "Content-Type: application/json" 
--data '{
    "label_name": "test3"
}'  

        
This code block in the floating window

Returned Value Description

Parameter Description
count count of modified labels

Returned Value Example

Response-success

HTTP Status: 200

{ "count":1 }
          {
    "count":1
}

        
This code block in the floating window

Response-error

HTTP Status :401

{ "code": 30000, "message": "Unauthorized." }
          {
    "code": 30000,
    "message": "Unauthorized."
}

        
This code block in the floating window

Delete

URL

https://sms.api.engagelab.cc/v1/labels/{label_id}
          https://sms.api.engagelab.cc/v1/labels/{label_id}

        
This code block in the floating window

HTTP Request Method

DELETE
          DELETE

        
This code block in the floating window

Request-Headers

Header Type Required Description
Authorization String true Basic base64(sms_user:sms_key)

Request Example

curl -X DELETE "https://sms.api.engagelab.cc/v1/labels/11" --header "Authorization: Basic <<YOUR_API_KEY_HERE>>"
          curl -X DELETE "https://sms.api.engagelab.cc/v1/labels/11" 
--header "Authorization: Basic <<YOUR_API_KEY_HERE>>"

        
This code block in the floating window

Returned Value Description

Parameter Description
count amount of deleted labels

Returned Value Example

Response-success

HTTP Status: 200

{ "count": 1 }
          {
    "count": 1
}

        
This code block in the floating window

Response-error

HTTP Status :401

{ "code": 30000, "message": "Unauthorized." }
          {
    "code": 30000,
    "message": "Unauthorized."
}

        
This code block in the floating window
在文档中心打开