BrazeEx.Api.ExportSegment (braze_ex v1.0.22)

API calls for all endpoints tagged ExportSegment.

Link to this section Summary

Functions

Export Segment Analytics

Use this endpoint to retrieve a daily series of the estimated size of a segment over time.

Export Segment Details

Use this endpoint to retrieve relevant information on a segment, which can be identified by the segment_id.

Export Segment List

Use this endpoint to export a list of segments, each of which will include its name, Segment API identifier, and whether it has analytics tracking enabled.

Link to this section Functions

Link to this function

segments_data_series_get(connection, opts \\ [])

@spec segments_data_series_get(
  Tesla.Env.client(),
  keyword()
) :: {:ok, nil} | {:error, Tesla.Env.t()}

export-segment-analytics

Export Segment Analytics

Use this endpoint to retrieve a daily series of the estimated size of a segment over time.

Note: If you are using our older navigation, segment_id can be found at Developer Console > API Settings.

To use this endpoint, you’ll need to generate an API key with the segments.data_series permission.

rate-limit

Rate limit

We apply the default Braze rate limit of 250,000 requests per hour to this endpoint, as documented in API rate limits.

response

Response

Content-Type: application/json
Authorization: Bearer YOUR-REST-API-KEY
{
  "message": (required, string) the status of the export, returns 'success' when completed without errors,
  "data" : [
      {
          "time" : (string) date as ISO 8601 date,
          "size" : (int) size of the segment on that date
      },
      ...
  ]
}

Tip: For help with CSV and API exports, visit Export troubleshooting.

parameters

Parameters

  • connection (BrazeEx.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :Authorization (String.t):
    • :segment_id (String.t): (Required) String See Segment API identifier. The segment_id for a given segment can be found on the API Keys page within your Braze account or you can use the Export segment list endpoint.
    • :length (integer()): (Required) Integer Max number of days before ending_at to include in the returned series - must be between 1 and 100 (inclusive).
    • :ending_at (String.t): (Optional) Datetime (ISO 8601 string) Date on which the data series should end. Defaults to time of the request.

returns

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

segments_details_get(connection, opts \\ [])

@spec segments_details_get(
  Tesla.Env.client(),
  keyword()
) :: {:ok, nil} | {:error, Tesla.Env.t()}

export-segment-details

Export Segment Details

Use this endpoint to retrieve relevant information on a segment, which can be identified by the segment_id.

Note: If you are using our older navigation, segment_id can be found at Developer Console > API Settings.

To use this endpoint, you’ll need to generate an API key with the segments.details permission.

rate-limit

Rate limit

We apply the default Braze rate limit of 250,000 requests per hour to this endpoint, as documented in API rate limits.

response

Response

Content-Type: application/json
Authorization: Bearer YOUR-REST-API-KEY
{
    "message": (required, string) the status of the export, returns 'success' when completed without errors,
    "created_at" : (string) date created as ISO 8601 date,
    "updated_at" : (string) date last updated as ISO 8601 date,
    "name" : (string) segment name,
    "description" : (string) human-readable description of filters,
    "text_description" : (string) segment description, 
    "tags" : (array) tag names associated with the segment
}

Tip: For help with CSV and API exports, visit Export troubleshooting.

parameters

Parameters

  • connection (BrazeEx.Connection): Connection to server
  • opts (keyword): Optional parameters

returns

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

segments_list_get(connection, opts \\ [])

@spec segments_list_get(
  Tesla.Env.client(),
  keyword()
) :: {:ok, nil} | {:error, Tesla.Env.t()}

export-segment-list

Export Segment List

Use this endpoint to export a list of segments, each of which will include its name, Segment API identifier, and whether it has analytics tracking enabled.

The segments are returned in groups of 100 sorted by time of creation (oldest to newest by default). Archived segments are not included.

To use this endpoint, you’ll need to generate an API key with the segments.list permission.

rate-limit

Rate limit

We apply the default Braze rate limit of 250,000 requests per hour to this endpoint, as documented in API rate limits.

response

Response

Content-Type: application/json
Authorization: Bearer YOUR-REST-API-KEY
{
  "message": (required, string) the status of the export, returns 'success' when completed without errors,
  "segments" : [
      {
          "id" : (string) Segment API Identifier,
          "name" : (string) segment name,
          "analytics_tracking_enabled" : (boolean) whether the segment has analytics tracking enabled,
          "tags" : (array) tag names associated with the segment
      },
      ...
  ]
}

Tip: For help with CSV and API exports, visit Export troubleshooting.

parameters

Parameters

  • connection (BrazeEx.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :Authorization (String.t):
    • :page (integer()): (Optional) Integer The page of segments to return, defaults to 0 (returns the first set of up to 100).
    • :sort_direction (String.t): (Optional) String - Sort creation time from newest to oldest: pass in the value desc. - Sort creation time from oldest to newest: pass in the value asc. If sort_direction is not included, the default order is oldest to newest.

returns

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure