View all Blocklists
http://portal.thundersms.com/api/v2/
{endpoint}sms/suppressions/templates
curl -X GET \
'{endpoint}sms/suppressions/templates' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer 7160f04c0587xxxxxxxxxxxxxxxx'
Kindly replace the token with your respective access_token and other params.
{
"status": "OK",
"code": 200,
"message": "Block templates list",
"data": [
{
"id": "2",
"template_id": "12xxxxx",
"status": 1,
},
....
],
"links": {
"first": "{endpoint}sms/suppressions/templates?page=1",
"last": "{endpoint}sms/suppressions/templates?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "{endpoint}sms/suppressions/templates?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "{endpoint}sms/suppressions/templates",
"per_page": 15,
"to": 3,
"total": 3
}
}
Create block template using POST method.
http://portal.thundersms.com/api/v2/
{endpoint}sms/suppressions/templates
Name | optional | Descriptions |
---|---|---|
template_id | No | Enter the template_id that you want to create |
status | Mixed | 1 or 0 |
curl -X POST\
'{endpoint}sms/suppressions/templates' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer 7160f04c0587xxxxxxxxxxxxxxxx' \
-H 'Content-Type: application/json' \
-d '{
"template_id": "12xxxxx",
"status": "1"
}'
{
"status": "OK",
"code": 200,
"message": "Block template added successfully",
"data": {
"id": "2",
"template_id": "12xxxxx",
"status": 1
}
}
Edit block template using put method.
http://portal.thundersms.com/api/v2/
{endpoint}sms/suppressions/templates/{id}
Replace the {id} with the actual id of the receiver that you would like to Edit.
Name | optional | Descriptions |
---|---|---|
template_id | No | Enter the receiver that you want to edit |
status | Mixed | 1 or 0 |
curl -X PUT \
'{endpoint}sms/suppressions/templates/2' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer 7160f04c0587xxxxxxxxxxxxxxxx' \
-H 'Content-Type: application/json' \
-d '{
"template_id": "12xxxxx",
"status": "1"
}'
{
"status": "OK",
"code": 200,
"message": "Block template updated successfully",
"data": {
"id": "2",
"template_id": "12xxxxx",
"status": 1
}
}
View one created block template
http://portal.thundersms.com/api/v2/
{endpoint}sms/suppressions/templates/{id}
curl -X GET \
'{endpoint}sms/suppressions/templates/2' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer 7160f04c0587xxxxxxxxxxxxxxxx'
Kindly replace the token with your respective access_token .
{
"status": "OK",
"code": 200,
"message": "Block template data",
"data": {
"id": 2,
"template_id": "12xxxxx",
"status": 1
}
}
Import block templates by uploading a file
http://portal.thundersms.com/api/v2/
{endpoint}/sms/suppressions/templates/import
curl -X POST\
'{endpoint}sms/suppressions/templates/import' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer 7160f04c0587xxxxxxxxxxxxxxxx' \
-H 'Content-Type: application/form-data' \
-F 'file=@"yourfilepath/templates.xlsx"'
Name | Description | Limits | Required |
---|---|---|---|
url | Public url of the receiver file. Either HTTP/HTTPS link. | 100 MB | Yes |
caption | some text for reciver caption | N/A | No |
filename | Receiver file name | N/A | No |
{
"status": "OK",
"message": "Blocked templates accepted for import"
}
Delete block template using delete method
http://portal.thundersms.com/api/v2/
{endpoint}sms/suppressions/templates/{id}
Replace the {id} with the actual id of the block template’s id that you would like to delete.
curl -X DELETE \
'{endpoint}sms/suppressions/templates/2' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer 7160f04c0587xxxxxxxxxxxxxxxx'
{
"status": "OK",
"code": 200,
"message": "Deleted Successfully",
"data": []
}
Delete all templates at once
http://portal.thundersms.com/api/v2/
{endpoint}sms/suppressions/templates
curl -X DELETE \
'{endpoint}sms/suppressions/templates' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer 7160f04c0587xxxxxxxxxxxxxxxx'
{
"status": "OK",
"code": 200,
"message": "Deleted Successfully",
"data": []
}