Chilkat Online Tools

SQL Server / Braze Endpoints / News Feed Cards Details

Back to Collection Items

-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls.
--
CREATE PROCEDURE ChilkatSample
AS
BEGIN
    DECLARE @hr int
    DECLARE @iTmp0 int
    -- Important: Do not use nvarchar(max).  See the warning about using nvarchar(max).
    DECLARE @sTmp0 nvarchar(4000)
    -- This example assumes the Chilkat API to have been previously unlocked.
    -- See Global Unlock Sample for sample code.

    DECLARE @http int
    -- Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.Http', @http OUT
    IF @hr <> 0
    BEGIN
        PRINT 'Failed to create ActiveX component'
        RETURN
    END

    DECLARE @success int

    DECLARE @queryParams int
    -- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @queryParams OUT

    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'card_id', '{{card_identifier}}'

    -- Adds the "Authorization: Bearer {{api_key}}" header.
    EXEC sp_OASetProperty @http, 'AuthToken', '{{api_key}}'

    DECLARE @resp int
    EXEC sp_OAMethod @http, 'QuickRequestParams', @resp OUT, 'GET', 'https://rest.iad-01.braze.com/feed/details', @queryParams
    EXEC sp_OAGetProperty @http, 'LastMethodSuccess', @iTmp0 OUT
    IF @iTmp0 = 0
      BEGIN
        EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT
        PRINT @sTmp0
        EXEC @hr = sp_OADestroy @http
        EXEC @hr = sp_OADestroy @queryParams
        RETURN
      END

    EXEC sp_OAGetProperty @resp, 'StatusCode', @iTmp0 OUT
    PRINT @iTmp0
    EXEC sp_OAGetProperty @resp, 'BodyStr', @sTmp0 OUT
    PRINT @sTmp0
    EXEC @hr = sp_OADestroy @resp


    EXEC @hr = sp_OADestroy @http
    EXEC @hr = sp_OADestroy @queryParams


END
GO

Curl Command

curl -G -d "card_id=%7B%7Bcard_identifier%7D%7D"
	-H "Authorization: Bearer {{api_key}}"
https://rest.iad-01.braze.com/feed/details

Postman Collection Item JSON

{
  "name": "News Feed Cards Details",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Authorization",
        "type": "text",
        "value": "Bearer {{api_key}}"
      }
    ],
    "url": {
      "raw": "https://{{instance_url}}/feed/details?card_id={{card_identifier}}",
      "protocol": "https",
      "host": [
        "{{instance_url}}"
      ],
      "path": [
        "feed",
        "details"
      ],
      "query": [
        {
          "key": "card_id",
          "value": "{{card_identifier}}",
          "description": "(Required) String\n\nCard API identifier "
        }
      ]
    },
    "description": "This endpoint allows you to retrieve relevant information on the card, which can be identified by the `card_id`.\n\n### Components Used\n- [Card ID](https://www.braze.com/docs/api/identifier_types/)\n- [News Feed List](https://www.braze.com/docs/api/endpoints/export/news_feed/get_news_feed_cards/)\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    \"created_at\" : (string) Date created as ISO 8601 date,\n    \"updated_at\" : (string) Date last updated as ISO 8601 date,\n    \"name\" : (string) Card name,\n    \"publish_at\" : (string) Date card was published as ISO 8601 date,\n    \"end_at\" : (string) Date card will stop displaying for users as ISO 8601 date,\n    \"tags\" : (array) Tag names associated with the card,\n    \"title\" : (string) Title of the card,\n    \"image_url\" : (string) Image URL used by this card,\n    \"extras\" : (dictionary) Dictionary containing key-value pair data attached to this card,\n    \"description\" : (string) Description text used by this card,\n    \"archived\": (boolean) whether this Card is archived,\n    \"draft\": (boolean) whether this Card is a draft,\n}\n```"
  },
  "response": [
  ]
}