Skip to content
This repository has been archived by the owner on Jan 3, 2022. It is now read-only.

Commit

Permalink
Updated advanced usage example (#51)
Browse files Browse the repository at this point in the history
* Updated advanced usage example

* Remove payload
  • Loading branch information
jwldk authored Sep 10, 2020
1 parent d3f9a95 commit 4896cf8
Showing 1 changed file with 41 additions and 52 deletions.
93 changes: 41 additions & 52 deletions docs/rest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -630,9 +630,8 @@ Advanced usage

**Fully fledged request**

This is a bit of contrived example since ``message`` and ``payload`` can't
both be set at the same time, but it shows every possible field in the API
like multiple recipients to the same message and multiple messages in the same payload.
This is a bit of contrived example since, but it shows most of the possible fields
in the API like multiple recipients to the same message using tags and various extra options.

.. sourcecode:: http

Expand All @@ -647,53 +646,43 @@ Advanced usage
Accept: application/json, text/javascript
Content-Type: application/json

[
{
"class": "standard",
"message": "Hello World, regards %Firstname, --Lastname--",
"payload": "cGF5bG9hZCBlbmNvZGVkIGFzIGI2NAo=",
"label": "Deathstar inc.",
"recipients": [
{
"msisdn": 1514654321,
"tagvalues": [
"Vader",
"Darth"
]
},
{
"msisdn": 1514654322,
"tagvalues": [
"Maul",
"Darth"
]
}
],
"sender": "Test Sender",
"sendtime": 915148800,
"tags": [
"--Lastname--",
"%Firstname"
],
"userref": "1234",
"priority": "NORMAL",
"validity_period": 86400,
"encoding": "UTF8",
"destaddr": "MOBILE",
"udh": "BQQLhCPw",
"callback_url": "https://example.com/cb?foo=bar"
},
{
"message": "Hello World",
"recipients": [
{ "msisdn": 4512345678 }
]
}
]
{
"class": "premium",
"message": "Hello World, regards %Firstname%, %Lastname%",
"label": "Deathstar",
"recipients": [
{
"msisdn": 1514654321,
"tagvalues": [
"Vader",
"Darth"
]
},
{
"msisdn": 1514654322,
"tagvalues": [
"Maul",
"Darth"
]
}
],
"sender": "Empire",
"sendtime": 915148800,
"tags": [
"%Lastname%",
"%Firstname%"
],
"userref": "1234",
"priority": "VERY_URGENT",
"validity_period": 86400,
"encoding": "UTF8",
"destaddr": "MOBILE",
"callback_url": "https://example.com/cb?foo=bar"
}

**Example response**

If the request succeed, the internal message identifiers are returned to
If the request succeed, the internal message identifier are returned to
the caller like this:

.. sourcecode:: http
Expand All @@ -703,14 +692,14 @@ Advanced usage

{
"ids": [
421332671, 4421332672
421332671
],
"usage": {
"countries": {
"DK": 3
"DK": 2
},
"currency": "DKK",
"total_cost": 0.36
"total_cost": 0.30
}
}

Expand Down Expand Up @@ -1553,9 +1542,9 @@ If you need SPF on your domain, you will need to include the following in your D
:status 403: Ie. unauthorized ip address
:status 422: Invalid json request body
:status 500: If the request can't be processed due to an exception. The exception details is returned in the JSON body

**Request example**

.. sourcecode:: http

POST /rest/email HTTP/1.1
Expand Down

0 comments on commit 4896cf8

Please sign in to comment.