Welcome‎ > ‎Version 3‎ > ‎Publisher Api‎ > ‎Methods‎ > ‎4 - Publisher Related‎ > ‎

Get 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 all segments when signed with oAuth.  When using apikey mode it will return the list of active segments.

Method: GET /api/v3/publisher/segments
Authentication: apiKey / oAuth
 
Returns
base response fields
segments - A list of segments.


Sample Request:

GET http://api.groupcommerce.com/api/v3/publisher/segments

Authorization: OAuth oauth_signature="0bdbsRahDXOW%2fNKYFtWrJPylqiw%3d", oauth_nonce="2394174", oauth_timestamp="1319582636", oauth_consumer_key="eeb6b959-b854-4ad1-b563-e801c83cf81d", oauth_signature_method="HMAC-SHA1", oauth_version="1.0"


Sample JSON Response:

{
    "errors": [],
    "lastPublished": "/Date(1319582228259)/",
    "success": true,
    "version": "3",
    "metaData": {
        "pageCount": 1,
        "pageNumber": 1,
        "pageSize": 2,
        "totalItems": 2
    },
    "segments": [
        {
            /* see segment */
        },
        {
           
/* see segment */
        }
    ]
}


Sample XML Response:

<getSegmentsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <errors/>
    <lastPublished>2011-10-25T22:26:43.6487028Z</lastPublished>
    <success>true</success>
    <version>3</version>
    <metaData>
        <pageCount>1</pageCount>
        <pageNumber>1</pageNumber>
        <pageSize>2</pageSize>
        <totalItems>2</totalItems>
    </metaData>
    <segments>
        <segment>
            <!--
see segment -->
        </segment>
        <segment>
           
<!-- see segment -->
        </segment>
    </segments>
</getSegmentsResponse>

Comments