Chilkat Online Tools

Node.js / Braze Endpoints / Campaign Details

Back to Collection Items

var os = require('os');
if (os.platform() == 'win32') {  
    if (os.arch() == 'ia32') {
        var chilkat = require('@chilkat/ck-node21-win-ia32');
    } else {
        var chilkat = require('@chilkat/ck-node21-win64'); 
    }
} else if (os.platform() == 'linux') {
    if (os.arch() == 'arm') {
        var chilkat = require('@chilkat/ck-node21-arm');
    } else if (os.arch() == 'x86') {
        var chilkat = require('@chilkat/ck-node21-linux32');
    } else {
        var chilkat = require('@chilkat/ck-node21-linux64');
    }
} else if (os.platform() == 'darwin') {
    if (os.arch() == 'arm64') {
        var chilkat = require('@chilkat/ck-node21-mac-m1');
    } else {
        var chilkat = require('@chilkat/ck-node21-macosx');
    }
}


function chilkatExample() {

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

    var http = new chilkat.Http();
    var success;

    var queryParams = new chilkat.JsonObject();
    queryParams.UpdateString("campaign_id","{{campaign_identifier}}");

    // Adds the "Authorization: Bearer {{api_key}}" header.
    http.AuthToken = "{{api_key}}";

    // resp: HttpResponse
    var resp = http.QuickRequestParams("GET","https://rest.iad-01.braze.com/campaigns/details",queryParams);
    if (http.LastMethodSuccess == false) {
        console.log(http.LastErrorText);
        return;
    }

    console.log(resp.StatusCode);
    console.log(resp.BodyStr);


}

chilkatExample();

Curl Command

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

Postman Collection Item JSON

{
  "name": "Campaign Details",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Authorization",
        "value": "Bearer {{api_key}}",
        "type": "text"
      }
    ],
    "url": {
      "raw": "https://{{instance_url}}/campaigns/details?campaign_id={{campaign_identifier}}",
      "protocol": "https",
      "host": [
        "{{instance_url}}"
      ],
      "path": [
        "campaigns",
        "details"
      ],
      "query": [
        {
          "key": "campaign_id",
          "value": "{{campaign_identifier}}",
          "description": "(Required) String\n\nCampaign API identifier"
        }
      ]
    },
    "description": "This endpoint allows you to retrieve relevant information on a specified campaign, which can be identified by the `campaign_id`. \n\n> The campaign_id for API campaigns can be found on the Developer Console page and the campaign details page within your dashboard or you can use the Campaign List Endpoint.\n\n### Components Used\n- [Campaign Identifier](https://www.braze.com/docs/api/identifier_types/)\n\n\n### Campaign Details Endpoint API 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    \"archived\": (boolean) whether this Campaign is archived,\n    \"draft\": (boolean) whether this Campaign is a draft,\n    \"name\" : (string) campaign name,\n    \"description\" : (string) campaign description,\n    \"schedule_type\" : (string) type of scheduling action,\n    \"channels\" : (array) list of channels to send via,\n    \"first_sent\" : (string) date and hour of first sent as ISO 8601 date,\n    \"last_sent\" : (string) date and hour of last sent as ISO 8601 date,\n    \"tags\" : (array) tag names associated with the campaign,\n    \"messages\": {\n        \"message_variation_id\": (string) { // <=This is the actual id\n            \"channel\": (string) channel type of the message (as in, \"email\", \"ios_push\", \"webhook\", \"content_card\", \"in-app_message\", \"sms\"),\n            \"name\": (string) name of the message in the Dashboard (eg., \"Variation 1\")\n            ... channel-specific fields for this message, see below ...\n        }\n    },\n    \"conversion_behaviors\": (array) conversion event behaviors assigned to the campaign (see below)\n}\n```\n\n#### Messages\n\nThe `messages` response will contain information about each message. Example message responses for channels are below:\n\n##### Push Channels\n\n```json\n{\n    \"channel\": (string) description of the channel, such as \"ios_push\" or \"android_push\"\n    \"alert\": (string) alert body text,\n    \"extras\": (hash) any key value pairs provided\n}\n```\n\n##### Email Channel\n\n```json\n{\n    \"channel\": \"email\",\n    \"subject\": (string) subject,\n    \"body\": (string) HTML body,\n    \"from\": (string) from address and display name,\n    \"reply_to\": (string) reply-to for message, if different than \"from\" address,\n    \"title\": (string) name of the email,\n    \"extras\": (hash) any key value pairs provided\n}\n```\n\n##### Content Card Channel\n\n```json\n{\n    \"channel\": \"content_cards\",\n    \"name\": (string) name of variant,\n    \"extras\": (hash) any key value pairs provided; only present if at least one key-value pair has been set\n}\n```\n\n##### Webhook Channel\n\n```json\n{\n    \"channel\": \"webhook\",\n    \"url\": (string) url for webhook,\n    \"body\": (string) payload body,\n    \"type\": (string) body content type,\n    \"headers\": (hash) specified request headers,\n    \"method\": (string) HTTP method (e.g., \"POST\" or \"GET\"),\n}\n```\n\n##### SMS Channel\n\n```json\n{\n  \"channel\": \"sms\",\n  \"body\": (string) payload body,\n  \"from\": (string) list of numbers associated with the subscription group,\n  \"subscription_group_id\": (string) API id of the subscription group targeted in the SMS message\n}\n```\n\n##### Control Messages\n\n```json\n{\n    \"channel\": (string) description of the channel that the control is for,\n    \"type\": \"control\"\n}\n```\n\n#### Conversion Behaviors\n\nThe `conversion_behaviors` array will contain information about each conversion event behavior set for the campaign. These behaviors are in order as set by the campaign. For example, Conversion Event A will be the first item in the array, Conversion Event B will be second, etc. Example conversion event behavior responses for are below:\n\n##### Clicks Email\n\n```json\n{\n    \"type\": \"Clicks Email\",\n    \"window\": (integer) number of seconds during which the user can convert on this event, i.e. - 86400, which is 24 hours\n}\n```\n\n##### Opens Email\n\n```json\n{\n    \"type\": \"Opens Email\",\n    \"window\": (integer) number of seconds during which the user can convert on this event, i.e. - 86400, which is 24 hours\n}\n```\n\n##### Makes Purchase (any purchase)\n\n```json\n{\n    \"type\": \"Makes Any Purchase\",\n    \"window\": (integer) number of seconds during which the user can convert on this event, i.e. - 86400, which is 24 hours\n}\n```\n\n##### Makes Purchase (specific product)\n\n```json\n{\n    \"type\": \"Makes Specific Purchase\",\n    \"window\": (integer) number of seconds during which the user can convert on this event, i.e. - 86400, which is 24 hours,\n    \"product\": (string) name of the product, i.e. - \"Feline Body Armor\"\n}\n```\n\n##### Performs Custom Event\n\n```json\n{\n    \"type\": \"Performs Custom Event\",\n    \"window\": (integer) number of seconds during which the user can convert on this event, i.e. - 86400, which is 24 hours,\n    \"custom_event_name\": (string) name of the event, i.e. - \"Used Feline Body Armor\"\n}\n```\n\n##### Upgrades App\n\n```json\n{\n    \"type\": \"Upgrades App\",\n    \"window\": (integer) number of seconds during which the user can convert on this event, i.e. - 86400, which is 24 hours,\n    \"app_ids\": (array|null) array of app ids, i.e. - [\"12345\", \"67890\"], or `null` if \"Track sessions for any app\" is selected in the UI\n}\n```\n\n##### Uses App\n\n```json\n{\n    \"type\": \"Starts Session\",\n    \"window\": (integer) number of seconds during which the user can convert on this event, i.e. - 86400, which is 24 hours,\n    \"app_ids\": (array|null) array of app ids, i.e. - [\"12345\", \"67890\"], or `null` if \"Track sessions for any app\" is selected in the UI\n}\n```"
  },
  "response": [
  ]
}