After completing the required setup process and optionally providing IP Addresses to white list, you are ready to test your connection to our API servers. Requests should be sent as an HTTPS GET or POST request to:
https://api.mogreet.com/moms/object.method
With the required parameters for each object.method.Testing with curl and system.ping
An easy way to test API calls is with the 'curl' command in *nix. You can also paste API calls into a browser URL line to see the result. Here we will demonstrate using curl on a command line.
Open a terminal/shell/command line and use curl with the -k flag to skip certificate checking. Also remember to enclose the PI call in quote marks. Use your own client_id and token.
curl -k "https://api.mogreet.com/moms/system.ping?client_id=your_id&token=your_token"
You should receive a response back as follows:
<?xml version="1.0"?>
<response code="1" status="success">
<message><![CDATA[pong]]></message> </response>
See the API reference pdf for the most complete information on each API call available. You can download a pdf version of the full API reference here: Mogreet Messaging System API 4.01.pdf
Request:
https://api.mogreet.com/moms/system.ping
with the following parameters:
Name | Description |
---|---|
client_id | Your client id. Log onto the Campaign Manager to access your client id. |
token | Your token. Log onto the Campaign Manager to access your token. |
A successful call will return an HTTP 200 with XML response. See the following request and response examples:
Request | Response |
---|---|
https://api.mogreet.com/moms/system.ping?client_id=12345&token=abcde
|
<?xml version=”1.0” encoding=”UTF-8”?> |
Same, with the format=json flag: https://api.mogreet.com/moms/system.ping?client_id=12345&token=abcde&format=json
|
{ |
Request:
https://api.mogreet.com/moms/transaction.send
with the following parameters:
Name | Description |
---|---|
client_id | Your client id. Log onto the Campaign Manager to access your client id. |
token | Your token. Log onto the Campaign Manager to access your token. |
campaign_id | An ID connected to a specific campaign setup in the Campaign Manager or provided by your account representative. |
to | The mobile number (MSISDN) of the handset you would like to send to. |
message | Depending on your campaign set up, the message presented to the “to” user. |
content_id | An integer value associated to a piece of content ingested through the Campaign Manager. You’ll find all your content ids under the media section. (Optional, used for SMS and MMS delivering audio, image or video) |
content_url | A publicly accessible URL of an image, audio or video. MOMS will automagically ingest the content and deliver it as specified by the campaign flow. (Optional, used for SMS and MMS delivering audio, image or video) |
callback | If provided with a valid URL, any errors with the transaction will be sent to this URL via XML over HTTP. See description below. |
A successful call will return an HTTP 200 with XML response. See the following request and response examples:
Request | Response |
---|---|
a successful transaction.send |
<?xml version="1.0"?> |
a failed transaction.send |
<?xml version="1.0"?> |
A successful call will return an HTTP 200 with XML response. See the following request and response examples:
Request | Response |
---|---|
https://api.mogreet.com/moms/transaction.send?client_id=12345&token=abcde&campaign_id=123&to=5551236789
&from=5551236543&message=hello%20world&content_id=321
|
<?xml version=”1.0” encoding=”UTF-8”?> |
a bad MSISDN (mobile number)
&from=5551236543&message=hello%20world&content_id=456
|
<?xml version=”1.0” encoding=”UTF-8”?> |
with response set to json: |
{ |
This isn't my day, I need A&M root-beer/cola
This%20isn't%20my%20day%2C%20I%20need%20A%26M%20root-beer%2Fcola%20
When you use the content_url parameter in the transaction.send API call, you provide a URL locating a piece of content on the web. Our platform ingests that media, transcodes it, and delivers the message. The media is cached for efficiency and reuse for 30 days, then it is deletes. There is NO ADDITIONAL COST for using the content_url and on-demand ingestion to deliver multimedia MMS.
If you want to programatically ingest content into your media library, and use it in sends, the media APIs allow you to post (or use an URL) content into the Mogreet API service. That content is transcoded and hosted, and a content id and unique content hash are provided back in the response of the API call. This content is permanent, and you may use the content id in APi calls, and the unique hash in Smart URLs to deliver that content in app, on web sites, etc. Refer to the API reference documentation for complete details.