Chilkat Online Tools

DataFlex / Braze Endpoints / News Feed Cards List

Back to Collection Items

Use ChilkatAx-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" 1 To iSuccess
    Get ComUpdateString Of hoQueryParams "include_archived" "true" To iSuccess
    Get ComUpdateString Of hoQueryParams "sort_direction" "desc" 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/feed/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=1"
	-d "include_archived=true"
	-d "sort_direction=desc"
	-H "Authorization: Bearer {{api_key}}"
https://rest.iad-01.braze.com/feed/list

Postman Collection Item JSON

{
  "name": "News Feed Cards List",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Authorization",
        "value": "Bearer {{api_key}}",
        "type": "text"
      }
    ],
    "url": {
      "raw": "https://{{instance_url}}/feed/list?page=1&include_archived=true&sort_direction=desc",
      "protocol": "https",
      "host": [
        "{{instance_url}}"
      ],
      "path": [
        "feed",
        "list"
      ],
      "query": [
        {
          "key": "page",
          "value": "1",
          "description": "(Optional) Integer\n\nThe page of cards to return, defaults to 0 (returns the first set of up to 100)"
        },
        {
          "key": "include_archived",
          "value": "true",
          "description": "(Optional) Boolean\n\nWhether or not to include archived cards, defaults to false"
        },
        {
          "key": "sort_direction",
          "value": "desc",
          "description": "(Optional) String\n\nPass in the value `desc` to sort by creation time from newest to oldest. Pass in `asc` to sort from oldest to newest. If sort_direction is not included, the default order is oldest to newest."
        }
      ]
    },
    "description": "This endpoint allows you to export a list of News Feed cards, each of which will include its name and Card API Identifier. The cards are returned in groups of 100 sorted by time of creation (oldest to newest by default).\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    \"cards\" : [\n        {\n            \"id\" : (string) Card API Identifier,\n            \"type\" : (string) type of the card - NewsItem (classic cards), CaptionedImage, Banner or DevPick (cross-promotional cards),\n            \"title\" : (string) title of the card,\n            \"tags\" : (array) tag names associated with the card\n        },\n        ...\n    ]\n}\n```"
  },
  "response": [
  ]
}