Developers

Subscriber API

update_subscriber


URL:

http://api.msgme.com/v1/subscribers/update_subscriber

METHOD:

Post

DESCRIPTION:

Updates or adds metadata to an existing subscriber.

For pre-defined fields, please see add_subscriber.

PARAMETERS:

Parameter Description
token The security token that was returned using authentication_api method.
msidn 10 digit mobile number
keywordId The keyword ID of the subscription keyword
shortcode The short code that the keyword belongs to.
updateMethod Valid values: overwrite, append, and remove. The default is overwrite.
passthrough The passthrough variable that will be returned instead of the normal XML responses.


API REQUEST:

		<?xml version="1.0" encoding="UTF-8"?>
		<apiRequest token="">
		<updateSubscriber>
			<subscriber msidn="[10 digit number]" subscriberId="[subscriber ID]">
				<keyword keywordId="[keyword ID]" shortcode="[shortcode]">
					<fields>
						<field name="[field name]" updateMethod="[update method]">
							<fieldValues>
								<fieldValue value="[field value]" ></fieldValue>
							</fieldValues>
						</field>
						<field name="[field name]" updateMethod="[update method]">
							<fieldValues>
								<fieldValue value="[field value]" ></fieldValue>
							</fieldValues>
						</field>
					</fields>
				</keyword>
			</subscriber>
		</updateSubscriber>
		</apiRequest>


API RESPONSE:

		<?xml version="1.0" encoding="UTF-8"?>
		<apiResponse status="[status text]" statusCode="[status code]">
			<subscriber 
				subscriberId="[msgme subscriber ID]"
				msidn="[10 digit number]" 
				carrierName="[wireless carrier name]" 
				createDate="[YYYYMMDD]" 
				updateDate="[YYYYMMDD]">
			</subscriber> 
		</apiResponse>


EXAMPLE USAGE:


REQUEST:

		<?xml version="1.0" encoding="UTF-8"?>
		<apiRequest token="QL11e6WLbePlqQ7av0vLeL7VoJqLklAERaW7XJ5KVxoEq7WMYBj1aV9U9ZOm_rsE">
		<updateSubscriber>
			<subscriber msidn="6264298416" subscriberId="809027">
				<keyword keywordId="20992" shortcode="67463">
					<fields>
						<field name="email" updateMethod="overwrite">
							<fieldValues>
								<fieldValue value="bob_foo@somedomain.com"></fieldValue>
							</fieldValues>
						</field>
						<field name="dob" updateMethod="append">
							<fieldValues>
								<fieldValue value="19831002"></fieldValue>
							</fieldValues>
						</field>
					</fields>
				</keyword>
			</subscriber>
		</updateSubscriber>
		</apiRequest>

RESPONSE:

		<?xml version="1.0" encoding="UTF-8"?>
		<apiResponse status="OK" statusCode="200">
			<subscriber 
				subscriberId="809027"
				msidn="6264298416" 
				carrierName="Tmobile" 
				createDate="20081208" 
				updateDate="20081209">
			</subscriber> 
		</apiResponse>