Chilkat Online Tools

DataFlex / Braze Endpoints / Canvas Details

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 ComUpdateString Of hoQueryParams "canvas_id" "{{canvas_identifier}}" 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/canvas/details" 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 "canvas_id=%7B%7Bcanvas_identifier%7D%7D"
	-H "Authorization: Bearer {{api_key}}"
https://rest.iad-01.braze.com/canvas/details

Postman Collection Item JSON

{
  "name": "Canvas Details",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Authorization",
        "value": "Bearer {{api_key}}",
        "type": "text"
      }
    ],
    "url": {
      "raw": "https://{{instance_url}}/canvas/details?canvas_id={{canvas_identifier}}",
      "protocol": "https",
      "host": [
        "{{instance_url}}"
      ],
      "path": [
        "canvas",
        "details"
      ],
      "query": [
        {
          "key": "canvas_id",
          "value": "{{canvas_identifier}}",
          "description": "(Required) String\n\nCanvas API Identifier "
        }
      ]
    },
    "description": "This endpoint allows you to export metadata about a Canvas, such as its name, when it was created, its current status, and more.\n\n### Components Used\n- [Canvas Identifier](https://www.braze.com/docs/api/identifier_types/)\n\n## Response\n\n```json\nContent-Type: application/json\nAuthorization: Bearer YOUR-REST-API-KEY\n{\n  \"created_at\": (string) date created as ISO 8601 date,\n  \"updated_at\": (string) date updated as ISO 8601 date,\n  \"name\": (string) Canvas name,\n  \"description\": (string) Canvas description,\n  \"archived\": (boolean) whether this Canvas is archived,\n  \"draft\": (boolean) whether this Canvas is a draft,\n  \"schedule_type\": (string) type of scheduling action,\n  \"first_entry\": (string) date of first entry as ISO 8601 date,\n  \"last_entry\": (string) date of last entry as ISO 8601 date,\n  \"channels\": (array of strings) step channels used with Canvas,\n  \"variants\": [\n    {\n      \"name\": (string) name of variant,\n      \"id\": (string) API identifier of the variant,\n      \"first_step_ids\": (array of strings) API identifiers for first steps in variant,\n      \"first_step_id\": (string) API identifier of first step in variant (deprecated in November 2017, only included if the variant has only one first step)\n    },\n    ... (more variations)\n  ],\n  \"tags\": (array of strings) tag names associated with the Canvas,\n  \"steps\": [\n    {\n      \"name\": (string) name of step,\n      \"id\": (string) API identifier of the step,\n      \"next_step_ids\": (array of strings) API identifiers of steps following step,\n      \"channels\": (array of strings) channels used in step,\n      \"messages\": {\n          \"message_variation_id\": (string) {  // <=This is the actual id\n              \"channel\": (string) channel type of the message (eg., \"email\"),\n              ... channel-specific fields for this message, see Campaign Details Endpoint API Response for example message responses ...\n          }\n      }\n    },\n    ... (more steps)\n  ],\n  \"message\": (required, string) the status of the export, returns 'success' when completed without errors\n}\n```"
  },
  "response": [
  ]
}