Send Message by Subscriber Reference ID API

Table of Contents

sendMessageBySubscriberRef

Synopsis:

This API sends either an SMS text or an MMS to a group of subscribers or a subscriber referenced by the subscriber reference id belonging to a certain messaging campaign. If you are sending an SMS, you must include some SMS text. If you are sending an MMS, you must include the MMSID of the MMS. Do not include both SMS text and MMSID in the same request.

Request: XML

<REQUEST>
    <ACTION>sendMessageBySubscriberRef</ACTION>
    <API_KEY>APIKey</API_KEY>
    <MMSID>MMSID</MMSID>
    <TEXT>SMSText</TEXT>
    <SUBSCRIBERREF>SubscriberRefID</SUBSCRIBERREF>
    <CAMPAIGNREF>CampaignReferenceID</CAMPAIGNREF>
</REQUEST>

Request: GET

API_URL?action=sendmessagebysubscriberref
&api_key=API key
&mmsid=MMSID
&text=SMS text
&subscriberref=subscriber reference ID
&campaignref=campaign reference ID

Request Parameters:

If sending MMS:
Mandatory: action, api_key, mmsid, subscriberref, campaignr

If sending SMS:
Mandatory: action, api_key, text, subscriberref, campaignref

Response Parameters:

subscriberref, campaignref, subscriber, status, trackingid, to, from, statusdetails, errorcode, errorinfo

Request Example: XML

<REQUEST>
    <ACTION>sendMessageBySubscriberRef</ACTION>
    <API_KEY>qTFkykO9JTfahCOqJ0V2Wf5Cg1t8iWlZ</API_KEY>
    <MMSID>35674</MMSID>
    <SUBSCRIBERREF>ACCT-123232</SUBSCRIBERREF>
    <CAMPAIGNREF>Campaign123</CAMPAIGNREF>
</REQUEST>

Request Example: GET

https://secure.skycore.com/API/wxml/1.3/index.php?action=sendmessagebysubscriberref
&api_key=qTFkykO9JTfahCOqJ0V2Wf5Cg1t8iWlZ
&mmsid=35674
&subscriberref=ACCT-123232
&campaignref=Campaign123

Response Example: Success

<RESPONSE>
    <SUBSCRIBERREF>ACCT-123232</SUBSCRIBERREF>
    <CAMPAIGNREF>Campaign123</CAMPAIGNREF>
    <SUBSCRIBER>
        <STATUS>Success</STATUS>
        <TRACKINGID>DrXAFP-Ylpc-JZL</TRACKINGID>
        <TO>16501234123</TO>
        <FROM>60856</FROM>
        <STATUSDETAILS>MMS request accepted and queued for delivery</STATUSDETAILS>
    </SUBSCRIBER>
    <SUBSCRIBER>
        <STATUS>Success</STATUS>
        <TRACKINGID>DrXAFP-gIVU-JZL</TRACKINGID>
        <TO>16501233154</TO>
        <FROM>60856</FROM>
        <STATUSDETAILS>MMS request accepted and queued for delivery</STATUSDETAILS>
    </SUBSCRIBER>
    <SUBSCRIBER>
        <STATUS>Success</STATUS>
        <TRACKINGID>DrXAFP-vmcQ-JZL</TRACKINGID>
        <TO>16501234267</TO>
        <FROM>60856</FROM>
        <STATUSDETAILS>MMS request accepted and queued for delivery</STATUSDETAILS>
    </SUBSCRIBER>
</RESPONSE>

Response Example: Failure

<RESPONSE>
    <STATUS>Failure</STATUS>
    <ERRORCODE>E717</ERRORCODE>
    <TO>16501234123</TO>
    <ERRORINFO>Either MMSID or SMS Text is allowed not both</ERRORINFO>
</RESPONSE>

General Error Codes:

CodeDescription
E100Invalid request. Make a valid request via GET/POST/XML with all the required variables.
E104User Authentication Failed.
E105This account has no API rights.
E106You can call API every X seconds.
E107This account has no rights to use this action.
E108XML Parse error: $error.
E109API not activated.
E112IP was not whitelisted. API call rejected.
E113Set throughput exceeded for this API action. API call rejected.
E114Phone number is blacklisted. API call rejected.
E120Account has reached the API request limit.
E503Internal error.
CodeDescription
E241This content does not exist.
E626Content unavailable. Encoding in progress, try again later.
E629Unrecognized content type.
E716The MMSID or SMS Text is required
E717Either MMSID or SMS Text is allowed not both.
E718The ‘campaignref’ is required
E719The subscriber reference is required
E720No active subscribers found for this subscriber reference
E721Invalid campaignref

Key Term Definitions:

TermDescription
ACTIONThis is the name of the function you want to execute with the API.
API_KEYRandom key that is assigned to an account that can be used for authorization instead of USER/PASS. You can find and regenerate this key on the ‘API Settings’ page.
CAMPAIGNREFDepending on your API settings, you may be required to subscribe users into a campaign first before sending them messages. If you are required to subscribe a user first, then a valid Campaign Reference is required. This would be the campaign reference ID (string) to which the user is subscribed.
FROMA valid shortcode or longcode for the sender address(string). When sending to a list of many numbers using the ‘sendSavedContent’ function and if the ‘FROM’ value cannot be used for a certain country, then the system will re-write the sender address to use a valid shortcode for those numbers.
MMSIDThe ID(integer) of a saved MMS.
SUBSCRIBERREFThe customer reference ID for the subscriber. This ID can reference one or more subscriber phone numbers.
TEXTThe SMS message limit is 160 characters(string).
TOThis is the message recipient’s phone number in an international format.
TRACKINGIDOn success, the API returns with the tracking ID to identify sent messages. Upon API call failure, no tracking ID is returned. Once the message sending is processed you shall receive a postback containing TRACKINGID and the message status.