cloudwi.re SMS API

Store Creation & Management

In the cloudwi.re architecture, we work within the store concept. This has multiple advantages both to us and to you. This allows us to properly route messages to the correct store, essentially by creating opt-in buckets. It also allows us to load balance opt-ins on the cloudwi.re communication short code stack. A store must exist for messages to flow in and out. So the first thing you will have to do before you test anything is to add a store. Once a mobile subscriber opts-in to one of your stores, we bind that mobile subscriber’s number to that store with a cloudwi.re short code. That bind will remain in place for the life of the opt-in or until the mobile subscriber opts-out.

The eight methods in this resource will allow you to: Add or delete stores, edit their templates and settings and retrieve subscriber status.

Store Subscribers by Paging

Open in API Explorer
GET /subscriber/bystore/STOREID/PAGENUMBER

The SMS API provides the developer with two methods to retrieve store subscribers by their opt-in status. This method is more reliable than the POST that sends a CSV or JSON file. We recommend when pulling subscriber data from a store with more than 15,000 subscribers that you utilize this method.

100 records are returned per page number.

Example Request

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

url = URI("https://moonbeamapi.cloudwi.re/subscriber/bystore/STOREID/PAGENUMBER")

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/bystore/STOREID/PAGENUMBER",
  "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/bystore/STOREID/PAGENUMBER", 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/bystore/STOREID/PAGENUMBER",
  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/bystore/STOREID/PAGENUMBER"

	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 Success

All subscribers by opt-in status within the store.

Store Creation & Management Subscriber status with paging
{
  "status": "pass",
String
  "code": 200,
Integer
  "message": "All subscribers by opt-in status within the store.",
String
  "results": {
  "results": { ... }
Object
    "count": 2,
Integer
    items: [
Array
      {
      { ... }
Object

Items

        "id": {
        "id": { ... }
Object
          "$oid": "598b612118b55276e6171cb4"
String
        },
        "created": "08/09/2017 19:23:13",
String
        "mobileId": "14155964193",
String
        "details": {
        "details": { ... }
Object
          "commChannel": "+13186024380",
String
          "subscriberStatus": "Opted-In",
String
          "mCreate": {
          "mCreate": { ... }
Object
            "$date": {
            "$date": { ... }
Object
              "$numberLong": "1502306593117"
String
            }
          },
          "created": "08/09/2017 19:23:13",
String
          "keywordType": "foo",
String
          "shortCode": "foo",
String
          "keywordId": "foo",
String
          "storeId": "596ee936dc10db4d095526f3",
String
          "storeName": "Craigs sticky",
String
          "accountId": "591f290279c5fd5822124506",
String
          "keyword": "foo",
String
          "optInAttempts": 1
Integer
        }
      }
    ]
    "itemsPerPage": 100,
Integer
    "currentPage": "1"
String
  }
}

Store Detail

Open in API Explorer
GET /account/store/detail/STOREID

This method allows the developer to retrieve pertinent store information such as store name, compliance admins, template content, callback URLs and keywords along with their type.

You will pass the storeId in the URL when making the request.

Example Request

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

url = URI("https://moonbeamapi.cloudwi.re/account/store/detail/STOREID")

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/store/detail/STOREID",
  "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/store/detail/STOREID", 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/store/detail/STOREID",
  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/store/detail/STOREID"

	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 store details.

Store Creation & Management Store details
{
  "status": "pass",
String
  "code": 200,
Integer
  "message": "Store Details",
String
  "results": {
  "results": { ... }
Object
    "storeName": "cloudwire",
String
    "timeZone": "Pacific",
String
    "inboundCallbackURL": "http://xyz.com",
String
    "messageStatusURL": "http://xyz.com/test",
String
    "complianceAdmin": "support@cloudwi.re",
String
    "complianceNumber": "800-474-9100",
String
    "_id": {
    "_id": { ... }
Object
      "$id": "5f4ed16a100d5e27a428"
String
    },
    "mCreated": {
    "mCreated": { ... }
Object
      "sec": 1472524110,
Integer
      "usec": 0
Integer
    },
    "created": "08/30/2016 02:28:30",
String
    "template": {
    "template": { ... }
Object
      "helpMessage": "cloudwi.re Alerts & Offers. Msg&Data rates may apply. Max 5msgs/mth. Reply HELP for help, STOP to quit. 800-474-9100.",
String
      "stopMessage": "cloudwi.re Alerts & Offers. Msg&Data rates may apply. Max 5msgs/mth. Reply HELP for help, STOP to quit. 800-474-9100.",
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": "opt-in",
String
        "shortCode": "+345345",
String
        "keyword": "CLOUDWIRE",
String
        "mCreated": {
        "mCreated": { ... }
Object
          "sec": 1472524578,
Integer
          "usec": 0
Integer
        },
        "created": "08/30/2016 02:36:18",
String
        "_id": {
        "_id": { ... }
Object
          "$id": "57c4f1226a10e56527a427"
String
        }
      }
    ]
  }
}

Update Store Automation

Open in API Explorer
POST /account/store/updateautomation

This method allows the developer to toggle off two automated template types that are managed by cloudwi.re.

The first is the opt-in confirmation message that goes out after a keyword is received. (Note: Only for opt-in keywords received by a mobile subscriber. API driven opt-ins will still receive automated opt-in confirmation or requests in Send Opt-In).

By default, cloudwi.re manages and sends the opt-in confirmation on MO generated opt-in keywords. But for developers who wish to send customized responses to each individual subscriber that sends in a keyword the option to disable this provides the flexibility to do so.

The second automated template that the developer can manage is the Already Opted-in Message. By default, this template is enabled when each new store is created. This template is fired by cloudwi.re in the event that a subscriber who is already opted-in to the store sends in an opt-in keyword again. It's a friendly reminder.

That template is fired on the communication short code the subscriber is binded too. It's just a friendly reminder. The developer is free to edit this template from what the SMS API sends in Edit Store Templates. But this option gives the developer to turn it off altogether and manage it within their business rules.

Example Request

Format:
curl --request POST \
  --url https://moonbeamapi.cloudwi.re/account/store/updateautomation \
  --header 'accept: application/json' \
  --header 'authorization: Bearer SOME.JWT.TOKEN' \
  --header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
  --form storeId=239u2n23kn2fj2i23823k23 \
  --form automationType=already \
  --form action=disable
require 'uri'
require 'net/http'

url = URI("https://moonbeamapi.cloudwi.re/account/store/updateautomation")

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\n239u2n23kn2fj2i23823k23\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"automationType\"\r\n\r\nalready\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"action\"\r\n\r\ndisable\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": "/account/store/updateautomation",
  "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\n239u2n23kn2fj2i23823k23\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"automationType\"\r\n\r\nalready\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"action\"\r\n\r\ndisable\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\n239u2n23kn2fj2i23823k23\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"automationType\"\r\n\r\nalready\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"action\"\r\n\r\ndisable\r\n-----011000010111000001101001--\r\n"

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

conn.request("POST", "/account/store/updateautomation", 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/account/store/updateautomation",
  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\n239u2n23kn2fj2i23823k23\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"automationType\"\r\n\r\nalready\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"action\"\r\n\r\ndisable\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/account/store/updateautomation"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\n239u2n23kn2fj2i23823k23\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"automationType\"\r\n\r\nalready\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"action\"\r\n\r\ndisable\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 storeId of the store you wish to edit the template automation for.

239u2n23kn2fj2i23823k23
automationType String Required

Either 'confirmation' or 'already'

already
action String Required

Either 'enabled' or 'disabled'

disable

Responses

200 Pass

The automation setting has been updated.

Store Creation & Management Automation updated
{
  "status": "pass",
String
  "code": 200,
Integer
  "message": "Store setting updated",
String
  "results": [
    "foo",
    "foo",
    "foo"
  ]
Array
}
400 Invalid Automation Type

Either 'confirmation' or 'already'

(Empty Response)
400 Invalid Action

Either 'enabled' or 'disabled'

(Empty Response)

Add Store

Open in API Explorer
POST /account/addstore

This method allows the developer to create a store. You cannot send messages to and from subscribers without creating a store. You can read more about the store concept here, but remember that it is essentially an opt-in data container. A store can be a brand or it can be a franchise location. Subscriber's opt-in to that brand or location.

Store names are limited to 45 characters and the name must be unique within the account. Additionally, we ask for a compliance phone number and email for automatic addition to the store compliance templates created for the store. You also have the option to add your callback URLs inside of the request.

For some folks, the question of having one store or many is rather simple. However, some use cases make that a little more difficult to figure out. Remember, we are here to help. Don't hesitate to contact us if you aren't sure!

Example Request

Format:
curl --request POST \
  --url 'https://moonbeamapi.cloudwi.re/account/addstore?inboundCallbackURL=www.jimspizza.com%2Fcloudwire%2Finboundmessages.htm' \
  --header 'accept: application/json' \
  --header 'authorization: Bearer SOME.JWT.TOKEN' \
  --header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
  --form accountId=562392n2n2e092309u23ron239S \
  --form 'storeName=Jim'\''s Pizza' \
  --form timeZone=Pacific \
  --form messsageStatusURL=www.jimspizza.com/cloudwire/errors.htm \
  --form compliancePhone=800-474-9100 \
  --form complianceEmail=sms@jimspizzaisthebest.com
require 'uri'
require 'net/http'

url = URI("https://moonbeamapi.cloudwi.re/account/addstore?inboundCallbackURL=www.jimspizza.com%2Fcloudwire%2Finboundmessages.htm")

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=\"accountId\"\r\n\r\n562392n2n2e092309u23ron239S\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeName\"\r\n\r\nJim's Pizza\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"timeZone\"\r\n\r\nPacific\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"messsageStatusURL\"\r\n\r\nwww.jimspizza.com/cloudwire/errors.htm\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"compliancePhone\"\r\n\r\n800-474-9100\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"complianceEmail\"\r\n\r\nsms@jimspizzaisthebest.com\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": "/account/addstore?inboundCallbackURL=www.jimspizza.com%2Fcloudwire%2Finboundmessages.htm",
  "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=\"accountId\"\r\n\r\n562392n2n2e092309u23ron239S\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeName\"\r\n\r\nJim's Pizza\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"timeZone\"\r\n\r\nPacific\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"messsageStatusURL\"\r\n\r\nwww.jimspizza.com/cloudwire/errors.htm\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"compliancePhone\"\r\n\r\n800-474-9100\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"complianceEmail\"\r\n\r\nsms@jimspizzaisthebest.com\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=\"accountId\"\r\n\r\n562392n2n2e092309u23ron239S\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeName\"\r\n\r\nJim's Pizza\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"timeZone\"\r\n\r\nPacific\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"messsageStatusURL\"\r\n\r\nwww.jimspizza.com/cloudwire/errors.htm\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"compliancePhone\"\r\n\r\n800-474-9100\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"complianceEmail\"\r\n\r\nsms@jimspizzaisthebest.com\r\n-----011000010111000001101001--\r\n"

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

conn.request("POST", "/account/addstore?inboundCallbackURL=www.jimspizza.com%2Fcloudwire%2Finboundmessages.htm", 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/account/addstore?inboundCallbackURL=www.jimspizza.com%2Fcloudwire%2Finboundmessages.htm",
  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=\"accountId\"\r\n\r\n562392n2n2e092309u23ron239S\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeName\"\r\n\r\nJim's Pizza\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"timeZone\"\r\n\r\nPacific\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"messsageStatusURL\"\r\n\r\nwww.jimspizza.com/cloudwire/errors.htm\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"compliancePhone\"\r\n\r\n800-474-9100\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"complianceEmail\"\r\n\r\nsms@jimspizzaisthebest.com\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/account/addstore?inboundCallbackURL=www.jimspizza.com%2Fcloudwire%2Finboundmessages.htm"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"accountId\"\r\n\r\n562392n2n2e092309u23ron239S\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeName\"\r\n\r\nJim's Pizza\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"timeZone\"\r\n\r\nPacific\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"messsageStatusURL\"\r\n\r\nwww.jimspizza.com/cloudwire/errors.htm\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"compliancePhone\"\r\n\r\n800-474-9100\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"complianceEmail\"\r\n\r\nsms@jimspizzaisthebest.com\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
accountId String Required

Your account ID

562392n2n2e092309u23ron239S
storeName String Required

The name of the store, which must be unique, on the cloudwi.re platform

Jim's Pizza
timeZone String Required

Select your time zone (Exp: Hawaii, Alaska, Pacific, Mountain, Arizona, Central or Eastern.)

Pacific
messsageStatusURL String (url) Optional

The notification and job URL for message failures.

www.jimspizza.com/cloudwire/errors.htm
compliancePhone String Required

For automated templates, this will serve as a phone number subscriber's can reach you at for questions.

800-474-9100
complianceEmail String (email) Required

The email address to which subscribers may reach you with any questions or concerns.

sms@jimspizzaisthebest.com

Query Parameters

Name Type Required Description Example
inboundCallbackURL String (url) Optional

The URL to which cloudwi.re will post ALL inbound messages sent from the subscriber to the store.

www.jimspizza.com%2Fcloudwire%2Finboundmessages.htm

Responses

200 Store Created Store Creation & Management Store created
{
  "status": "pass",
String
  "code": 200,
Integer
  "message": "Store Created",
String
  "results": {
  "results": { ... }
Object
    "storeName": "cloudwire",
String
    "timeZone": "Pacific",
String
    "inboundCallbackURL": "https://cloudwi.re/inbound",
String
    "messageStatusURL": "https://cloudwi.re/notification",
String
    "complianceNumber": "800-474-9100",
String
    "complianceAdmin": "support@cloudwi.re",
String
    "mCreated": {
    "mCreated": { ... }
Object
      "sec": 1473742399,
Integer
      "usec": 0
Integer
    },
    "created": "09/13/2016 04:53:19",
String
    "template": {
    "template": { ... }
Object
      "helpMessage": "cloudwi.re Alerts & Offers. Msg&Data rates may apply. Max 5msgs/mth. Reply HELP for help, STOP to quit. 800-474-9100.",
String
      "stopMessage": "You opted-out of loudwi.re SMS alerts and offers. You will receive no more messages. 800-474-9100.",
String
      "requestMessage": "Reply YES to join loudwi.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 loudwi.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 loudwi.re"
String
    },
    "keyword": [
    "foo",
    "foo",
    "foo"
  ],
Array
    "id": "5863fd16a10cb36e0ffc3"
String
  }
}
400 Compliance Phone Missing

A phone number is required for compliance.

(Empty Response)
400 Store Characters Exceeded

Store names are limited to 45 characters.

(Empty Response)
400 Duplicate Store Name

Duplicate store names cannot exist inside an account.

(Empty Response)
400 Invalid Time Zone

Either 'Hawaii' 'Alaska' 'Pacific' 'Arizona' 'Mountain' 'Central' 'Eastern'

(Empty Response)
400 Compliance Email Missing

Please add a valid email address for compliance contact.

(Empty Response)

Delete Store

Open in API Explorer
POST /account/deletestore

This method allows the developer to remove a store. Make darn sure that's what you want to do. Your account ID is required in this method and you can find it in the admin portal. A store deletion will result in the removal of all opted-in subscribers to the store and release their mobile IDs from the short codes they are binded to the store with. It will also result in the release of any keywords associated to the store. Although the data is archived, retrieving it for the sole fact that you accidentally deleted it is going to cost you some jack.

This request is placed on a job queue. When completed you will get a post to your notification URL that the store, its keywords and subscribers associated to it, were removed.

Example Request

Format:
curl --request POST \
  --url https://moonbeamapi.cloudwi.re/account/deletestore \
  --header 'accept: application/json' \
  --header 'authorization: Bearer SOME.JWT.TOKEN' \
  --header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
  --form storeId=SID232kn2ekjneoi2en23kj23 \
  --form accountId=3wn23in32n23okn23
require 'uri'
require 'net/http'

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

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\nSID232kn2ekjneoi2en23kj23\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"accountId\"\r\n\r\n3wn23in32n23okn23\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": "/account/deletestore",
  "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\nSID232kn2ekjneoi2en23kj23\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"accountId\"\r\n\r\n3wn23in32n23okn23\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\nSID232kn2ekjneoi2en23kj23\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"accountId\"\r\n\r\n3wn23in32n23okn23\r\n-----011000010111000001101001--\r\n"

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

conn.request("POST", "/account/deletestore", 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/account/deletestore",
  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\nSID232kn2ekjneoi2en23kj23\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"accountId\"\r\n\r\n3wn23in32n23okn23\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/account/deletestore"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\nSID232kn2ekjneoi2en23kj23\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"accountId\"\r\n\r\n3wn23in32n23okn23\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 Integer Required

The ID of the store you wish to delete

SID232kn2ekjneoi2en23kj23
accountId String Required

Your Account ID.

3wn23in32n23okn23

Responses

200 pass

The store is queued up for deletion.

Store Creation & Management Store deleted
{
  "status": "pass",
String
  "code": 200,
Integer
  "message": "Your request was queued and once completed a message will be sent to your store notification URL.",
String
  "results": [
    "foo",
    "foo",
    "foo"
  ]
Array
}

Edit Compliance Templates

Open in API Explorer
POST /account/store/edittemplate

This method allows the developer to edit the compliant store templates. By default, the cloudwi.re SMS API stores a default book of compliant SMS templates. Each one can be edited as needed. They are:

'request' - The opt-in request template
‘confirmation’ - The opt-in confirmation template
‘stop’ - The opt-out confirmation template
‘help’ - The help template
’already’ - the already opted-in template

Due to delivery and compliance concerns, compliance templates are limited to 160 characters or less.

Example Request

Format:
curl --request POST \
  --url https://moonbeamapi.cloudwi.re/account/store/edittemplate \
  --header 'accept: application/json' \
  --header 'authorization: Bearer SOME.JWT.TOKEN' \
  --header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
  --form accountId=aidw223lken23ln3o9nw0nken \
  --form storeId=kdw223lken23ln3o9nw0nken \
  --form type=confirmation \
  --form 'template=You'\''ve opted-in to Jim'\''s Pizza Club. Msg&Data Rates may apply.  Reply HELP for help.  STOP to QUIT. Max 4msgs/mth.'
require 'uri'
require 'net/http'

url = URI("https://moonbeamapi.cloudwi.re/account/store/edittemplate")

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=\"accountId\"\r\n\r\naidw223lken23ln3o9nw0nken\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\nkdw223lken23ln3o9nw0nken\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nconfirmation\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"template\"\r\n\r\nYou've opted-in to Jim's Pizza Club. Msg&Data Rates may apply.  Reply HELP for help.  STOP to QUIT. Max 4msgs/mth.\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": "/account/store/edittemplate",
  "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=\"accountId\"\r\n\r\naidw223lken23ln3o9nw0nken\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\nkdw223lken23ln3o9nw0nken\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nconfirmation\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"template\"\r\n\r\nYou've opted-in to Jim's Pizza Club. Msg&Data Rates may apply.  Reply HELP for help.  STOP to QUIT. Max 4msgs/mth.\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=\"accountId\"\r\n\r\naidw223lken23ln3o9nw0nken\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\nkdw223lken23ln3o9nw0nken\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nconfirmation\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"template\"\r\n\r\nYou've opted-in to Jim's Pizza Club. Msg&Data Rates may apply.  Reply HELP for help.  STOP to QUIT. Max 4msgs/mth.\r\n-----011000010111000001101001--\r\n"

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

conn.request("POST", "/account/store/edittemplate", 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/account/store/edittemplate",
  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=\"accountId\"\r\n\r\naidw223lken23ln3o9nw0nken\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\nkdw223lken23ln3o9nw0nken\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nconfirmation\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"template\"\r\n\r\nYou've opted-in to Jim's Pizza Club. Msg&Data Rates may apply.  Reply HELP for help.  STOP to QUIT. Max 4msgs/mth.\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/account/store/edittemplate"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"accountId\"\r\n\r\naidw223lken23ln3o9nw0nken\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\nkdw223lken23ln3o9nw0nken\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nconfirmation\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"template\"\r\n\r\nYou've opted-in to Jim's Pizza Club. Msg&Data Rates may apply.  Reply HELP for help.  STOP to QUIT. Max 4msgs/mth.\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
accountId String Optional

Your account ID. Compliance is important so we ask for it!

aidw223lken23ln3o9nw0nken
storeId String Required

The StoreID of the store you wish to edit templates for.

kdw223lken23ln3o9nw0nken
type String Required

Either 'request' 'confirmation' 'help' 'stop' or 'already'

confirmation
template String Required

The content of the template. 160 characters or less. Stay Compliant!

You've opted-in to Jim's Pizza Club. Msg&Data Rates may apply. Reply HELP for help. STOP to QUIT. Max 4msgs/mth.

Responses

200 pass

The compliant template has been updated.

Store Creation & Management Template updated
{
  "status": "pass",
String
  "code": 200,
Integer
  "message": "The store template has been updated.",
String
  "results": {
  "results": { ... }
Object
  }
}
400 Invalid Template Character Count

Limit your template content to 160 characters or less.

(Empty Response)
400 Invalid Template Type

Either 'request' 'confirmation' 'help' 'stop' or 'already'

(Empty Response)

Store Subscribers by Email

Open in API Explorer
POST /subscriber/status

This method allows the developer to generate a report on ALL subscriber's within the store by opt-in status. The report can be requested in either a 'JSON' or 'CSV' format. Only one status type may be requested in each call to the SMS API.

As this file size could be large, please practice patience and ensure your ISP allows large file attachments. We politely deny support inquiries about email reports not being received and only provide this method at an attempt to make the developer's life as easy as possible.

For this reason we provide a much more reliable GET method to retrieve this data by paging through it. If your store has more than 15k subscriber's we advise using the GET to retreive your subscriber data.

Example Request

Format:
curl --request POST \
  --url https://moonbeamapi.cloudwi.re/subscriber/status \
  --header 'accept: application/json' \
  --header 'authorization: Bearer SOME.JWT.TOKEN' \
  --header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
  --form storeId=57952a0dd16a101075069a21 \
  --form status=Opted-In \
  --form email=reports@cloudwi.re \
  --form fileType=JSON
require 'uri'
require 'net/http'

url = URI("https://moonbeamapi.cloudwi.re/subscriber/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\n57952a0dd16a101075069a21\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"status\"\r\n\r\nOpted-In\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\nreports@cloudwi.re\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fileType\"\r\n\r\nJSON\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": "/subscriber/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\n57952a0dd16a101075069a21\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"status\"\r\n\r\nOpted-In\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\nreports@cloudwi.re\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fileType\"\r\n\r\nJSON\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\n57952a0dd16a101075069a21\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"status\"\r\n\r\nOpted-In\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\nreports@cloudwi.re\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fileType\"\r\n\r\nJSON\r\n-----011000010111000001101001--\r\n"

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

conn.request("POST", "/subscriber/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/subscriber/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\n57952a0dd16a101075069a21\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"status\"\r\n\r\nOpted-In\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\nreports@cloudwi.re\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fileType\"\r\n\r\nJSON\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/subscriber/status"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\n57952a0dd16a101075069a21\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"status\"\r\n\r\nOpted-In\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\nreports@cloudwi.re\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fileType\"\r\n\r\nJSON\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 storeId of the store you wish to retrieve subscriber status from.

57952a0dd16a101075069a21
status String Required

The opt-in status of the subscribers: Either 'Opted-In' 'Opted-Out' 'Pending' or 'Locked'

Opted-In
email String (email) Required

The email address you wish to deliver the report too.

reports@cloudwi.re
fileType String Required

Either 'JSON' or 'CSV'

JSON

Responses

200 Pass

The report has been queued for processing.

Store Creation & Management Report queued
{
  "status": "pass",
String
  "code": 200,
Integer
  "message": "Your request was received and placed on the job queue. You will receive an email with results",
String
  "results": [
    "foo",
    "foo",
    "foo"
  ]
Array
}
400 Invalid Email

The report delivery email address must be valid.

(Empty Response)
400 Invalid File Type

Either 'CSV' or 'JSON'. Make sure your ISP can handle a large file too :)

(Empty Response)
400 Invalid Status Type

Either 'Opted-In' 'Opted-Out' 'Pending' or 'Locked'

(Empty Response)

Update Store Callback

Open in API Explorer
POST /account/store/updatestorecallback

This method allows the developer to update or add the inbound message and notification callback URLs to an individual store. The notification URL is sometimes referred to as the message status URL where messages that were failed by cloudwi.re due to opt-in status checks are posted.

Example Request

Format:
curl --request POST \
  --url https://moonbeamapi.cloudwi.re/account/store/updatestorecallback \
  --header 'accept: application/json' \
  --header 'authorization: Bearer SOME.JWT.TOKEN' \
  --header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
  --form storeId=kdw223lken23ln3o9nw0nken \
  --form urlType=notification \
  --form url=https://inbounds.cloudwi.re
require 'uri'
require 'net/http'

url = URI("https://moonbeamapi.cloudwi.re/account/store/updatestorecallback")

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\nkdw223lken23ln3o9nw0nken\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"urlType\"\r\n\r\nnotification\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"url\"\r\n\r\nhttps://inbounds.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": "/account/store/updatestorecallback",
  "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\nkdw223lken23ln3o9nw0nken\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"urlType\"\r\n\r\nnotification\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"url\"\r\n\r\nhttps://inbounds.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\nkdw223lken23ln3o9nw0nken\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"urlType\"\r\n\r\nnotification\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"url\"\r\n\r\nhttps://inbounds.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", "/account/store/updatestorecallback", 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/account/store/updatestorecallback",
  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\nkdw223lken23ln3o9nw0nken\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"urlType\"\r\n\r\nnotification\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"url\"\r\n\r\nhttps://inbounds.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/account/store/updatestorecallback"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeId\"\r\n\r\nkdw223lken23ln3o9nw0nken\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"urlType\"\r\n\r\nnotification\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"url\"\r\n\r\nhttps://inbounds.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 ID of the store you wish to edit callback URLs for

kdw223lken23ln3o9nw0nken
urlType String Required

Please select 'inbound' or 'notification'.

notification
url String (url) Required

The URL cloudwi.re will post too.

https://inbounds.cloudwi.re

Responses

200 pass

The URL has been updated.

Store Creation & Management Url updated
{
  "status": "pass",
String
  "code": 200,
Integer
  "message": "The store URL has been updated.",
String
  "results": [
    "foo",
    "foo",
    "foo"
  ]
Array
}
400 Invalid URL

Only http:// or https:// URLs are accepted.

(Empty Response)
400 Invalid URL Type

Please select either 'inbound' or 'notification'.

(Empty Response)