Knowledge Center

Knowledge Center > Insights > Developer Reference > API Reference > Insights Export API > List Segments

List Segments

You can use the Export API to list Insights account or user segments.

Prerequisites

Before you can list Insights segments, you must have obtained the export token for your Insights stream.

Submit a request at Zuora Global Support if you do not know the export token for your Insights stream, or if you would like Zuora to generate a new export token for your Insights stream. Zuora Global Support will send the export token to a confirmed Insights administrator. See Global Support Scope for Insights for more information.

If you request a new export token, the previous export token will no longer be honored.

The export token for your Insights stream is different from the stream token that enables you to embed Insights account profiles in your application.

Request

GET https://nw1.api.insights.zuora.com/api/export/segments/{type}

Request URL Fields

Specify the following fields in the request URL.

type required

The type of segments to list. One of the following values:

  • ACCOUNT

  • USER

Request Header Fields

Specify the following fields in the request header.

Authorization required

HTTP Basic Authorization header. The Basic Authorization username is the export token for your Insights stream. The Basic Authorization password is the empty string.

Request Body Fields

None.

Response

The response body contains a JSON array of account or user segments. For each segment, the value of uuid is the unique ID of the segment. The value of id is the segment number in Insights user interface URLs.

Examples

Example Request (cURL)

curl -X GET --user your_export_token: \
'https://nw1.api.insights.zuora.com/api/export/segments/ACCOUNT'

Example Success Response (JSON)

[
  {
    "uuid": "f089d5bb-b21b-4f60-97b3-ca929c034a37",
    "name": "Churn Risk",
    "objectType": "ACCOUNT",
    "id": 183
  },
  {
    "uuid": "6d1e3133-a7a0-417b-ba7c-0caa03c63043",
    "name": "High Engagement",
    "objectType": "ACCOUNT",
    "id": 120
  }
]

In this example, the second segment corresponds to the account segment available at the following URL:

https://nw1.insights.zuora.com/data/accounts/segments/120

Last modified
18:09, 12 Feb 2017

Tags

This page has no custom tags.

Classifications

(not set)