Welcome‎ > ‎Version 2‎ > ‎Syndication Api (Read Only)‎ > ‎Methods‎ > ‎

Segments

Segments are publisher-defined.  A segment may be a city that a publisher is in, or any other subset of a publisher's audience.  Examples of segments could be los angeles, kids, or golf-lovers.  This method gets the list of active segments.

Method: /api/v2/syndication/segments/

RequiredParameters:
  none

OptionalParameters:
  none

Returns:
  List of Syndicated Segment

Sample Request:
GET /api/v2/syndicated/segments?apiKey=43c5c674-620c-4f2b-bdcf-3082c99e8186 HTTP/1.1
Host: apitest.groupcommerce.com

Sample XML Response:
<segments xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <version>2.0</version>
    <success>true</success>
    <lastPublished>2011-02-16T20:16:30.5483579Z</lastPublished>
    <data>
        <segment>
            <latitude>12.34</latitude>
            <longitude>-56.78<longitude>
            <key>1</key>
            <name>National</name>
            <timezone>Eastern Standard Time</timezone>
            <viewOrder>1</viewOrder>
        </segment>
        <segment>
            <latitude>40.47</latitude>
            <longitude>-73.58</longitude>
            <key>new-york</key>
            <name>New York</name>
            <timezone>Eastern Standard Time</timezone>
            <viewOrder>2</viewOrder>
        </segment>
    </data>
    <metaData>
        <pageCount>1</pageCount>
        <pageNumber>1</pageNumber>
        <pageSize>2</pageSize>
        <totalItems>2</totalItems>
    </metaData>
</segments>


Sample JSON Response:
{
    "version": "2.0",
    "success": true,
    "lastPublished": "/Date(1308295199923)/",
    "data": [
        {
            "key": "ny",
            "latitude": 40.47,
            "longitude": -73.58,
            "name": "New York",
            "timezone": "Eastern Standard Time",
            "viewOrder": 0
        },
        {
            "key": "sea",
            "latitude": 47.37,
            "longitude": -122.2,
            "name": "Seattle",
            "timezone": "Pacific Standard Time",
            "viewOrder": 0
        },
        {
            "key": "nation",
            "latitude": 0,
            "longitude": 0,
            "name": "Nation",
            "timezone": "Central Standard Time",
            "viewOrder": 19
        }
    ],
    "metaData": {
        "pageCount": 1,
        "pageNumber": 1,
        "pageSize": 3,
        "totalItems": 3
    }
}

Comments