Sender Ids

Sender Ids

This API allows you to fetch all the sender IDs mapped to your account by sending a GET request to the following endpoint.

                                            
                                                EndPoint: https://api.braceafrica.com/v1/sms/senderIds/fetch

API sample code

                                                        
                                                            import requests
                                                            import json

                                                            # authentication
                                                            x_username        = "";
                                                            x_apikey          = "";

                                                            # endoint
                                                            fetchSenderidsURL   = "https://api.braceafrica.com/v1/sms/senderIds/fetch"

                                                            headers = {
                                                                'Content-type': 'application/json',
                                                                'Accept': 'application/json',
                                                                'x-api-user': x_username,
                                                                'x-api-key' : x_apikey
                                                            }

                                                            req = requests.get(fetchSenderidsURL, headers=headers)

                                                            # response
                                                            print(req.text)
                                                        
                                                    
                                                        
                                                            // authentication
                                                            $x_username           = "";
                                                            $x_apikey             = "";

                                                            // endoint
                                                            $fetchSenderidsURL     = "https://api.braceafrica.com/v1/sms/senderIds/fetch";

                                                            $req                  = curl_init($fetchSenderidsURL);

                                                            curl_setopt($req, CURLOPT_CUSTOMREQUEST, "GET");
                                                            curl_setopt($req, CURLOPT_TIMEOUT, 60);
                                                            curl_setopt($req, CURLOPT_SSL_VERIFYPEER, false);
                                                            curl_setopt($req, CURLOPT_RETURNTRANSFER, true);
                                                            curl_setopt($req, CURLOPT_HTTPHEADER, array(
                                                                'Content-Type: application/json',
                                                                'x-api-user: '.$x_username,
                                                                'x-api-key: '.$x_apikey
                                                            ));

                                                            // read api response
                                                            $res              = curl_exec($req);

                                                            // close curl
                                                            curl_close($req);

                                                            // print the raw json response
                                                            var_dump($res);
                                                        
                                                    
                                                        
                                                            var request             = require('request');

                                                            // authentication
                                                            var x_username          = ""
                                                            var x_apikey            = ""

                                                            // endpoint
                                                            var fetchSenderidsURL = "https://api.braceafrica.com/v1/sms/senderIds/fetch"

                                                            var headers = {
                                                                'Content-Type' :  'application/json',
                                                                'Accept' : 'application/json',
                                                                'x-api-user' : x_username,
                                                                'x-api-key' : x_apikey
                                                            }

                                                            var options = {
                                                                url: fetchSenderidsURL,
                                                                method: 'GET',
                                                                headers: headers
                                                            }

                                                            // the request and response
                                                            request(options, function (error, response, body) {
                                                                if (!error && response.statusCode == 200) {
                                                                    // Print out the response body
                                                                    console.log(body)
                                                                }
                                                                else{
                                                                    console.log(error)
                                                                }
                                                            })
                                                        
                                                    
                                                        
                                                            package main

                                                            import (
                                                                "fmt"
                                                                "io/ioutil"
                                                                "net/http"
                                                            )

                                                            func main() {
                                                                // endpoint
                                                                var fetchSenderidsURL string = "https://api.braceafrica.com/v1/sms/senderIds/fetch"

                                                                // authentication
                                                                var x_username string = ""
                                                                var x_apikey string = ""

                                                                // request
                                                                request, err := http.NewRequest("GET", fetchSenderidsURL, nil)

                                                                if err != nil {
                                                                    panic(err.Error())
                                                                }

                                                                // headers
                                                                request.Header.Set("Content-Type", "application/json")
                                                                request.Header.Set("x-api-user", x_username)
                                                                request.Header.Set("x-api-key", x_apikey)

                                                                // response
                                                                response, err := http.DefaultClient.Do(request)

                                                                if err != nil {
                                                                    panic(err.Error())
                                                                }

                                                                body, err := ioutil.ReadAll(response.Body)

                                                                defer response.Body.Close()

                                                                fmt.Println(string(body))
                                                            }

                                                        
                                                    

When the request is successful, you should expect the following response.

                                            
                                                {
                                                    "status": 200,
                                                    "senderids": [
                                                        {
                                                            "sender_id": "BraceAfrica",
                                                            "country": "Kenya",
                                                            "status": "active"
                                                        },
                                                        {
                                                            "sender_id": "JubaPay",
                                                            "country": "Kenya",
                                                            "status": "active"
                                                        },
                                                        {
                                                            "sender_id": "Foleni",
                                                            "country": "Uganda",
                                                            "status": "active"
                                                        }
                                                    ]
                                                }