Chilkat Online Tools

Android / Braze Endpoints / Campaign Details

Back to Collection Items

// Important: Don't forget to include the call to System.loadLibrary
// as shown at the bottom of this code sample.
package com.test;

import android.app.Activity;
import com.chilkatsoft.*;

import android.widget.TextView;
import android.os.Bundle;

public class SimpleActivity extends Activity {

  private static final String TAG = "Chilkat";

  // Called when the activity is first created.
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

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

    CkHttp http = new CkHttp();
    boolean success;

    CkJsonObject queryParams = new CkJsonObject();
    queryParams.UpdateString("campaign_id","{{campaign_identifier}}");

    // Adds the "Authorization: Bearer {{api_key}}" header.
    http.put_AuthToken("{{api_key}}");

    CkHttpResponse resp = http.QuickRequestParams("GET","https://rest.iad-01.braze.com/campaigns/details",queryParams);
    if (http.get_LastMethodSuccess() == false) {
        Log.i(TAG, http.lastErrorText());
        return;
        }

    Log.i(TAG, String.valueOf(resp.get_StatusCode()));
    Log.i(TAG, resp.bodyStr());


  }

  static {
      System.loadLibrary("chilkat");

      // Note: If the incorrect library name is passed to System.loadLibrary,
      // then you will see the following error message at application startup:
      //"The application <your-application-name> has stopped unexpectedly. Please try again."
  }
}

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": [
  ]
}