http://api.msgme.com/v1/campaigns/create_campaign
Post
Create a campaign with one keyword. You'll have the option to create the keyword as a subscription keyword and set its schedule if necessary. Only Basic Text & Dynamic Response types are allowed.
| Parameter | Description |
|---|---|
| campaign | Requires the name attribute and an option description attribute. NOTE: the name attribute will be validated with existing campaign names in Msgme |
| keyword | Requires the name attribute and type attributes. The name will be validated with existing keyword names in Msgme. Available types are: basic, dynamic. |
| subscription | This element has a required optInType="single|double" |
| optinMessage | This is required if the subscription type is a double opt-in subscription. |
| confirmMessage | The custom end message for your confirmation message. The following language must be included within your confirm message:"". |
| doNotSendContent | Do not send content on opt-in - Accepts Y|N |
| limitSubscribers | Allow subscriber limits for this subscription |
| maxSubscribers | The maximum number of subscribers allowed. Required, if limitSubscribers is set to 'Y' |
| schedule | If this subscription is to go out on a schedule, this element is required. The required attribute is type="daily|weekly|monthly|wheniwant" |
| scheduledDateTime | Required if schedule type is not 'wheniwant'. The start date in YYYY-mm-dd hh:mm:ss |
| timeZone | US/Pacific|US/Mountain|US/Central|US/Eastern|GMT |
| type | type="basic|dynamic" |
| content | type="basic|devapi|rss|atom" When the content is not basic, you will need the below elements nested in the content element. |
| uri | REQUIRED The URI to the web service |
| title | OPTIONAL The title to filter the rss or atom feeds by |
| description | OPTIONAL The description to filter the rss or atom feeds by |
<?xml version="1.0" encoding="UTF-8"?> <apiRequest token="[token]"> <CreateCampaign shortcode="[shortcode]" accountId="[account ID]"> <campaigns> <campaign name="[campaign name]" description="[campaign description]"> <keyword name="[keyword name]" type="[keyword type]"> <subscription optInType="[opt-in type]"> <confirmMessage></confirmMessage> <doNotSendContent>[Y/N]</doNotSendContent> <limitSubscribers>[Y/N]</limitSubscribers> <schedule type="[schedule type]"> <scheduledDateTime>[YYYYMMDD hh:mm:ss]</scheduledDateTime> <timeZone>[time zone]</timeZone> </schedule> </subscription> <content type="[content type]"><![CDATA[message]]></content> </keyword> </campaign> </campaigns> </CreateCampaign> </apiRequest>
<?xml version="1.0" encoding="UTF-8"?> <apiRequest token=""> <CreateCampaign shortcode="[shortcode]" accountId="[account ID]"> <campaigns> <campaign name="[campaign name]" description="[campaign description]"> <keyword name="[keyword name]" type="[keyword type]"> <subscription optInType="[opt-in type]"> <confirmMessage></confirmMessage> <doNotSendContent>[Y/N]</doNotSendContent> <limitSubscribers>[Y/N]</limitSubscribers> <schedule type="[schedule type]"> <scheduledDateTime>[YYYYMMDD hh:mm:ss]</scheduledDateTime> <timeZone>[time zone]</timeZone> </schedule> </subscription> <content type="[atom,devapi,rss]"> <uri><![CDATA[Your message here]]>[uri]</uri> <title>[title]</title> <description>[description]</description> </content> </keyword> </campaign> </campaigns> </CreateCampaign> </apiRequest>
<?xml version="1.0" encoding="UTF-8"?> <apiResponse status="[status text]" statusCode="[status code]"> <campaign id="[campaign ID]" name="[campaign name]" created="[YYYYMMDD]"/> </apiResponse>
REQUEST:
<?xml version="1.0" encoding="UTF-8"?> <apiRequest token="[token]"> <CreateCampaign shortcode="67463" accountId="200298"> <campaigns> <campaign name="winter" description="Winter promotion campaign"> <keyword name="winter" type="basic"> <subscription optInType="single"> <confirmMessage></confirmMessage> <doNotSendContent>Y</doNotSendContent> <limitSubscribers>N</limitSubscribers> <schedule type="wheniwant"> <scheduledDateTime>YYYY-mm-dd hh:mm:ss</scheduledDateTime> <timeZone></timeZone> </schedule> </subscription> <content type="basic"><![CDATA[Your message here]]></content> </keyword> </campaign> </campaigns> </CreateCampaign> </apiRequest>
RESPONSE:
<?xml version="1.0" encoding="UTF-8"?> <apiResponse status="" statusCode=""> <campaign id="06433" name="winter" created="20100626 21:19:11"/> </apiResponse>