Attaching a Mobi Doc

The following guide will show you how to make use of your Mobi Doc, if you are sending via the RESTful API.

Bulk Message Request with Documents

The following is an example request to use the bulk messages resource so send messages with links to personalized documents:

POST /bulkmessages HTTP/1.1
HOST: rest.smsportal.com/v1
Content-Type: application/json
Authorization: Bearer [Your Authorization Token]
Accept: application/json
{
  "Messages": [
    {
      "Content": "Hello John. Our new API is available. @@[email protected]@ to learn more",
      "Destination": "27830000000",
      "Document":
        {
          "Template": "MyAPIDocs",
          "Password": "[email protected]",
          "Variables":
            {
              "ValueOne": 1,
              "ValueTwo": 2,
              "String3": "Three"
            }
        }
    }
  ]
}

The Document variable contains 2 compulsory and 2 optional fields:

Compulsory

  • The “Template” variable contains the API Template name of document that was configured during the definition of the document template.

  • The “Variables” variable contains the unique variables required by the document template as part of the JSON structure, the variables provided will change depending on the definition of the document template.

Optional

  • The optional “Password” variable contains the unique password of the recipient of the message to access the secured document content. If no password is provided then the document content will be visible without any authentication.

  • An optional “Version” variable will allow developers to test a specific version of the document template, however it is highly advised that the production environment should not specify the variable which allows the automatic use of the default version configured.

Message Content

The content field of each message should contain the @@[email protected]@ variable to allow the document generation to provide the unique URL of the personalized document related to the specific message.

Response:

HTTP/1.1 200 Accepted
Content-Type: application/json
{
  "Cost": 1,
  "RemainingBalance": 1500,
  "EventId": 12345678901,
  "Sample": "Hello John. Our new API is available. Go to https://ury.io/XXXXXX to learn more",
  "Messages": 1,
  "Parts": 1,
  "CostBreakDown": 
  [
    {
      "Network": "Local",
      "Cost": 1,
      "Quantity": 1
    }
  ],
  "ErrorReport":
    {
      "NoNetwork": 0,
      "Duplicates": 0,
      "OptedOuts": 0,
      "Faults": []
    }
}

Updated 2 months ago

Attaching a Mobi Doc


The following guide will show you how to make use of your Mobi Doc, if you are sending via the RESTful API.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.