View Templates

View Templates

View all templates created under your account

API Endpoint

https://eu.cpaas.bics.com/api/v2/

GET

{endpoint}sms/templates

Filters

name Optional value
filter[name] Yes Name of the template.

Example Request

Curl

curl -X GET \
  '{endpoint}sms/templates?filter[name]=test' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer 5b02112fb7xxxxxxxxx'

Kindly replace the token with your respective access_token and other params.

C#

var client = new RestClient("{endpoint}/api/v2/sms/templates");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer 7160f04c05870ee88812a435f65xxxxx");
var body = @"";
request.AddParameter("text/plain", body,  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

Java Script

var settings = {
  "url": "{endpoint}/api/v2/sms/templates",
  "method": "GET",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer 7160f04c05870ee88812a435f65xxxxx"
  },
};

$.ajax(settings).done(function (response) { console.log(response); });

Node

var axios = require('axios');
var data = '';

var config = { method: ‘get’, url: ‘{endpoint}/api/v2/sms/templates’, headers: { ‘Authorization’: ‘Bearer 7160f04c05870ee88812a435f65xxxxx’ }, data : data };

axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { console.log(error); });

Example Response

{
    "status": "OK",
    "code": 200,
    "message": "Templates List",
    "data": [
        {
            "id": "b23769e6-019f-48f4-aae9-ec00a5xxxxxx",
            "sender_id": "015c2f82-1352-4d19-9f8f-b8449xxxxxx",
            "template_id": "1107161521283358301",
            "template_type": "Transactional",
            "sender": "SENDER",
            "name": "hind-number",
            "alias": "hind-number",
            "body": "Your Verification code is:{{1}} is code {{2}}",
            "content": null,
            "body_length": 53,
            "match_count": 0,
            "percentage": 0,
            "is_complete": 0,
            "is_english": 1,
            "status": 1,
            "created_at": "2022-11-16T04:41:32.000000Z",
            "updated_at": "2022-11-16T04:56:11.000000Z"
        },
      ....
    ],
   "links": {
        "first": "{endpoint}sms/templates?page=1",
        "last": "{endpoint}sms/templates?page=3",
        "prev": null,
        "next": "{endpoint}sms/templates?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 3,
        "links": [
            {
                "url": null,
                "label": "« Previous",
                "active": false
            },
            {
                "url": "{endpoint}sms/templates?page=1",
                "label": "1",
                "active": true
            },
          ....
        ],
        "path": "{endpoint}sms/templates",
        "per_page": 15,
        "to": 15,
        "total": 43
    }
}