Developers

Subscriptions API

update_custom_field


URL:

http://api.msgme.com/v1/subscriptions/update_custom_field

METHOD:

Post

DESCRIPTION:

Updates custom fields. This API method is essentially the same as the define_custom_field API call, except this call takes a customFieldId previously generated with define_custom_field and replaces all the values for the previously defined custom fields.

PARAMETERS:

Parameter Description
token The security token that was returned using authentication_api method.
keywordId The keyword id of the subscribe-able keyword.
customField Name of custom field to be defined. Wrapped by a customFields element.


ATTRIBUTES:

Attribute Name Description
name This custom field's name.
fieldId This custom field's ID assigned by Msgme.
description A description of the value. 160 characters
type This custom field's type.
length The field length of this custom field.
validLength (Optional) If a value is assigned to this attribute, Msgme will validate all field input lengths against this value.
validInputs Msgme will validate against these values when subscribers are submitted.


API REQUEST:

		<?xml version="1.0" encoding="UTF-8"?>
		<apiRequest token="[token]">
			<updateCustomField keywordId="[keyword ID]" >
				<customField fieldId="[field ID]" name="[field name]">
					<description>Tour Locations</description>
						<validInputs>[valid inputs]</validInputs>
						...
				</customField>
				...
			</updateCustomField>
		</apiRequest>


API RESPONSE:

		<?xml version="1.0" encoding="UTF-8"?>
		<apiResponse status="[status text]" statusCode="[status code]">
			<customField
				name="[field name]"
				fieldId="[field ID]"
				keywordId="[keyword ID]">
			</customField>
		</apiResponse>


EXAMPLE USAGE:


REQUEST:

		POST http://api.msgme.com/v1/subscription/add_custom_field
		<?xml version="1.0" encoding="UTF-8"?>
		<apiRequest token="0e9ace1582fbb754dfe7f4e11f572bf5273f3c69" >
		<updateCustomField keywordId="19879" >
			<customField fieldId="83" name="location">
				<description>Tour Locations</description>
				<validInputs>Austin</validInputs>
				<validInputs>Las Vegas Taylor</validInputs>
				<validInputs>Los Angeles</validInputs>
			</customField>
		</updateCustomField>
		</apiRequest>

RESPONSE:

		<?xml version="1.0" encoding="UTF-8"?>
		<apiResponse status="OK" statusCode="200">
			<customField
				name="mascot"
				fieldId="1765"
				keywordId="19879" />
			</customField>
		</apiResponse>