cloudwi.re SMS API

Account Reporting

The account resource provides a method to view all stores that exist within an account. It will include store data such as as store name, compliance admins, template content, callback URLs and keywords along with their type. Additionally, this resource provides a method to check a mobile number for opt-in status across all stores within the account.

Subscriber Status - Account Level

Open in API Explorer
GET /subscriber/status/19994443333

This method allows the developer to retrieve the opt-in status of a mobile subscriber for all stores within the account where the subscriber exists in any status. If the subscriber has never communicated with the store at any level, they will not be displayed.

The mobileId will be inserted in the URL of the request.

Example Request

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

url = URI("https://moonbeamapi.cloudwi.re/subscriber/status/19994443333")

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": "/subscriber/status/19994443333",
  "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", "/subscriber/status/19994443333", 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/subscriber/status/19994443333",
  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/subscriber/status/19994443333"

	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 Pass

The subscriber's status within all stores in the account.

Account Reporting Subscriber's status by account
{
  "status": "pass",
String
  "code": 200,
Integer
  "message": "Subscriber’s Opt-In Status for all stores in the account.",
String
  "results": {
  "results": { ... }
Object
    "created": "09/22/2016 04:36:48",
String
    "number": "+19994443333",
String
    optIns: [
Array
      {
      { ... }
Object

Optins

        "commChannel": "foo",
String
        "subscriberStatus": "Opted-Out",
String
        "created": "09/22/2016 04:36:48",
String
        "keywordType": "foo",
String
        "shortCode": "foo",
String
        "keywordId": "57e2a65ed16a104975fccfbd",
String
        "storeId": "57e2a65ed16a104975fccfbd",
String
        "storeName": "Jim's Pizza West",
String
        "accountId": "57e2a618d16a104a75fccfc0",
String
        "keyword": "horse1",
String
        "optInAttempts": 0
Integer
      }
    ]
    "id": "57e35fe0d16a10360f8b4567"
String
  }
}
400 Subscriber Does Not Exist

The subscriber does not exist at any level in your account.

(Empty Response)

Account Details

Open in API Explorer
GET /account/details/ACCOUNTID

This method allows the developer to view data on all stores that exist under the account. The data returned will include the store's compliance information and templates, keywords and subscriber counts.

The accountId will be passed in the URL of the request.

Example Request

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

url = URI("https://moonbeamapi.cloudwi.re/account/details/ACCOUNTID")

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": "/account/details/ACCOUNTID",
  "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", "/account/details/ACCOUNTID", 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/account/details/ACCOUNTID",
  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/account/details/ACCOUNTID"

	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 PASS

Account Details

Account Reporting Account overview
{
  "status": "pass",
String
  "code": 200,
Integer
  "message": "Account Details",
String
  "results": {
  "results": { ... }
Object
    "accountName": "cloudwi.re",
String
    "apiKey": "Token",
String
    "created": "12/15/2016 12:44:17",
String
    "id": "5851e761d16a1039218b4568",
String
    "legacy": false,
Boolean
    "mCreated": {
    "mCreated": { ... }
Object
      "sec": 1488526949,
Integer
      "usec": 0
Integer
    },
    "salt": "a35733a",
String
    store: [
Array
      {
      { ... }
Object

Store

        "storeName": "cloudwi.re",
String
        "timeZone": "Pacific",
String
        "inboundCallbackURL": "https://mycallback.com/inboundmessages",
String
        "messageStatusURL": "https://mycallback.com/notifications",
String
        "compliancePhone": "9994447777",
String
        "complianceEmail": "support@cloudwi.re",
String
        "_id": {
        "_id": { ... }
Object
          "$id": "5851ed6ad16a1248b457d"
String
        },
        "mCreated": {
        "mCreated": { ... }
Object
          "sec": 1488850186,
Integer
          "usec": 0
Integer
        },
        "created": "12/15/2016 01:10:01",
String
        "template": {
        "template": { ... }
Object
          "helpMessage": "cloudwi.re Alerts & Offers. Msg&Data rates may apply. Max 5msgs/mth. Reply HELP for help, STOP to quit. 9994447777.",
String
          "stopMessage": "You have opted-out of cloudwi.re alerts and will not receive any more messages.",
String
          "requestMessage": "Reply YES to join cloudwi.re Alerts & Offers. Msg&Data rates may apply. Max 5msgs/mth. Reply HELP for help, STOP to quit.",
String
          "confirmationMessage": "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
          "alreadyOptedInMessage": "You are already opted-in to cloudwi.re"
String
        },
        keyword: [
Array
          {
          { ... }
Object

Keyword

            "keywordType": "responder",
String
            "shortCode": "+444999",
String
            "keyword": "cloudwi.re",
String
            "mCreated": {
            "mCreated": { ... }
Object
              "sec": 1488850186,
Integer
              "usec": 0
Integer
            },
            "created": "12/15/2016 01:59:04",
String
            "_id": {
            "_id": { ... }
Object
              "$id": "5851f8e8a1047278b4579"
String
            },
            "mediaUrl": "https://cloudwi.re/image123.jpg",
String
            "responderContent": "Check out cloudwi.re!"
String
          }
        ]
        "settings": {
        "settings": { ... }
Object
          "confirmation": "enabled",
String
          "already": "enabled"
String
        }
      }
    ]
    "suspended": false,
Boolean
    user: [
Array
      {
      { ... }
Object

User

        "_id": {
        "_id": { ... }
Object
          "$id": "5851e766a1039218b4567"
String
        },
        "accountName": "cloudwi.re",
String
        "firstName": "Awesome",
String
        "lastName": "Sauce",
String
        "email": "awesomesauce@cloudwi.re",
String
        "phone": "9994447777",
String
        "mCreated": {
        "mCreated": { ... }
Object
          "sec": 1488850186,
Integer
          "usec": 0
Integer
        },
        "created": "12/15/2016 12:44:17"
String
      }
    ]
  }
}
400 Invalid Account ID

Invalid Account ID. Please check and try again.

(Empty Response)