Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

On the other hand, the Webhook object (section) describes the requests and parameters that your messaging server should send to the Ringotel server. You can send those requests in any format, but if you want to match the existing format of the Ringotel Messaging API, you can try something like this:

Send message:

Code Block
languagejson
//model
{
    "event_key": "message",
    "event_type": "message",
    "request_method": "POST",
    "request_parameters":
    {
        "method": "$event_key$",
        "params":{
            "from": "$from$",
            "to": "$to$",
            "content": "$content$"
        }
    }
}

// POST request JSON body
{
    "method": "message",
    "params":{
        "from": "+61855555555",
        "to": "+61123456789",
        "content": "Hello there!"
    }
}

Send file:

Code Block
languagejson
//model
{
    "event_key": "file",
    "event_type": "mms",
    "request_method": "POST",
    "request_parameters":
    {
        "method": "$event_key$",
        "params":{
            "from": "$from$",
            "to": "$to$",
            "text": "$text$",
            "url":"$url$"
        }
    }
},

// POST request JSON body
{
    "method": "file",
    "params":{
        "from": "+61855555555",
        "to": "+61123456789",
        "text": "Sending a file",
        "url":"https://your.server.com/files/8a8d89798as9ud.jpeg"
    }
}

Delivered:

Code Block
languagejson
// model
{
    "event_key": "delivered",
    "event_type": "messageDelivered",
    "request_method": "POST",
    "request_parameters": {
        "method": "$event_key$",
        "params":{
            "messageid": "$messageid$"
        }
    }
},

// POST request JSON body
{
    "method": "delivered",
    "params":{
        "messageid": "9612c4e2-27f8-4463-a517-c6306ffdabff"
    }
}

...