Storecontent code snippets

To aid your development, we have created a number of code snippets that you can cut and paste and modify to suite your application requirements.

Store alert – base64

{
    "version": "latest",
    "apiKey": "abcdefghijklmnopqrstuvwxyz",
    "content": [
        {
            "contentType": "alert",
            "tag": "t1",
            "content": "ewoJInZl..........ICBdIAp9Cg==",
            "contentEncoding": "base64",
            "options": {
                "expirationInDays": 30
            }
        }
    ]
}

Store alert – embedded

{
    "version": "latest",
    "apiKey": "abcdefghijklmnopqrstuvwxyz",
    "content": [
        {
            "contentType": "alert",
            "tag": "t1",
            "options": {
                "expirationInDays": 30
            }
            "contentEncoding": "json",
            "content": {
                "version" : "v1.0",
                "apiKey" : "abcdefghijklmnopqrstuvwxyz",
                "clientRef" : "abcd-efgh",
                "options" : {
                    "notification" : "callback",
                    "notificationType" : "json"
                },
                "alert" : [
                   {
                       "alertType" : "sms",
                       "tag" : "t1",
                       "content" : "This is an SMS 1",
                       "contentEncoding" : "utf8",
                       "sender" : "+447971234567",
                       "recipientList" : "+447971110001,+447971110002"
                   }
                ] 
            }
        }
    ]
}

Store recipients

{
    "version": "latest",
    "apiKey": "abcdefghijklmnopqrstuvwxyz",
    "content": [
        {
            "contentType": "recipientList",
            "tag": "t1",
            "content": "+447777100100,+447777100101,+447777100102",
            "contentEncoding": "utf8",
            "options": {
                "expirationInDays": 0
            }
        }
    ]
}

Store TTS

{
    "version": "latest",
    "apiKey": "abcdefghijklmnopqrstuvwxyz",
    "content": [
        {
            "contentType": "inboundCall",
            "tag": "t1",
            "contentEncoding": "utf8",
            "voiceFormat": "tts",
            "content": "This is an inbound call text to speech file"
        }
    ]
}