NAV Navbar
MAAP
Messaging as a Platform
shell javascript Parilia (410) 580-2418 4254849947
  • (801) 260-5585
  • Authentication
  • 6056776665
  • XMS Messages
  • Bot Messages
  • coelacanthine
  • (202) 769-5824
  • unpenanced
  • Response Codes
  • Introduction

    Welcome to the Messaging as a Platform API! You can use the API to access the MAAP API endpoints which will give you actions and information on sending and recieving messages and more.

    MAAP provides you, businesses, developers, and bots ways to interact with customers over messaging. It can provide additional services like identity, Call to Action, Branding, Location, Billing, and more.

    The messaging service includes:

    Libraries Used

    curl - from /curl.haxx.se/
    
    / jQuery
    / - as a transport for making requests
    npm install jquery
    
    / Express js
    / - as a server framework for callbacks
    npm install express
    
    / OkHttp
    / - as a transport for making requests
    
    / Jackson
    / - to handle json
    

    The examples will be including some third-party libraries that are meant to be used as a demonstration. They assume that they'll be set up.

    Authentication

    To authorize, use this code:

    # With shell, you can just pass the correct header with each request
    curl "api_endpoint_here"
      -u "name:passwd"
    
    var $ = require('jquery');
    
    var xhr = $.ajax({
      method: "POST",
      username: username,
      password: token,
      url: "/maapapi-dev2.vzmlab.com/v1/BotMessages",
      dataType: "json",
      data: requestObj
    }).done(function(data, textStatus,jqXhr) {
      console.log('Response: %o', data);
    }).fail(function(jqXhr, textStatus, errorThrown) {
      console.log("My request went sideways.");
    });
    

    Make sure to replace meowmeowmeow with your API key.

    MAAP currently uses BasicAuth to allow access to the API. You can register a new Basic API key at our developer portal.

    MAAP expects for the API key to be included in all API requests to the server in a header that looks like the following:

    Authorization: Basic meowmeowmeow

    Sending Messages

    There are currently two message types, XMS and BOT. XMS is used for standard carrier messages. BOT is used for rich interactive messages.

    XMS Messages

    Sending a Message

    require 'kittn'
    
    api = Kittn::APIClient.authorize!('meowmeowmeow')
    api.kittens.get
    
    import kittn
    
    api = kittn.authorize('meowmeowmeow')
    api.kittens.get()
    
    curl "/maapapi-dev2.vzmlab.com/v1/XMSMessages"
      -u "name:passwd"
      -d '{
        "type": "XMS",
        "from": "+19255551111",
        "to": [
          "+19255552222","+19255553333"
        ],
        "text": "Hello",
        "mediaUrl": "/s3.aws.com/testimage",
        "mediaMimeType": "image/jpeg",
        "mediaSize": 1345
      }'
    
    / Transport Library
    var $ = require('jquery');
    
    / Authentication
    var username = "user";
    var token = "token";
    
    / Request Object
    var requestObj = {
      "type": "XMS",
      "from": "+19255551111",
      "to": [
        "+19255552222","+19255553333"
      ],
      "text": "Hello",
      "mediaUrl": "/s3.aws.com/testimage",
      "mediaMimeType": "image/jpeg",
      "mediaSize": 1345
    };
    
    var xhr = $.ajax({
      method: "POST",
      username: username,
      password: token,
      url: "/maapapi-dev2.vzmlab.com/v1/XMSMessages",
      dataType: "json",
      data: requestObj
    }).done(function(data, textStatus,jqXhr) {
      console.log('Response: %o', data);
    }).fail(function(jqXhr, textStatus, errorThrown) {
      console.log("My request went sideways.");
    });
    

    Posting the following data

    {
      "type": "XMS",
      "from": "+19255551111",
      "to": [
        "+19255552222","+19255553333"
      ],
      "text": "Hello",
      "mediaUrl": "/s3.aws.com/testimage",
      "mediaMimeType": "image/jpeg",
      "mediaSize": 1345
    }
    

    Returns JSON structured like this:

    {
      "messageId": "msg1234"
    }
    

    This endpoint sends an XMS message.

    HTTP Request

    POST /maapapi-dev2.vzmlab.com/v1/XMSMessages

    Query Parameters

    Property Name Required Type Description
    type Y String The string "XMS"
    originId Y String A UUID you generate to identify this message. You can associate any callbacks received for this message via this ID.
    from Y String The long code this messages is coming from.
    to Y Array An array of phone numbers this message is to be sent to.
    text N String The message body. Optional if providing media property.
    media N Object A Media object. Optional if providing text property.
    media.url N String The URL to the location of the media content. Optional if providing base64 property.
    media.base64 N String Base 64 encoding of the media content. Optional if providing the url property. The max size for this field is XXX.
    media.contentType N String The content type of the Base 64 data. Optional if providing the url property.

    HTTP Response

    204 No Content

    Response Message

    The code for listening

    / Server Transport
    var express = require('express');
    var app = express();
    
    / Listen to callback
    app.get('/lord_of_the_callbacks', function(req, res){
    
      / Determine what kind of message it is...
      /
      try {
        if(req.messageType === 'XMS') {
          handleParsedXMSType(req);
        }
        else {
          console.debug("New unhandled message. %o", req)
        }
      } catch(e) {
        console.error("That error wasn't suppose to happen! err=%o", e, e);
      }
    
      / Respond with expected status
      res.status(204).send();
    });
    
    /**
     * Returns if the callback was successful
     */
    function handleParsedXMSType(req) {
      console.log("I've recieved the message!  And it was good. %o", req);
      return true;
    }
    
    / Start the app to listen on the port
    app.listen(80);
    

    This payload is posted to the callback

    {
      "type": "XMS",
      "messageId": "d4d269c110006c7c5e0dbd7785",
      "from": "+19255552222",
      "to": "+19255551111",
      "text": "help",
      "media": {
        "url": "/www.image.com/image.jpg",
        "mime": "image/jpeg"
      }
    }
    

    Example curl to test with

    curl "/YOUR_SERVER/lord_of_the_callbacks"
      -d '{
        "type": "XMS",
        "messageId": "d4d269c110006c7c5e0dbd7785",
        "from": "+19255552222",
        "to": "+19255551111",
        "text": "help",
        "media": {
          "url": "/www.image.com/image.jpg",
          "mime": "image/jpeg"
        }
      }'
    

    This endpoint delivers response messages back to the specified callback.

    HTTP Request

    POST /YOUR_SERVER/your_callback

    URL Parameters

    Property Name Required Type Description
    type Y String The string "XMS"
    messageId Y String A UUID you generate to identify this message. You can associate any callbacks received for this message via this ID.
    from Y String The long code this messages is coming from.
    to Y Array An array of phone numbers this message is to be sent to.
    text N String The message body. Optional if providing media property.
    media N Object A Media object. Optional if providing text property.
    media.url N String The URL to the location of the media content. Optional if providing base64 property.
    media.contentType N String The content type of the Base 64 data. Optional if providing the url property.

    Expected HTTP Response

    204 No Content

    Delivery Status Message

    The code for listening

    / Server Transport
    var express = require('express');
    var app = express();
    
    / Listen to callback
    app.get('/lord_of_the_callbacks', function(req, res){
    
      / Determine what kind of message it is...
      /
      try {
        if(req.messageType === 'DeliveryReceipt') {
          handleParsedDeliveryReceiptType(req);
        }
        else {
          console.debug("New unhandled message. %o", req)
        }
      } catch(e) {
        console.error("That error wasn't suppose to happen! err=%o", e, e);
      }
    
      / Respond with expected status
      res.status(204).send();
    });
    
    /**
     * Returns if the callback was successful
     */
    function handleParsedDeliveryReceiptType(req) {
      console.log("I've recieved the message!  And it was good. %o", req);
      return true;
    }
    
    / Start the app to listen on the port
    app.listen(80);
    

    This payload is posted to the callback

    {
      "type": "DeliveryReceipt",
      "messageId": "d4d269c110006c7c5e0dbd7785",
      "from": "+19255551111",
      "to": "+19255552222",
      "status": "delivered"
    }
    

    Example curl to test with

    curl "/YOUR_SERVER/lord_of_the_callbacks"
      -d '{
        "type": "DeliveryReceipt",
        "messageId": "d4d269c110006c7c5e0dbd7785",
        "from": "+19255551111",
        "to": "+19255552222",
        "status": "delivered"
      }'
    

    This endpoint delivers the delivery report for a previously sent message.

    HTTP Request

    POST /YOUR_SERVER/your_callback

    URL Parameters

    Property Name Required Type Description
    type Y String The string "DeliveryReceipt"
    messageId Y String A UUID generated to identify the corresponding message.
    from Y String The long code the corresponding message is coming from.
    to Y Array An array of phone numbers the corresponding message is to be sent to.
    status Y String The delivery status

    Expected HTTP Response

    204 No Content

    Bot Messages

    Sending a Message

    require 'kittn'
    
    api = Kittn::APIClient.authorize!('meowmeowmeow')
    api.kittens.get
    
    import kittn
    
    api = kittn.authorize('meowmeowmeow')
    api.kittens.get()
    
    curl "/maapapi-dev2.vzmlab.com/v1/BotMessages"
      -u "name:passwd"
      -d '{
        "type": "Bot",
        "originId": "ccf269c110006c7c5ea0cd7785",
        "from": "c711f40b1000ac1e1ff4c5ea85",
        "to": "+19255552222",
        "bot": [
          {
            "subject": "Welcome",
            "text": "Welcome to MAAP",
            "links": [
              {
                "action": "message",
                "text": "Learn More",
                "selection": "welcome",
                "location": true
              }
            ]
          }
        ],
        "fallbackText": "Welcome to MAAP"
      }'
    
    / Transport Library
    var $ = require('jquery');
    
    / Authentication
    var username = "user";
    var token = "token";
    
    / Request Object
    var requestObj = {
      "type": "Bot",
      "originId": "ccf269c110006c7c5ea0cd7785",
      "from": "c711f40b1000ac1e1ff4c5ea85",
      "to": "+19255552222",
      "bot": [
        {
          "subject": "Welcome",
          "text": "Welcome to MAAP",
          "links": [
            {
              "action": "message",
              "text": "Learn More",
              "selection": "welcome",
              "location": true
            }
          ]
        }
      ],
      "fallbackText": "Welcome to MAAP"
    };
    
    var xhr = $.ajax({
      method: "POST",
      username: username,
      password: token,
      url: "/maapapi-dev2.vzmlab.com/v1/BotMessages",
      dataType: "json",
      data: requestObj
    }).done(function(data, textStatus,jqXhr) {
      console.log('Response: %o', data);
    }).fail(function(jqXhr, textStatus, errorThrown) {
      console.log("My request went sideways.");
    });
    

    Posting the following data

    {
      "type": "Bot",
      "originId": "ccf269c110006c7c5ea0cd7785",
      "from": "c711f40b1000ac1e1ff4c5ea85",
      "to": "+19255552222",
      "bot": [
        {
          "subject": "Men",
          "text": "Men's sportswear",
          "mediaUrl": "/www.the-next-hip-store.com/men.jpg",
          "links": [
            {
              "action": "message",
              "text": "Learn More",
              "selection": "men",
              "location": true
            },
            {
              "action": "browse",
              "text": "Link to Store",
              "url": "/www.the-next-hip-store.com/men"
            },
            {
              "action": "call",
              "text": "Call US",
              "phoneNumber": "+18001234567"
            }
          ]
        },
        {
          "subject": "Women",
          "text": "Women's sportswear",
          "mediaUrl": "/www.the-next-hip-store.com/women.jpg",
          "links": [
            {
              "action": "message",
              "text": "Learn More",
              "selection": "women",
              "location": true
            },
            {
              "action": "browse",
              "text": "Link to Store",
              "url": "/www.the-next-hip-store.com/women"
            },
            {
              "action": "call",
              "text": "Call US",
              "phoneNumber": "+18001234567"
            }
          ]
        }
      ],
      "fallbackText": "Please visit our site at /www.the-next-hip-store.com"
    }
    

    Returns JSON structured like this:

    {
      "id": "d4d269c110006c7c5e0dbd7785",
      "type": "XMS",
      "from": "+19255551111",
      "to": [
        "+19255552222"
      ],
      "text": "Hello"
    }
    

    This endpoint sends an Bot message with rich and action abilities.

    HTTP Request

    POST /maapapi-dev2.vzmlab.com/v1/BotMessages

    Query Parameters

    Property Name Required Type Description
    type Y String The string "Bot"
    originId Y String A UUID you generate to identify this message. You can associate any callbacks received for this message via this ID.
    from Y String The Bot ID
    to Y Array An array of phone numbers this message is to be sent to.
    bot N Array[(920) 727-7636] The Bot message body, which consists of an array of (709) 781-8744 objects. See below for the description.
    fallbackText N String Fallback SMS message to be sent to user when user does not have Verizon Messages.

    Bot Card

    Property Name Required Type Description
    subject Y String The subject of this card.
    text Y String The text content of this card.
    mediaUrl Y String The image to be displayed on the top of the card.
    links Y Array[Link] An array of Link objects. See below for the description.
    Property Name Required Type Description
    action Y String The subject of this card.
    text Y String The text of the link that will be shown to the user.
    selection N String A hidden field in the reply.
    location N boolean The location of the user will be returned.

    HTTP Response

    204 No Content

    Sending a Typing Indicator

    require 'kittn'
    
    api = Kittn::APIClient.authorize!('meowmeowmeow')
    api.kittens.get
    
    import kittn
    
    api = kittn.authorize('meowmeowmeow')
    api.kittens.get()
    
    curl "/maapapi-dev2.vzmlab.com/v1/BotMessages"
      -u "name:passwd"
      -d '{
        "type": "TypingIndicator",
        "from": "c711f40b1000ac1e1ff4c5ea85",
        "to": "+19255552222"
      }'
    
    / Transport Library
    var $ = require('jquery');
    
    / Authentication
    var username = "user";
    var token = "token";
    
    / Request Object
    var requestObj = {
      "type": "TypingIndicator",
      "from": "c711f40b1000ac1e1ff4c5ea85",
      "to": "+19255552222"
    };
    
    var xhr = $.ajax({
      method: "POST",
      username: username,
      password: token,
      url: "/maapapi-dev2.vzmlab.com/v1/BotMessages",
      dataType: "json",
      data: requestObj
    }).done(function(data, textStatus,jqXhr) {
      console.log('Response: %o', data);
    }).fail(function(jqXhr, textStatus, errorThrown) {
      console.log("My request went sideways.");
    });
    

    Posting the following data

    {
      "type": "TypingIndicator",
      "from": "c711f40b1000ac1e1ff4c5ea85",
      "to": "+19255552222"
    }
    

    This endpoint sends an Bot message.

    HTTP Request

    POST /maapapi-dev2.vzmlab.com/v1/BotMessages

    Query Parameters

    Property Name Required Type Description
    type Y String The string "TypingIndicator"
    originId Y String A UUID you generate to identify this message. You can associate any callbacks received for this message via this ID.
    from Y String The Bot ID
    to Y Array An array of phone numbers this message is to be sent to.

    HTTP Response

    204 No Content

    Response Message

    The code for listening

    / Server Transport
    var express = require('express');
    var app = express();
    
    / Listen to callback
    app.get('/lord_of_the_callbacks', function(req, res){
    
      / Determine what kind of message it is...
      /
      try {
        if(req.messageType === 'Bot') {
          handleParsedBotType(req);
        }
        else {
          console.debug("New unhandled message. %o", req)
        }
      } catch(e) {
        console.error("That error wasn't suppose to happen! err=%o", e, e);
      }
    
      / Respond with expected status
      res.status(204).send();
    });
    
    /**
     * Returns if the callback was successful
     */
    function handleParsedBotType(req) {
      console.log("I've recieved the message!  And it was good. %o", req);
      return true;
    }
    
    / Start the app to listen on the port
    app.listen(80);
    

    This payload is posted to the callback

    {
      "type": "Bot",
      "messageId": "msg1235",
      "sender": {
        "id": "aad2f40b1000ac1e1f867cfa85",
        "mdn": "+19255552222",
        "adId": "3498u2304340932"
      },
      "to": "c711f40b1000ac1e1ff4c5ea85",
      "bot": {
        "text": "Learn More",
        "location": "37.857525, -121.909140",
        "selection": "men",
        "reply": "msg1234"
      }
    }
    

    Example curl to test with

    curl "/YOUR_SERVER/lord_of_the_callbacks"
      -d '{
        "type": "Bot",
        "messageId": "msg1235",
        "sender": {
          "id": "aad2f40b1000ac1e1f867cfa85",
          "mdn": "+19255552222",
          "adId": "3498u2304340932"
        },
        "to": "c711f40b1000ac1e1ff4c5ea85",
        "bot": {
          "text": "Learn More",
          "location": "37.857525, -121.909140",
          "selection": "men",
          "reply": "msg1234"
        }
      }'
    

    This endpoint delivers response messages back to the specified callback.

    HTTP Request

    POST /YOUR_SERVER/your_callback

    URL Parameters

    Property Name Required Type Description
    type Y String The string "Bot"
    messageId Y String A UUID generated to identify this message.
    sender.id Y String Id of the user
    sender.mdn Y String mdn of user
    sender.adId N String Ad id of user
    to Y String bot id
    bot.text Y String Text of the reply message
    bot.location N String Location of the user if requested in the Bot Card Link selection
    bot.selection Y String Selection by user corresponding to the Bot Card Link selection
    bot.reply Y String Message id of the message that the user replies to

    Expected HTTP Response

    204 No Content

    Delivery Status Message

    The code for listening

    / Server Transport
    var express = require('express');
    var app = express();
    
    / Listen to callback
    app.get('/lord_of_the_callbacks', function(req, res){
    
      / Determine what kind of message it is...
      /
      try {
        if(req.messageType === 'DeliveryReceipt') {
          handleParsedDeliveryReceiptType(req);
        }
        else {
          console.debug("New unhandled message. %o", req)
        }
      } catch(e) {
        console.error("That error wasn't suppose to happen! err=%o", e, e);
      }
    
      / Respond with expected status
      res.status(204).send();
    });
    
    /**
     * Returns if the callback was successful
     */
    function handleParsedDeliveryReceiptType(req) {
      console.log("I've recieved the message!  And it was good. %o", req);
      return true;
    }
    
    / Start the app to listen on the port
    app.listen(80);
    

    This payload is posted to the callback

    {
      "type": "DeliveryReceipt",
      "messageId": "d4d269c110006c7c5e0dbd7785",
      "from": "+19255551111",
      "to": "+19255552222",
      "status": "delivered"
    }
    

    Example curl to test with

    curl "/YOUR_SERVER/lord_of_the_callbacks"
      -d '{
        "type": "DeliveryReceipt",
        "messageId": "d4d269c110006c7c5e0dbd7785",
        "from": "+19255551111",
        "to": "+19255552222",
        "status": "delivered"
      }'
    

    This endpoint delivers the delivery report for a previously sent message.

    HTTP Request

    GET /YOUR_SERVER/your_callback

    URL Parameters

    Property Name Required Type Description
    type Y String The string "DeliveryReceipt"
    messageId Y String A UUID generated to identify the corresponding message.
    from Y String The long code the corresponding message is coming from.
    to Y Array An array of phone numbers the corresponding message is to be sent to.
    status Y String The delivery status

    Expected HTTP Response

    204 No Content

    Open Conversation Event

    The code for listening

    / Server Transport
    var express = require('express');
    var app = express();
    
    / Listen to callback
    app.get('/lord_of_the_callbacks', function(req, res){
    
      / Determine what kind of message it is...
      /
      try {
        if(req.messageType === 'OpenConversation') {
          handleParsedOpenConversationType(req);
        }
        else {
          console.debug("New unhandled message. %o", req)
        }
      } catch(e) {
        console.error("That error wasn't suppose to happen! err=%o", e, e);
      }
    
      / Respond with expected status
      res.status(204).send();
    });
    
    /**
     * Returns if the callback was successful
     */
    function handleParsedOpenConversationType(req) {
      console.log("I've recieved the message!  And it was good. %o", req);
      return true;
    }
    
    / Start the app to listen on the port
    app.listen(80);
    

    This payload is posted to the callback

    {
      "type": "OpenConversation",
      "from": "+19255551111",
      "to": "c711f40b1000ac1e1ff4c5ea85",
    }
    

    Example curl to test with

    curl "/YOUR_SERVER/lord_of_the_callbacks"
      -d '{
        "type": "OpenConversation",
        "from": "+19255551111",
        "to": "c711f40b1000ac1e1ff4c5ea85",
      }'
    

    This endpoint delivers the open conversation event message. This will occur when a user has opened up a conversation that already exists with that Bot.

    HTTP Request

    GET /YOUR_SERVER/your_callback

    URL Parameters

    Property Name Required Type Description
    type Y String The string "OpenConversation"
    from Y String The phone number the corresponding message is coming from.
    to Y String The Bot ID

    Expected HTTP Response

    204 No Content

    Provisioning

    Provisioning can be accomplished both via the web as well as via REST API calls.

    The provisioning is broken into three sections, Organizations, Users, and humming.

    Users

    The first User will be created during the initial creation of the Organization. Additional users can be programatically managed to allow an organization to systematically manage the users.

    Create a User

    # Notice that the quotes are escaped to take in the additional avatar image.
    # Single quotes (') do not allow variable expansions
    # Double quotes (") allow variable expansions
    avatar=$(base64 avatar.jpg) &&
    curl "/maapapi-dev2.vzmlab.com/v1/Users"
      -u "name:passwd"
      -d "{
        \"name\": \"Jane User\",
        \"avatar\": \"$avatar\"
      }"
    
    / Transport Library
    var $ = require('jquery');
    
    / Authentication
    var username = "user";
    var token = "token";
    
    / Request Object
    var requestObj = {
      "name": "Jane User",
      "avatar": "/9j/4AAQSkZJRgABAQEASABIAAD/4gxYSUNDX1BST0ZJTEUAAQEAAAxITGlubwIQAABtbnRyUkdCIFhZWiAHzgACAAkABgAxAABhY3NwTVNGVAAAAABJRUMgc1JHQgAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLUhQICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFjcHJ0AAABUAAAADNkZXNjAAABhAAAAGx3dHB0AAAB8AAAABRia3B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aqJaKKS09Vax7NCdJYSNmtrOPmez/ALNfwJ0bwpqkXiae8e5uZbNo7VCiiNBKPnI67mwMV6j44s5bHxRex6XcR7bhQ8lrkhVJXeeADzjkA9q+WfBX7T/hXQ9Fgg1CW4uXgVRGFBLDHGxc9Rxwau/Dr4sQ+IPFd1rOpRxwjUrnykRjkQFf+PY57YGUJ9SK9TK8NxFUzjGYrGe0dP2fInJWUrP3Ul5K54eZKlKnFq3Nfp0P/9k="
    };
    
    var xhr = $.ajax({
      method: "POST",
      username: username,
      password: token,
      url: "/maapapi-dev2.vzmlab.com/v1/Users",
      dataType: "json",
      data: requestObj
    }).done(function(data, textStatus,jqXhr) {
      console.log('Response: %o', data);
    }).fail(function(jqXhr, textStatus, errorThrown) {
      console.log("My request went sideways.");
    });
    

    Posting the following data

    {
      "name": "Jane User",
      "avatar": "/9j/4AAQSkZJRgABAQEASABIAAD/4gxYSUNDX1BST0ZJTEUAAQEAAAxITGlubwIQAABtbnRyUkdCIFhZWiAHzgACAAkABgAxAABhY3NwTVNGVAAAAABJRUMgc1JHQgAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLUhQICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFjcHJ0AAABUAAAADNkZXNjAAABhAAAAGx3dHB0AAAB8AAAABRia3B0AAACBAAAABRyWFlaAAACGAAAABRnWFlaAAACLAAAABRiWFlaAAACQAAAABRkbW5kAAACVAAAAHBkbWRkAAACxAAAAIh2dWVkAAADTAAAAIZ2aWV3AAAD1AAAACRsdW1pAAAD+AAAABRtZWFzAAAEDAAAACR0ZWNoAAAEMAAAAAxyVFJDAAAEPAAACAxnVFJDAAAEPAAACAxiVFJDAAAEPAAACAx0ZXh0AAAAAENvcHlyaWdodCAoYykgMTk5OCBIZXdsZXR0LVBhY2thcmQgQ29tcGFueQAAZGVzYwAAAAAAAAASc1JHQiBJRUM2MTk2Ni0yLjEAAAAAAAAAAAAAABJzUk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3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APo74oeJIbDwRqFvZfub/UQouJpgN4hizlcbiAp42r2Bql8JPijplno+j2c0wtkEC4U/KMu2NzFsfffgevavKfEOqSeNPtENnATdXc0xVflZY7WDK+cxHCqxGT7YrwzxRp+iaDaadoerzR6i8NzBc2ssc32e3Rol8zErn5s8nCdSOc1+R51hcPioYbD1Jy57yk4ws5LSylZ6aH6LlWGq1p1Ixgm24pNuyb7XP2+m8R6S9mY7lVaG4QrIkigqysMEMD2I4Nfkxd2XxH+Hms6pP4PaLU/D0d9Ol5pM7kpGucknPKYBxvX8a6278c+HPGHhaw0+TWLGe68+CWSG1ukV90EwkVWUEkx8At34r3jU9R02J4NVsbSSS4EH+lxnO2ZUxmPzR92QZzGT1HyniufhzD5hhef29SU01yunJe6rPRp+hhm2FhhaqguW7b1UuZNLQ8G/Zutorrwj4gvWZY5bic2wI6pFCMBOh+Xkkisb4xfDO31PwtrcjbIoIZIpowAqlD0y7Ocl8nqexxXyv4B+Klr8Ptd1fT71XbT78rIkg6RuBtx9CO9ev/Ez9onQ/EWj2ulWrILaaX/TSwBJiT5gE7BiR3ryMdl2eU+JZYilTm6dSpGaqJaKKS09Vax7NCdJYSNmtrOPmez/ALNfwJ0bwpqkXiae8e5uZbNo7VCiiNBKPnI67mwMV6j44s5bHxRex6XcR7bhQ8lrkhVJXeeADzjkA9q+WfBX7T/hXQ9Fgg1CW4uXgVRGFBLDHGxc9Rxwau/Dr4sQ+IPFd1rOpRxwjUrnykRjkQFf+PY57YGUJ9SK9TK8NxFUzjGYrGe0dP2fInJWUrP3Ul5K54eZKlKnFq3Nfp0P/9k="
    }
    

    Returns JSON structured like this:

    {
      "id": "80a48ab28c7de474",
      "name": "Jane User",
      "avatar": {
        "href": "images/avatar.jpg"
      }
    }
    

    This endpoint creates a new user.

    Requires admin role.

    HTTP Request

    POST /maapapi-dev2.vzmlab.com/v1/Users

    Query Parameters

    Property Name Required Type Description
    name Y String The name of the User
    avatar N String (Base64) Base64 encoded image

    HTTP Response

    201 Created if successful.

    Returns the full User object. The ~id~ attribute is unique for the user and should be retained for future usage.

    Retrieve a User

    curl "/maapapi-dev2.vzmlab.com/v1/Users/80a48ab28c7de474"
      -u "name:passwd"
    
    / Transport Library
    var $ = require('jquery');
    
    / Authentication
    var username = "user";
    var token = "token";
    
    / User id
    var userId = "80a48ab28c7de474";
    
    var xhr = $.ajax({
      method: "GET",
      username: username,
      password: token,
      url: "/maapapi-dev2.vzmlab.com/v1/Users/" + userId,
      dataType: "json",
      data: requestObj
    }).done(function(data, textStatus,jqXhr) {
      console.log('Response: %o', data);
    }).fail(function(jqXhr, textStatus, errorThrown) {
      console.log("My request went sideways.");
    });
    

    Returns JSON structured like this:

    {
      "id": "80a48ab28c7de474",
      "name": "Jane \"the Powerful\" User",
      "avatar": {
        "href": "images/avatar.jpg"
      }
    }
    

    Retrieves the full User object given a user id.

    HTTP Request

    GET /maapapi-dev2.vzmlab.com/v1/Users/{id}

    HTTP Response

    200 Success if successful.

    Update an existing User

    curl "/maapapi-dev2.vzmlab.com/v1/Users/80a48ab28c7de474"
      -X PUT
      -u "name:passwd"
      -d '{
        "name": "Jane \"the Powerful\" User"
      }'
    
    / Transport Library
    var $ = require('jquery');
    
    / Authentication
    var username = "user";
    var token = "token";
    
    / User id
    var userId = "80a48ab28c7de474";
    
    / Request Object
    var requestObj = {
      "name": "Jane \"the Powerful\" User"
    };
    
    var xhr = $.ajax({
      method: "PUT",
      username: username,
      password: token,
      url: "/maapapi-dev2.vzmlab.com/v1/Users/" + userId,
      dataType: "json",
      data: requestObj
    }).done(function(data, textStatus,jqXhr) {
      console.log('Response: %o', data);
    }).fail(function(jqXhr, textStatus, errorThrown) {
      console.log("My request went sideways.");
    });
    

    Putting the following data

    {
      "name": "Jane \"the Powerful\" User"
    }
    

    Returns JSON structured like this:

    {
      "id": "80a48ab28c7de474",
      "name": "Jane \"the Powerful\" User",
      "avatar": {
        "href": "images/avatar.jpg"
      }
    }
    

    Updates the full User object given a user id.

    HTTP Request

    PUT /maapapi-dev2.vzmlab.com/v1/Users/{id}

    Query Parameters

    Property Name Required Type Description
    name Y String The name of the User
    avatar N String (Base64) Base64 encoded image

    HTTP Response

    200 Success if successful.

    Returns the full User object. The ~id~ attribute is unique for the user and should be retained for future usage.

    Delete a User

    curl "/maapapi-dev2.vzmlab.com/v1/Users/80a48ab28c7de474"
      -X DELETE
      -u "name:passwd"
    
    / Transport Library
    var $ = require('jquery');
    
    / Authentication
    var username = "user";
    var token = "token";
    
    / User id
    var userId = "80a48ab28c7de474";
    
    var xhr = $.ajax({
      method: "DELETE",
      username: username,
      password: token,
      url: "/maapapi-dev2.vzmlab.com/v1/Users/" + userId
    }).done(function(data, textStatus,jqXhr) {
      / No data
      console.log('Success!');
    }).fail(function(jqXhr, textStatus, errorThrown) {
      console.log("My request went sideways.");
    });
    

    Deletes the User given a user id.

    HTTP Request

    DELETE /maapapi-dev2.vzmlab.com/v1/Users/{id}

    HTTP Response

    204 No Content if successful.

    Bots

    A Bot is like a connection into something magical!

    Create a Bot

    # Notice that the quotes are escaped to take in the additional avatar image.
    # Single quotes (') do not allow variable expansions
    # Double quotes (") allow variable expansions
    avatar=$(base64 botvatar.jpg) &&
    curl "/maapapi-dev2.vzmlab.com/v1/Bots"
      -u "name:passwd"
      -d "{
        \"name\": \"Gene Bot\",
        \"avatar\": \"$avatar\"
        \"longCode\": \"9250001234\",
        \"callbackUri\": \"/YOUR_SERVER/lord_of_the_callbacks\"
      }"
    
    / Transport Library
    var $ = require('jquery');
    
    / Authentication
    var username = "user";
    var token = "token";
    
    / Request Object
    var requestObj = {
      "name": "Gene Bot",
      "avatar": "/9j/4AAQSkZJRgABAQEASABIAAD/4gxYSUNDX1BST0ZJTEUAAQEAAAxITGlubwIQAABtbnRyUkdCIFhZWiA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FhhaqguW7b1UuZNLQ8G/Zutorrwj4gvWZY5bic2wI6pFCMBOh+Xkkisb4xfDO31PwtrcjbIoIZIpowAqlD0y7Ocl8nqexxXyv4B+Klr8Ptd1fT71XbT78rIkg6RuBtx9CO9ev/Ez9onQ/EWj2ulWrILaaX/TSwBJiT5gE7BiR3ryMdl2eU+JZYilTm6dSpGaqJaKKS09Vax7NCdJYSNmtrOPmez/ALNfwJ0bwpqkXiae8e5uZbNo7VCiiNBKPnI67mwMV6j44s5bHxRex6XcR7bhQ8lrkhVJXeeADzjkA9q+WfBX7T/hXQ9Fgg1CW4uXgVRGFBLDHGxc9Rxwau/Dr4sQ+IPFd1rOpRxwjUrnykRjkQFf+PY57YGUJ9SK9TK8NxFUzjGYrGe0dP2fInJWUrP3Ul5K54eZKlKnFq3Nfp0P/9k=",
      "longCode": "9250001234",
      "callbackUri": "/YOUR_SERVER/lord_of_the_callbacks"
    };
    
    var xhr = $.ajax({
      method: "POST",
      username: username,
      password: token,
      url: "/maapapi-dev2.vzmlab.com/v1/Bots",
      dataType: "json",
      data: requestObj
    }).done(function(data, textStatus,jqXhr) {
      console.log('Response: %o', data);
    }).fail(function(jqXhr, textStatus, errorThrown) {
      console.log("My request went sideways.");
    });
    

    Posting the following data

    {
      "name": "Gene Bot",
      "avatar": "/9j/4AAQSkZJRgABAQEASABIAAD/4gxYSUNDX1BST0ZJTEUAAQEAAAxITGlubwIQAABtbnRyUkdCIFhZWiAHzgACAAkABgAxAABhY3NwTVNGVAAAAABJRUMgc1JHQgAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLUhQICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFjcHJ0AAABUAAAADNkZXNjAAABhAAAAGx3dHB0AAAB8AAAABRia3B0AAACBAAAABRyWFlaAAACGAAAABRnWFlaAAACLAAAABRiWFlaAAACQAAAABRkbW5kAAACVAAAAHBkbWRkAAACxAAAAIh2dWVkAAADTA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JXeeADzjkA9q+WfBX7T/hXQ9Fgg1CW4uXgVRGFBLDHGxc9Rxwau/Dr4sQ+IPFd1rOpRxwjUrnykRjkQFf+PY57YGUJ9SK9TK8NxFUzjGYrGe0dP2fInJWUrP3Ul5K54eZKlKnFq3Nfp0P/9k=",
      "longCode": "9250001234",
      "callbackUri": "/YOUR_SERVER/lord_of_the_callbacks"
    }
    

    Returns JSON structured like this:

    {
      "id": "90b5847110006a7c5e29bd7786",
      "name": "Gene Bot",
      "avatar": {
        "href": "/images/botvatar.jpg"
      },
      "longCode": "9250001234",
      "callbackUri": "/YOUR_SERVER/lord_of_the_callbacks"
    }
    

    This endpoint creates a new user.

    Requires admin role.

    HTTP Request

    POST /maapapi-dev2.vzmlab.com/v1/Bots

    Query Parameters

    Property Name Required Type Description
    name Y String The name of the Bot
    avatar N String (Base64) Base64 encoded image
    longCode Y String The longCode for this Bot.
    callbackUri Y String The callback URI for this Bot. Replies, Delivery Receipts, etc. will be handled by this endpoint.

    HTTP Response

    201 Created if successful.

    Returns the full Bot object. The ~id~ attribute is unique for the Bot and should be retained for future usage.

    Retrieve all the Bots

    curl "/maapapi-dev2.vzmlab.com/v1/Bots"
      -u "name:passwd"
    
    / Transport Library
    var $ = require('jquery');
    
    / Authentication
    var username = "user";
    var token = "token";
    
    / Bot id
    var botId = "90b5847110006a7c5e29bd7786";
    
    var xhr = $.ajax({
      method: "GET",
      username: username,
      password: token,
      url: "/maapapi-dev2.vzmlab.com/v1/Bots"
    }).done(function(data, textStatus,jqXhr) {
      console.log('Response: %o', data);
    }).fail(function(jqXhr, textStatus, errorThrown) {
      console.log("My request went sideways.");
    });
    

    Returns JSON structured like this:

    {
      "bots": [
        {
          "id": "90b5847110006a7c5e29bd7786",
          "name": "Gene Bot",
          "avatar": {
            "href": "/images/botvatar.jpg"
          },
          "longCode": "9250001234",
          "callbackUri": "/YOUR_SERVER/lord_of_the_callbacks"
        }
      ]
    }
    

    Retrieves all the full Bot objects.

    HTTP Request

    GET /maapapi-dev2.vzmlab.com/v1/Bots

    HTTP Response

    200 Success if successful.

    Retrieve a Bot

    curl "/maapapi-dev2.vzmlab.com/v1/Bots/90b5847110006a7c5e29bd7786"
      -u "name:passwd"
    
    / Transport Library
    var $ = require('jquery');
    
    / Authentication
    var username = "user";
    var token = "token";
    
    / Bot id
    var botId = "90b5847110006a7c5e29bd7786";
    
    var xhr = $.ajax({
      method: "GET",
      username: username,
      password: token,
      url: "/maapapi-dev2.vzmlab.com/v1/Bots/" + botId
    }).done(function(data, textStatus,jqXhr) {
      console.log('Response: %o', data);
    }).fail(function(jqXhr, textStatus, errorThrown) {
      console.log("My request went sideways.");
    });
    

    Returns JSON structured like this:

    {
      "id": "90b5847110006a7c5e29bd7786",
      "name": "Gene Bot",
      "avatar": {
        "href": "/images/botvatar.jpg"
      },
      "longCode": "9250001234",
      "callbackUri": "/YOUR_SERVER/lord_of_the_callbacks"
    }
    

    Retrieves the full Bot object given a Bot id.

    HTTP Request

    GET /maapapi-dev2.vzmlab.com/v1/Bots/{id}

    HTTP Response

    200 Success if successful.

    Update an existing Bot

    curl "/maapapi-dev2.vzmlab.com/v1/Bots/90b5847110006a7c5e29bd7786"
      -X PUT
      -u "name:passwd"
      -d '{
        "name": "Gene \"the Powerful\" Bot"
      }'
    
    / Transport Library
    var $ = require('jquery');
    
    / Authentication
    var username = "user";
    var token = "token";
    
    / Bot id
    var botId = "90b5847110006a7c5e29bd7786";
    
    / Request Object
    var requestObj = {
      "name": "Gene \"the Powerful\" Bot"
    };
    
    var xhr = $.ajax({
      method: "PUT",
      username: username,
      password: token,
      url: "/maapapi-dev2.vzmlab.com/v1/Bots/" + botId,
      dataType: "json",
      data: requestObj
    }).done(function(data, textStatus,jqXhr) {
      console.log('Response: %o', data);
    }).fail(function(jqXhr, textStatus, errorThrown) {
      console.log("My request went sideways.");
    });
    

    Putting the following data

    {
      "name": "Gene \"the Powerful\" Bot"
    }
    

    Returns JSON structured like this:

    {
      "id": "90b5847110006a7c5e29bd7786",
      "name": "Gene \"the Powerful\" Bot",
      "avatar": {
        "href": "/images/botvatar.jpg"
      },
      "longCode": "9250001234",
      "callbackUri": "/YOUR_SERVER/lord_of_the_callbacks"
    }
    

    Updates the full Bot object given a Bot id.

    HTTP Request

    PUT /maapapi-dev2.vzmlab.com/v1/Bots/{id}

    Query Parameters

    Property Name Required Type Description
    name Y String The name of the Bot
    avatar N String (Base64) Base64 encoded image

    HTTP Response

    200 Success if successful.

    Returns the full Bot object. The ~id~ attribute is unique for the Bot and should be retained for future usage.

    Delete a Bot

    curl "/maapapi-dev2.vzmlab.com/v1/Bots/90b5847110006a7c5e29bd7786"
      -X DELETE
      -u "name:passwd"
    
    / Transport Library
    var $ = require('jquery');
    
    / Authentication
    var username = "user";
    var token = "token";
    
    / Bot id
    var botId = "90b5847110006a7c5e29bd7786";
    
    var xhr = $.ajax({
      method: "DELETE",
      username: username,
      password: token,
      url: "/maapapi-dev2.vzmlab.com/v1/Bots/" + botId
    }).done(function(data, textStatus,jqXhr) {
      / No data
      console.log('Success!');
    }).fail(function(jqXhr, textStatus, errorThrown) {
      console.log("My request went sideways.");
    });
    

    Deletes the Bot given a user id.

    HTTP Request

    DELETE /maapapi-dev2.vzmlab.com/v1/Bots/{id}

    HTTP Response

    204 No Content if successful.

    Response Codes

    The MAAP API uses the following error codes:

    Error Code Meaning
    200 Success -- Yeah! You rock! Your request was valid and OK!
    201 Created -- Oh Yeah! Your request has created whatever it was suppose to create.
    204 No Content -- It's like a wink, you know it's good but there's nothing said.
    400 Bad Request -- Your request sucks.
    401 Unauthorized -- Your API key is wrong.
    403 Forbidden -- These aren't the droids you're looking for... Perhaps having right role will prove useful to you.
    404 Not Found -- ¯_(ツ)_/¯ - Whatever you wanted, I don't seem to have.
    405 Method Not Allowed -- You tried to access me with an invalid method.
    406 Not Acceptable -- You requested a format that isn't json.
    418 I'm a teapot.
    429 Too Many Requests -- Woao there! Settle down! You're trying to rustle up too many cattle at once! Slow your request roll!
    500 Internal Server Error -- We had a problem with our server. Try again later.
    503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.