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, campaignref

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:

Code Description
E100 Invalid request. Make a valid request via GET/POST/XML with all the required variables.
E104 User Authentication Failed.
E105 This account has no API rights.
E106 You can call API every X seconds.
E107 This account has no rights to use this action.
E108 XML Parse error: $error.
E109 API not activated.
E112 IP was not whitelisted. API call rejected.
E113 Set throughput exceeded for this API action. API call rejected.
E114 Phone number is blacklisted. API call rejected.
E120 Account has reached the API request limit.
E503 Internal error.


Code Description
E241 This content does not exist.
E626 Content unavailable. Encoding in progress, try again later.
E629 Unrecognized content type.
E716 The MMSID or SMS Text is required
E717 Either MMSID or SMS Text is allowed not both.
E718 The ‘campaignref’ is required
E719 The subscriber reference is required
E720 No active subscribers found for this subscriber reference
E721 Invalid campaignref


Key Term Definitions:

Term Description
ACTION This is the name of the function you want to execute with the API.
API_KEY Random 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.
CAMPAIGNREF Depending 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.
FROM A 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.
MMSID The ID(integer) of a saved MMS.
SUBSCRIBERREF The customer reference ID for the subscriber. This ID can reference one or more subscriber phone numbers.
TEXT The SMS message limit is 160 characters(string).
TO This is the message recipient’s phone number in an international format.
TRACKINGID On 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.