BrazeEx.Api.ExportSegment (braze_ex v1.0.3)

API calls for all endpoints tagged ExportSegment.

Link to this section Summary

Functions

Segment Analytics

This endpoint allows you to retrieve a daily series of the size of a segment over time for a segment.

Segment Details

This endpoint allows you to retrieve relevant information on the segment, which can be identified by the segment_id.

Segment List

This endpoint allows you 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.

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()}

segment-analytics

Segment Analytics

This endpoint allows you to retrieve a daily series of the size of a segment over time for a segment.

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
      },
      ...
  ]
}

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 in your Developer Console within your Braze account or you can use the 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()}

segment-details

Segment Details

This endpoint allows you to retrieve relevant information on the segment, which can be identified by the segment_id.

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
}

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 in your Developer Console within your Braze account or you can use the Segment List Endpoint.

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()}

segment-list

Segment List

This endpoint allows you 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.

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
      },
      ...
  ]
}

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