cloudwi.re SMS API

Messaging

The five methods in the messaging resource allow you to send messages to opted-in subscribers, reply to responder keywords and send bulk SMS/MMS campaigns. You can also retrieve the delivery status of all of your store messages.

Message Status

Open in API Explorer
GET /message/status/MESSAGETRANSACTIONID

This method allows the developer to retrieve the status of any outbound mobile terminated message sent to the SMS API that involves the Single Messaging Class. That includes the subscriber opt-in methods, Send Message and Send Responder Keyword Message. When using the mentioned methods, cloudwi.re will respond with a tranasactionId. The transactionId will be used in the URL when calling Get Message Status.

It does not include any messages sent via Send Campaign. Status reports for any campaigns can be retrieved in the Campaign Status method.

cloudwi.re recommends to developers that a timer set to a minimum of 5 seconds be set and allowed to pass before retrieving message status. Although generally, the carriers report the final status in a few seconds, this process can sometimes take longer during high queuing events.

The platform will pass a 204 if a message is still awaiting an update from the carriers so that you know to retry the request.

Example Request

Format:
curl --request GET \
  --url https://moonbeamapi.cloudwi.re/message/status/MESSAGETRANSACTIONID \
  --header 'accept: application/json' \
  --header 'authorization: Bearer SOME.JWT.TOKEN'
require 'uri'
require 'net/http'

url = URI("https://moonbeamapi.cloudwi.re/message/status/MESSAGETRANSACTIONID")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer SOME.JWT.TOKEN'

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "moonbeamapi.cloudwi.re",
  "port": null,
  "path": "/message/status/MESSAGETRANSACTIONID",
  "headers": {
    "accept": "application/json",
    "authorization": "Bearer SOME.JWT.TOKEN"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("moonbeamapi.cloudwi.re")

headers = {
    'accept': "application/json",
    'authorization': "Bearer SOME.JWT.TOKEN"
    }

conn.request("GET", "/message/status/MESSAGETRANSACTIONID", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://moonbeamapi.cloudwi.re/message/status/MESSAGETRANSACTIONID",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: Bearer SOME.JWT.TOKEN"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://moonbeamapi.cloudwi.re/message/status/MESSAGETRANSACTIONID"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "Bearer SOME.JWT.TOKEN")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Responses

200 Message Blocked

Your message was blocked by cloudwi.re

Messaging Cloudwi.re blocked
{
  "status": "pass",
String
  "code": 200,
Integer
  "message": "Message Status",
String
  results: [
Array
    {
    { ... }
Object

Results

      "transactionId": "58c8d043d16a10ff7259d61e",
String
      "created": "03/15/2017 05:25:23",
String
      "mobileId": "+19994447777",
String
      "message": "Your're right. Michigan football is still a joke. Here's your $10 Buckeye Cash for entering!",
String
      "mediaUrl": "https://cloudwi.re/buckeyes614.jpg",
String
      "errorMessage": {
      "errorMessage": { ... }
Object
        "status": "fail",
String
        "message": "The subscriber is either in Opted-Out, Pending or Locked status or does not exist.",
String
        "messageId": "foo",
String
        "details": "{\"created\":\"03\\/15\\/2017 05:25:24\",\"storeId\":\"5847a690d16a10e867fb4627\",\"mobileID\":\"19994447777\",\"transactionId\":\"58c8d043d16a10ff7259d61e\"}"
String
      },
      "statuses": [
    "foo",
    "foo",
    "foo"
  ]
Array
    }
  ]
}
200 Carrier Receipt

The delivery status of your message.

Messaging Carrier receipt
{
  "status": "pass",
String
  "code": 200,
Integer
  "message": "Message Status",
String
  results: [
Array
    {
    { ... }
Object

Results

      "transactionId": "58ca38c4d16a105b1c59d657",
String
      "created": "03/16/2017 07:03:32",
String
      "mobileId": "+19994447777",
String
      "message": "You have opted-in to cloudwi.re Alerts & Offers. Msg&Data rates may apply. Max 5msgs/mth. Reply HELP for help, STOP to quit.",
String
      "mediaUrl": "foo",
String
      "messageId": "SM9decd189061c4ce5b0cc22887623d0d2",
String
      "errorMessage": {
      "errorMessage": { ... }
Object
      },
      statuses: [
Array
        {
        { ... }
Object

Statuses

          "action": "delivered",
String
          "message": "foo",
String
          "errorCode": "foo",
String
          "created": "03/16/2017 07:03:33"
String
        }
      ]
    }
  ]
}
204 Message Queued

Your message is queued and awaiting carrier delivery status.

Messaging Awaiting update
{
  "status": "pass",
String
  "code": 200,
Integer
  "message": "The message is queued and awaiting an update from the upstream carriers.  You may retry your request later.",
String
  "results": [
    "foo",
    "foo",
    "foo"
  ]
Array
}
400 Invalid Transaction ID

Please check the transaction ID and try again.

(Empty Response)

Send Campaign

Open in API Explorer
POST /message/send/campaign

This method allows the developer to send either an SMS or MMS (or both together) message campaign to selected subscribers within your store. The method takes advantage of queuing on our short code stack and gives the developer high throttle to deliver the campaign at around 18k messages per minute. By default, all calls to this method will go out on the communication short code that the subscriber is assigned to by cloudwi.re for the requested store. If the subscriber is not opted-in the message will be blocked.

With this method, you will pass cloudwi.re a JSON array of your subscribers receiving the campaign. You may send as many messages as you'd like in the call. See a sample request and mobileList here. Additionally, you can customize the message and media URL for each subscriber you are sending the campaign too. Within the array a 'number' is required. A 'message' or 'mediaUrl' is required as well. You may also pass us both.

The cloudwi.re SMS API will receive the data with a 200 if successful and begin queuing up the campaign and checking the opt-in status of each subscriber you wish to campaign too. The API will then begin sending the campaign at the maximum available throttle.

Any subscribers who are not in an opted-in state will be reported to the notification URL and dropped from the campaign. Invalid Media URLs will also be reported to the notification URL. TEST before you send!

Remember that when sending us large campaigns, give the API time to consume your request. A 300k message campaign takes time to consume.

Considerations

  • Did you scrub for duplicate mobile numbers? It's a really good idea before you hit send!
  • The subscriber must be opted-in or the message will be blocked.
  • Store the transaction ID returned to you with a 200 if you want to get a delivery report.
  • Messages are limited to 1600 characters, but we advise 160 because of this. Keep your message short and sweet and you'll be rewarded with better response rates.
  • MMS is limited to 5mb for pictures and 455kb for audio/video. Refer to our MMS supported media for more info on supported URL types for MMS.
  • MMS to carriers who do not support it will be sent as a URL.
  • Use '\n' to create line breaks inside the message. Read more on that here and make sure you TEST!

Example Request

Format:
curl --request POST \
  --url https://moonbeamapi.cloudwi.re/message/send/campaign \
  --header 'accept: application/json' \
  --header 'authorization: Bearer SOME.JWT.TOKEN' \
  --header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
  --form storeId=5847a690d16a867fb4627 \
  --form 'mobileList=[{"number":"14155964193","message":"I love the ponies!","mediaUrl":"http://i57.tinypic.com/muk4g4.png"}],[{"number":"14155964193","message":"I love the ponies!","mediaUrl":"http://i57.tinypic.com/muk4g4.png"}],[{"number":"14155964193","message":"I love the ponies!","mediaUrl":"http://i57.tinypic.com/muk4g4.png"}]' \
  --form 'test=[{"number":"14155964193","message":"Maybe next week!"}, {"number":"14155964193","message":"Maybe next week!"}],[{"number":"14155964193","message":"Maybe next week!"}, {"number":"14155964193","message":"Maybe next week!"}],[{"number":"14155964193","message":"Maybe next week!"}, {"number":"14155964193","message":"Maybe next week!"}]'
require 'uri'
require 'net/http'

url = URI("https://moonbeamapi.cloudwi.re/message/send/campaign")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer SOME.JWT.TOKEN'
request["content-type"] = 'multipart/form-data; boundary=---011000010111000001101001'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\n5847a690d16a867fb4627\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobileList\"\r\n\r\n[{\"number\":\"14155964193\",\"message\":\"I love the ponies!\",\"mediaUrl\":\"http://i57.tinypic.com/muk4g4.png\"}],[{\"number\":\"14155964193\",\"message\":\"I love the ponies!\",\"mediaUrl\":\"http://i57.tinypic.com/muk4g4.png\"}],[{\"number\":\"14155964193\",\"message\":\"I love the ponies!\",\"mediaUrl\":\"http://i57.tinypic.com/muk4g4.png\"}]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"test\"\r\n\r\n[{\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}, {\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}],[{\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}, {\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}],[{\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}, {\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}]\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "POST",
  "hostname": "moonbeamapi.cloudwi.re",
  "port": null,
  "path": "/message/send/campaign",
  "headers": {
    "accept": "application/json",
    "authorization": "Bearer SOME.JWT.TOKEN",
    "content-type": "multipart/form-data; boundary=---011000010111000001101001"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\n5847a690d16a867fb4627\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobileList\"\r\n\r\n[{\"number\":\"14155964193\",\"message\":\"I love the ponies!\",\"mediaUrl\":\"http://i57.tinypic.com/muk4g4.png\"}],[{\"number\":\"14155964193\",\"message\":\"I love the ponies!\",\"mediaUrl\":\"http://i57.tinypic.com/muk4g4.png\"}],[{\"number\":\"14155964193\",\"message\":\"I love the ponies!\",\"mediaUrl\":\"http://i57.tinypic.com/muk4g4.png\"}]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"test\"\r\n\r\n[{\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}, {\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}],[{\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}, {\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}],[{\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}, {\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}]\r\n-----011000010111000001101001--\r\n");
req.end();
import http.client

conn = http.client.HTTPSConnection("moonbeamapi.cloudwi.re")

payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\n5847a690d16a867fb4627\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobileList\"\r\n\r\n[{\"number\":\"14155964193\",\"message\":\"I love the ponies!\",\"mediaUrl\":\"http://i57.tinypic.com/muk4g4.png\"}],[{\"number\":\"14155964193\",\"message\":\"I love the ponies!\",\"mediaUrl\":\"http://i57.tinypic.com/muk4g4.png\"}],[{\"number\":\"14155964193\",\"message\":\"I love the ponies!\",\"mediaUrl\":\"http://i57.tinypic.com/muk4g4.png\"}]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"test\"\r\n\r\n[{\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}, {\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}],[{\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}, {\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}],[{\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}, {\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}]\r\n-----011000010111000001101001--\r\n"

headers = {
    'accept': "application/json",
    'authorization': "Bearer SOME.JWT.TOKEN",
    'content-type': "multipart/form-data; boundary=---011000010111000001101001"
    }

conn.request("POST", "/message/send/campaign", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://moonbeamapi.cloudwi.re/message/send/campaign",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\n5847a690d16a867fb4627\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobileList\"\r\n\r\n[{\"number\":\"14155964193\",\"message\":\"I love the ponies!\",\"mediaUrl\":\"http://i57.tinypic.com/muk4g4.png\"}],[{\"number\":\"14155964193\",\"message\":\"I love the ponies!\",\"mediaUrl\":\"http://i57.tinypic.com/muk4g4.png\"}],[{\"number\":\"14155964193\",\"message\":\"I love the ponies!\",\"mediaUrl\":\"http://i57.tinypic.com/muk4g4.png\"}]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"test\"\r\n\r\n[{\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}, {\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}],[{\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}, {\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}],[{\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}, {\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}]\r\n-----011000010111000001101001--\r\n",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: Bearer SOME.JWT.TOKEN",
    "content-type: multipart/form-data; boundary=---011000010111000001101001"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://moonbeamapi.cloudwi.re/message/send/campaign"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\n5847a690d16a867fb4627\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobileList\"\r\n\r\n[{\"number\":\"14155964193\",\"message\":\"I love the ponies!\",\"mediaUrl\":\"http://i57.tinypic.com/muk4g4.png\"}],[{\"number\":\"14155964193\",\"message\":\"I love the ponies!\",\"mediaUrl\":\"http://i57.tinypic.com/muk4g4.png\"}],[{\"number\":\"14155964193\",\"message\":\"I love the ponies!\",\"mediaUrl\":\"http://i57.tinypic.com/muk4g4.png\"}]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"test\"\r\n\r\n[{\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}, {\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}],[{\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}, {\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}],[{\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}, {\"number\":\"14155964193\",\"message\":\"Maybe next week!\"}]\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "Bearer SOME.JWT.TOKEN")
	req.Header.Add("content-type", "multipart/form-data; boundary=---011000010111000001101001")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Form Data Parameters

Name Type Required Description Example
storeId String Required

The store ID of the store you are sending the campaign from.

5847a690d16a867fb4627
mobileList Array Required

The list of mobile number, the message and mediaUrl. Either a message or mediaUrl is required. You can also send both.

[{"number":"14155964193","message":"I love the ponies!","mediaUrl":"http://i57.tinypic.com/muk4g4.png"}],[{"number":"14155964193","message":"I love the ponies!","mediaUrl":"http://i57.tinypic.com/muk4g4.png"}],[{"number":"14155964193","message":"I love the ponies!","mediaUrl":"http://i57.tinypic.com/muk4g4.png"}]
test Array Required

tester

[{"number":"14155964193","message":"Maybe next week!"}, {"number":"14155964193","message":"Maybe next week!"}],[{"number":"14155964193","message":"Maybe next week!"}, {"number":"14155964193","message":"Maybe next week!"}],[{"number":"14155964193","message":"Maybe next week!"}, {"number":"14155964193","message":"Maybe next week!"}]

Responses

200 PASS

Campaign Queued

Messaging Campaign queued
{
  "status": "pass",
String
  "code": 200,
Integer
  "message": "Campaign Queued",
String
  "results": {
  "results": { ... }
Object
    "transactionId": "58c8b153d16a10f91259d61a"
String
  }
}

Send Message

Open in API Explorer
POST /message/send/message

This method allows the developer to send a text or picture message (Or Both!) to an opted-in subscriber from the store you assign within your auth string. By default, all calls to this method will go out on the communication short code that the customer is assigned to by cloudwi.re for the requested store. This method is not to be utilized for sending bulk campaigns.

Considerations

  • If the subscriber is not opted-in cloudwi.re won't attempt a message.
  • Messages are limited to 1600 characters, but we advise 160 because of this. Keep your messages short and sweet and you'll have a more successful response rate.
  • MMS is limited to 5mb for pictures and 455kb for audio/video. Refer to our MMS supported media for more info on supported URL types for MMS.
  • Media URLs must begin with HTTP:// or HTTPS://
  • MMS to carriers who do not support it will be sent as a URL.
  • We have unpublished features for one and two way mobile alerts. Contact support@cloudwi.re.

Example Request

Format:
curl --request POST \
  --url https://moonbeamapi.cloudwi.re/message/send/message \
  --header 'accept: application/json' \
  --header 'authorization: Bearer SOME.JWT.TOKEN' \
  --header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
  --form storeId=5847a690d16a867fb4627 \
  --form mobileId=19994447777 \
  --form 'message=Everyone is a winner in the OSU v. Michigan blood battle.  Make sure you schedule your donation now!' \
  --form mediaUrl=https://cloudwi.re/buckeyes614.jpg
require 'uri'
require 'net/http'

url = URI("https://moonbeamapi.cloudwi.re/message/send/message")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer SOME.JWT.TOKEN'
request["content-type"] = 'multipart/form-data; boundary=---011000010111000001101001'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\n5847a690d16a867fb4627\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobileId\"\r\n\r\n19994447777\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"message\"\r\n\r\nEveryone is a winner in the OSU v. Michigan blood battle.  Make sure you schedule your donation now!\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mediaUrl\"\r\n\r\nhttps://cloudwi.re/buckeyes614.jpg\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "POST",
  "hostname": "moonbeamapi.cloudwi.re",
  "port": null,
  "path": "/message/send/message",
  "headers": {
    "accept": "application/json",
    "authorization": "Bearer SOME.JWT.TOKEN",
    "content-type": "multipart/form-data; boundary=---011000010111000001101001"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\n5847a690d16a867fb4627\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobileId\"\r\n\r\n19994447777\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"message\"\r\n\r\nEveryone is a winner in the OSU v. Michigan blood battle.  Make sure you schedule your donation now!\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mediaUrl\"\r\n\r\nhttps://cloudwi.re/buckeyes614.jpg\r\n-----011000010111000001101001--\r\n");
req.end();
import http.client

conn = http.client.HTTPSConnection("moonbeamapi.cloudwi.re")

payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\n5847a690d16a867fb4627\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobileId\"\r\n\r\n19994447777\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"message\"\r\n\r\nEveryone is a winner in the OSU v. Michigan blood battle.  Make sure you schedule your donation now!\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mediaUrl\"\r\n\r\nhttps://cloudwi.re/buckeyes614.jpg\r\n-----011000010111000001101001--\r\n"

headers = {
    'accept': "application/json",
    'authorization': "Bearer SOME.JWT.TOKEN",
    'content-type': "multipart/form-data; boundary=---011000010111000001101001"
    }

conn.request("POST", "/message/send/message", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://moonbeamapi.cloudwi.re/message/send/message",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\n5847a690d16a867fb4627\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobileId\"\r\n\r\n19994447777\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"message\"\r\n\r\nEveryone is a winner in the OSU v. Michigan blood battle.  Make sure you schedule your donation now!\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mediaUrl\"\r\n\r\nhttps://cloudwi.re/buckeyes614.jpg\r\n-----011000010111000001101001--\r\n",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: Bearer SOME.JWT.TOKEN",
    "content-type: multipart/form-data; boundary=---011000010111000001101001"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://moonbeamapi.cloudwi.re/message/send/message"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\n5847a690d16a867fb4627\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobileId\"\r\n\r\n19994447777\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"message\"\r\n\r\nEveryone is a winner in the OSU v. Michigan blood battle.  Make sure you schedule your donation now!\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mediaUrl\"\r\n\r\nhttps://cloudwi.re/buckeyes614.jpg\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "Bearer SOME.JWT.TOKEN")
	req.Header.Add("content-type", "multipart/form-data; boundary=---011000010111000001101001")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Form Data Parameters

Name Type Required Description Example
storeId String Required

The Store ID you are sending the message from.

5847a690d16a867fb4627
mobileId String Required

The mobile ID of the subscriber you are messaging.

19994447777
message String Optional

Self explanatory unless you are a Michigan fan. *Optional if sending media

Everyone is a winner in the OSU v. Michigan blood battle. Make sure you schedule your donation now!
mediaUrl String Optional

The URL of any media you wish to send. *Optional if message is included

https://cloudwi.re/buckeyes614.jpg

Responses

200 Pass

Message Queued

Messaging Message queued
{
  "status": "pass",
String
  "code": 200,
Integer
  "message": "Message Queued",
String
  "results": {
  "results": { ... }
Object
    "transactionId": "58c8b171d16a10361359d617"
String
  }
}
400 Message or Media URL Required

A message or media URL is required

(Empty Response)
400 Character Count Exceeded

Messages are capped at 1600 characters.

(Empty Response)
400 Invalid Media URL

Media URLs must begin with HTTP:// or HTTPS://

(Empty Response)

Campaign Status

Open in API Explorer
POST /message/campaign/status

This method allows the developer to request a campaign delivery status report via email. The file format selections are JSON or CSV. Currently, cloudwi.re does not notify the developer when a campaign ends. That is in the pipeline. We recommend that you add 2 minutes for each 10 thousand messages that you send.

Additionally, file sizes can get quite large. Please be patient for multiple megabyte file requests.

Example Request

Format:
curl --request POST \
  --url https://moonbeamapi.cloudwi.re/message/campaign/status \
  --header 'accept: application/json' \
  --header 'authorization: Bearer SOME.JWT.TOKEN' \
  --header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
  --form storeId=5847ad16a10e867fb4627 \
  --form transactionId=58006caad16a103b2d8d \
  --form fileType=CSV \
  --form email=reports@cloudwi.re
require 'uri'
require 'net/http'

url = URI("https://moonbeamapi.cloudwi.re/message/campaign/status")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer SOME.JWT.TOKEN'
request["content-type"] = 'multipart/form-data; boundary=---011000010111000001101001'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\n5847ad16a10e867fb4627\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"transactionId\"\r\n\r\n58006caad16a103b2d8d\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fileType\"\r\n\r\nCSV\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\nreports@cloudwi.re\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "POST",
  "hostname": "moonbeamapi.cloudwi.re",
  "port": null,
  "path": "/message/campaign/status",
  "headers": {
    "accept": "application/json",
    "authorization": "Bearer SOME.JWT.TOKEN",
    "content-type": "multipart/form-data; boundary=---011000010111000001101001"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\n5847ad16a10e867fb4627\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"transactionId\"\r\n\r\n58006caad16a103b2d8d\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fileType\"\r\n\r\nCSV\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\nreports@cloudwi.re\r\n-----011000010111000001101001--\r\n");
req.end();
import http.client

conn = http.client.HTTPSConnection("moonbeamapi.cloudwi.re")

payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\n5847ad16a10e867fb4627\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"transactionId\"\r\n\r\n58006caad16a103b2d8d\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fileType\"\r\n\r\nCSV\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\nreports@cloudwi.re\r\n-----011000010111000001101001--\r\n"

headers = {
    'accept': "application/json",
    'authorization': "Bearer SOME.JWT.TOKEN",
    'content-type': "multipart/form-data; boundary=---011000010111000001101001"
    }

conn.request("POST", "/message/campaign/status", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://moonbeamapi.cloudwi.re/message/campaign/status",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\n5847ad16a10e867fb4627\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"transactionId\"\r\n\r\n58006caad16a103b2d8d\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fileType\"\r\n\r\nCSV\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\nreports@cloudwi.re\r\n-----011000010111000001101001--\r\n",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: Bearer SOME.JWT.TOKEN",
    "content-type: multipart/form-data; boundary=---011000010111000001101001"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://moonbeamapi.cloudwi.re/message/campaign/status"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\n5847ad16a10e867fb4627\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"transactionId\"\r\n\r\n58006caad16a103b2d8d\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fileType\"\r\n\r\nCSV\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\nreports@cloudwi.re\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "Bearer SOME.JWT.TOKEN")
	req.Header.Add("content-type", "multipart/form-data; boundary=---011000010111000001101001")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Form Data Parameters

Name Type Required Description Example
storeId String Required

The Store ID that sent the campaign.

5847ad16a10e867fb4627
transactionId String Required

The Transaction ID returned to you when you executed the campaign.

58006caad16a103b2d8d
fileType String Required

The file type you need. Either 'JSON' or 'CSV'

CSV
email String Required

The email address for report delivery.

reports@cloudwi.re

Responses

200 Pass

Your Report has been received by the job queue.

(Empty Response)
400 Invalid Email Address

Really? Yes, really. Send us a valid email address.

(Empty Response)
400 Invalid Transaction ID

The transaction ID is invalid. Please check and try again.

(Empty Response)
400 Invalid File Type

Either 'JSON' or 'CSV' are accepted.

(Empty Response)

Send Responder Keyword Message

Open in API Explorer
POST /message/send/responderkeywordmessage

This method allows the developer to send a response to a subscriber that has sent a responder keyword to a cloudwi.re marketing short code. Keep in mind that cloudwi.re can automate this task for you using the Edit Responder Keyword Content in the Keyword Creation & Management resource.

But for those developers who wish to respond to keywords dynamically, this method will come in handy. cloudwi.re will validate your parameters for spam prevention. But if your parameters show the keyword and short code you request as belonging to your store, cloudwi.re will send the message.

This method does not lookup the subscriber's opt-in status and will be sent regardless. The subscriber is requesting only one response. Any additional follow-up messages utilizing this method to a subscriber is not compliant and is a violation of the cloudwi.re terms & conditions.

Considerations

  • Messages are limited to 1600 characters, but we advise 160 because of this.
  • MMS is limited to 5mb for pictures and 455kb for audio/video. Refer to our MMS supported media for more info on supported URL types for MMS.
  • Media URLs must begin with http:// or https://
  • MMS to carriers who do not support it will be sent as a URL.

Example Request

Format:
curl --request POST \
  --url https://moonbeamapi.cloudwi.re/message/send/responderkeywordmessage \
  --header 'accept: application/json' \
  --header 'authorization: Bearer SOME.JWT.TOKEN' \
  --header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
  --form storeId=5847a690d16a10e867f \
  --form mobileId=19994447777 \
  --form keywordId=5881b92fd16a1068d7881 \
  --form 'message=Your'\''re right.  Michigan football is still a joke.  Here'\''s your $10 Buckeye Cash for entering!' \
  --form mediaUrl=https://cloudwi.re/buckeyes614.jpg
require 'uri'
require 'net/http'

url = URI("https://moonbeamapi.cloudwi.re/message/send/responderkeywordmessage")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer SOME.JWT.TOKEN'
request["content-type"] = 'multipart/form-data; boundary=---011000010111000001101001'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\n5847a690d16a10e867f\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobileId\"\r\n\r\n19994447777\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"keywordId\"\r\n\r\n5881b92fd16a1068d7881\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"message\"\r\n\r\nYour're right.  Michigan football is still a joke.  Here's your $10 Buckeye Cash for entering!\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mediaUrl\"\r\n\r\nhttps://cloudwi.re/buckeyes614.jpg\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "POST",
  "hostname": "moonbeamapi.cloudwi.re",
  "port": null,
  "path": "/message/send/responderkeywordmessage",
  "headers": {
    "accept": "application/json",
    "authorization": "Bearer SOME.JWT.TOKEN",
    "content-type": "multipart/form-data; boundary=---011000010111000001101001"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\n5847a690d16a10e867f\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobileId\"\r\n\r\n19994447777\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"keywordId\"\r\n\r\n5881b92fd16a1068d7881\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"message\"\r\n\r\nYour're right.  Michigan football is still a joke.  Here's your $10 Buckeye Cash for entering!\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mediaUrl\"\r\n\r\nhttps://cloudwi.re/buckeyes614.jpg\r\n-----011000010111000001101001--\r\n");
req.end();
import http.client

conn = http.client.HTTPSConnection("moonbeamapi.cloudwi.re")

payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\n5847a690d16a10e867f\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobileId\"\r\n\r\n19994447777\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"keywordId\"\r\n\r\n5881b92fd16a1068d7881\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"message\"\r\n\r\nYour're right.  Michigan football is still a joke.  Here's your $10 Buckeye Cash for entering!\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mediaUrl\"\r\n\r\nhttps://cloudwi.re/buckeyes614.jpg\r\n-----011000010111000001101001--\r\n"

headers = {
    'accept': "application/json",
    'authorization': "Bearer SOME.JWT.TOKEN",
    'content-type': "multipart/form-data; boundary=---011000010111000001101001"
    }

conn.request("POST", "/message/send/responderkeywordmessage", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://moonbeamapi.cloudwi.re/message/send/responderkeywordmessage",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\n5847a690d16a10e867f\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobileId\"\r\n\r\n19994447777\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"keywordId\"\r\n\r\n5881b92fd16a1068d7881\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"message\"\r\n\r\nYour're right.  Michigan football is still a joke.  Here's your $10 Buckeye Cash for entering!\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mediaUrl\"\r\n\r\nhttps://cloudwi.re/buckeyes614.jpg\r\n-----011000010111000001101001--\r\n",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: Bearer SOME.JWT.TOKEN",
    "content-type: multipart/form-data; boundary=---011000010111000001101001"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://moonbeamapi.cloudwi.re/message/send/responderkeywordmessage"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\n5847a690d16a10e867f\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobileId\"\r\n\r\n19994447777\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"keywordId\"\r\n\r\n5881b92fd16a1068d7881\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"message\"\r\n\r\nYour're right.  Michigan football is still a joke.  Here's your $10 Buckeye Cash for entering!\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mediaUrl\"\r\n\r\nhttps://cloudwi.re/buckeyes614.jpg\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "Bearer SOME.JWT.TOKEN")
	req.Header.Add("content-type", "multipart/form-data; boundary=---011000010111000001101001")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Form Data Parameters

Name Type Required Description Example
storeId String Required

The Store ID that the keyword is assigned.

5847a690d16a10e867f
mobileId String Required

The mobile number receiving the message.

19994447777
keywordId String Required

The Keyword ID of the keyword the subscriber texted in.

5881b92fd16a1068d7881
message String Optional

Your return message. *Optional if MMS URL Selected

Your're right. Michigan football is still a joke. Here's your $10 Buckeye Cash for entering!
mediaUrl String Optional

The URL of any media you want to send to the subscriber.
Optional if message is included.

https://cloudwi.re/buckeyes614.jpg

Responses

200 Pass

Message Queued

Messaging Responder keyword pass
{
  "status": "pass",
String
  "code": 200,
Integer
  "message": "Send Responder Message",
String
  "results": {
  "results": { ... }
Object
    "transactionId": "58c8d0b8d16a10f61259d616"
String
  }
}
400 Character Count Exceeded

Messages are capped at 1600 characters.

(Empty Response)
400 Invalid Media URL

Media URLs must begin with HTTP:// or HTTPS://

(Empty Response)
400 Message or Media URL Required

A message or media URL is required.

(Empty Response)