account.getStaticSegments

‹ BACK TO API PAGE


Description

This method replaces the legacy.retrieve_segment method.

This method returns all the static segments created for your account. Using the input parameters, you can control how many fields to return in the response message, and the offiset to skip in the numerical order. This latter input parameter is useful when you are building a user interface displaying all your static segments that includes paging. Rather than pull the complete set of static segments, you only pull the ones you need depending upon which page the user is viewing in the interface.

The collection of static segments is encapsulated within the <static_segments> element. The details of each static segment are in turn, encapsulated within the <item> element. Hence:
<static_segments>
<item>
… static segment elements
</item>
<item>
… static segment elements
</item>
… additional static segments
</static_segments>

The list of static segments will be sorted by segment name in alphabetical order.

Arguments

Field Description Field Type Required Example
limit A numeric value specifying how many static segment records will be included in the response message. string No 25
offset A numeric value specifying how many static segment records to skip from the response. Use this element when you are using this API to construct a user interface that displays the complete list of static segments over several "pages". string No 26

Response

Field Description Example
responseCode A code indicating either success or failure of the operation. (see Error Codes below) 170
responseText Human readable description of the response code Displaying all static segments
id The static segment ID number 1477174
name The name of static segment. Rock Genre
category_id The ID number of the category that the static segment is assigned to. If this element is empty, then the static segment is "uncategorized" – or not associated with any category. 3415
display_on_survey A boolean value that defines whether the 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
  • 1 – display
1
test_segment A boolean value that defines whether this static segment should be used as a test list with the Standard Test Message feature. If this element is set to '1', then this static segment will be designated as a test segment and can be used when sending a Standard Test Message.NOTE: If this static segment is to be used as a test segment, then it should not exceed 100 subscribers. boolean where:
  • 0 – is not a test segment
  • 1 – is a test segment
0

Response Codes

Error Condition responseCode responseText
Successful operation; all static segments in the system are returned with no offset or limit. 170 Displaying all static segments
There are fewer static segments in the system than specified by the <offset> value. 171 Offset exceeds number of static segments
There are no static segments in the system to return 172 No static segments returned
Successful operation; the subset of static segments defined by the limit and offset are returned. 173 Retrieved subset of static segments

Example Post

<methodCall>

<methodName>account.getStaticSegments</methodName>

<limit>2</limit>

<offset>5</offset>

</methodCall>

Example Response

<methodResponse>

<item>

<methodName>account.getStaticSegments</methodName>

<responseCode>173</responseCode>

<responseText>Retrieved subset of static segments</responseText>

<responseData>

<static_segments>

<item>

<name>Rock Genre</name>

<id>1477174</id>

<category_id>3415</category_id>

<display_on_survey>1</display_on_survey>

<test_segment>0</test_segment>

</item>

<item>

<name>Jazz Genre</name>

<id>1477177</id>

<category_id>3415</category_id>

<display_on_survey>1</display_on_survey>

<test_segment>1</test_segment>

</item>

</static_segments>

</responseData>

<responseNum>1</responseNum>

</item>

</methodResponse>

Example Error

<methodResponse>

<item>

<methodName>account.getStaticSegments</methodName>

<responseCode>171</responseCode>

<responseText>Offset exceeds number of static segments</responseText>

<responseData></responseData>

<responseNum>1</responseNum>

</item>

</methodResponse>


Back to API Reference Guide