account.addStaticSegment

‹ BACK TO API PAGE


Description

This method creates a new static segment. Static segments can be associated with categories which are logical groupings of static segments displayed within survey pages and sign up forms. Static segments can also be designated as test segments for use in the Standard Test Messaging feature.

Arguments

Field Description Field Type Required Example
name The name of the static segment. If the static segment is being associated with a category (see below), then the names of the segments must be unique. Limit: 150 characters. string Yes Rock Genre
category_id The ID number of the category that this static segment should be assigned to. Use the legacy.retrieve_segment method to obtain a list of categories and their ID numbers that exist for your account. Alternatively, you can find the ID number of a specific category by logging into the application and then navigating to Segmentation > Categories. Mouse over the name of the category that you want and note the URL that appears in your browser's status bar. The category ID number will be the sequence of digits following the final forward slash character. (e.g. http://…/12345).If the <category_id> element is not included in the input XML message, then this static segment will be "uncategorized". number No 12345
display_on_survey A boolean value that defines whether the new static segment should be displayed in the standard survey web page (or the custom survey web page) where applicable. boolean where:
  • 0 – do not display (default)
  • 1 – display
No 1
test_segment A boolean value that defines whether this new static segment is a test segment. boolean where:
  • 0 – is not a test segment (default)
  • 1 – is a test segment
No 0

Response

Field Description Example
responseCode A code indicating either success or failure of the operation. (see Error Codes below) 110
responseText Human readable description of the response code This static segment has been added
id If successful operation, this element will be set to the ID number identifying the newly added static segment. If unsuccessful operation, the value of this element will be zero. 3426
name The name of static segment as provided in the input XML message. Rock Genre
category_id Always returned in the response XML message. If not included in the input XML message then returned as an empty element

Response Codes

Error Condition responseCode responseText
Successful operation 110 this static segment has been added
The category_id provided in the input XML message either does not exist for the account, or it is not a valid number. 111 action not taken, invalid category_id
The static segment is associated with a category, and there is already existing a static segment of the same name for the same category. 112 action not taken, segment name already exists in this category.

Example Post

<methodCall>

<methodName>account.addStaticSegment</methodName>

<name>Rock Genre</name>

<category_id>3426</category_id>

<display_on_survey>1</display_on_survey>

</methodCall>

Example Response

<methodResponse>

<item>

<methodName><![CDATA[account.addStaticSegment]]></methodName>

<responseCode><![CDATA[110]]></responseCode>

<responseText><![CDATA[this static segment has been added]]></responseText>

<responseData>

<id><![CDATA[852868]]></id>

<name><![CDATA[Rock Genre]]></name>

<category_id><![CDATA[3426]></category_id>

<display_on_survey><![CDATA[1]]></display_on_survey>

</responseData>

<responseNum><![CDATA[1]]></responseNum>

</item>

</methodResponse>

Example Error

<methodResponse>

<item>

<methodName><![CDATA[account.addStaticSegment]]></methodName>

<responseCode><![CDATA[111]]></responseCode>

<responseText><![CDATA[action not taken, invalid category_id]]></responseText>

<responseData>

<id><![CDATA[0]]></id>

<name><![CDATA[Rock Genre]]></name>

<category_id><![CDATA[3426]]></category_id>

<display_on_survey><![CDATA[1]]></display_on_survey>

</responseData>

<responseNum><![CDATA[1]]></responseNum>

</item>

</methodResponse>


Back to API Reference Guide