Chilkat Online Tools

DataFlex / Braze Endpoints / Custom Events List

Back to Collection Items

Use ChilkatAx-9.5.0-win32.pkg

Procedure Test
    Handle hoHttp
    Boolean iSuccess
    Variant vQueryParams
    Handle hoQueryParams
    Variant vResp
    Handle hoResp
    String sTemp1
    Integer iTemp1
    Boolean bTemp1

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    Get Create (RefClass(cComChilkatHttp)) To hoHttp
    If (Not(IsComObjectCreated(hoHttp))) Begin
        Send CreateComObject of hoHttp
    End

    Get Create (RefClass(cComChilkatJsonObject)) To hoQueryParams
    If (Not(IsComObjectCreated(hoQueryParams))) Begin
        Send CreateComObject of hoQueryParams
    End
    Get ComUpdateInt Of hoQueryParams "page" 3 To iSuccess

    // Adds the "Authorization: Bearer {{api_key}}" header.
    Set ComAuthToken Of hoHttp To "{{api_key}}"

    Get pvComObject of hoQueryParams to vQueryParams
    Get ComQuickRequestParams Of hoHttp "GET" "https://rest.iad-01.braze.com/events/list" vQueryParams To vResp
    If (IsComObject(vResp)) Begin
        Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
        Set pvComObject Of hoResp To vResp
    End
    Get ComLastMethodSuccess Of hoHttp To bTemp1
    If (bTemp1 = False) Begin
        Get ComLastErrorText Of hoHttp To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get ComStatusCode Of hoResp To iTemp1
    Showln iTemp1
    Get ComBodyStr Of hoResp To sTemp1
    Showln sTemp1
    Send Destroy of hoResp


End_Procedure

Curl Command

curl -G -d "page=3"
	-H "Authorization: Bearer {{api_key}}"
https://rest.iad-01.braze.com/events/list

Postman Collection Item JSON

{
  "name": "Custom Events List",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Authorization",
        "value": "Bearer {{api_key}}",
        "type": "text"
      }
    ],
    "url": {
      "raw": "https://{{instance_url}}/events/list?page=3",
      "protocol": "https",
      "host": [
        "{{instance_url}}"
      ],
      "path": [
        "events",
        "list"
      ],
      "query": [
        {
          "key": "page",
          "value": "3",
          "description": "(Optional) Integer\n\nThe page of event names to return, defaults to 0 (returns the first set of up to 250)"
        }
      ]
    },
    "description": "This endpoint allows you to export a list of custom events that have been recorded for your app. The event names are returned in groups of 250, sorted alphabetically.\n\n\n## Response\n\n```json\nContent-Type: application/json\nAuthorization: Bearer YOUR-REST-API-KEY\n{\n    \"message\": (required, string) the status of the export, returns 'success' when completed without errors,\n    \"events\" : [\n        \"Event A\",\n        \"Event B\",\n        \"Event C\",\n        ...\n    ]\n}\n```\n\n### Fatal Error Response Codes\n\nThe following status codes and associated error messages will be returned if your request encounters a fatal error. Any of these error codes indicate that no data will be processed.\n\n| Error Code       | Reason / Cause                                                   |\n| ---------------- | ---------------------------------------------------------------- |\n| 400 Bad Request  | Bad Syntax                                                       |\n| 401 Unauthorized | Unknown or missing REST API Key                                  |\n| 429 Rate Limited | Over rate limit                                                  |\n| 5XX              | Internal server error, you should retry with exponential backoff |"
  },
  "response": [
  ]
}