> ## Documentation Index
> Fetch the complete documentation index at: https://docs.withbenji.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Campaign

> Endpoint to retrieve campaign basic data

<Note>The `x-api-key` header value to be used on this API is your **partner API key**, which can be generated through the dashboard.</Note>

<ParamField path="id" type="integer" required>
  The Benji Platform ID of the campaign
</ParamField>

### Return values

<ResponseField name="campaign" type="object">
  A campaign object property

  <Expandable title="properties" defaultOpen="true">
    <ResponseField name="id" type="integer">Benji Platform campaign identifier</ResponseField>
    <ResponseField name="name" type="string">The campaign display name as configured on the Benji Platform</ResponseField>
    <ResponseField name="description" type="string">The campaign's description as configured on the Benji platform</ResponseField>
    <ResponseField name="campaign_logo" type="string">URL of a marketing logo associated with the campaign</ResponseField>

    <ResponseField name="campaign_type" type="integer">
      Integer representing an enum of one of the following campaign type values:

      <Expandable title="possible campaign type values" type="enum">
        * **EARN (1)** : Indicating an earn rewards campaign type <br />
        * **REDEEM (2)** : Indicating a redeem rewards campaign type  <br />
        * **CONNECT\_ONLY (3)** : Indicating a status sharing campaign with no ability to earn or redeem rewards
      </Expandable>
    </ResponseField>

    <ResponseField name="trigger_type" type="integer">
      Integer representing an enum of one of the following campaign trigger values:

      <Expandable title="possible trigger type values" type="enum">
        * **SPEND (1)** : Indicating a campaign triggered on a transaction <br />
        * **REGISTRATION (2)** : Indicating a campaign triggered on a new user registration  <br />
        * **REFERRAL (3)** : Indicating a campaign triggered on a successful user referral action <br />
        * **CUSTOM (4)** : Indicating a campaign triggered by a custom action
      </Expandable>
    </ResponseField>

    <ResponseField name="merchant_id" type="integer">The ID of the merchant partner associated with this campaign in the Benji Platform</ResponseField>
    <ResponseField name="partner_id" type="integer">The ID of the partner associated with this campaign in the Benji Platform</ResponseField>
    <ResponseField name="base_reward" type="integer">The base reward conversion rate for earn and redeem type campaigns</ResponseField>
    <ResponseField name="start_date" type="datetime">The date this campaign will go live</ResponseField>
    <ResponseField name="end_date" type="datetime">The date this campaign will end</ResponseField>
    <ResponseField name="total_rewards" type="integer">The total amount of rewards earned or redeemed through this campaign</ResponseField>
    <ResponseField name="is_active" type="integer">Integer indicating if this campaign has been activated, 1 specifying active and 0 specifying not active</ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json 200 theme={null}
  {
      "code": "ok",
      "data": {
          "campaign": {
              "base_reward": 1,
              "campaign_logo": "testcampaign.png",
              "campaign_type": 1,
              "created_date": "2024-11-20T00:30:57.256493+00:00",
              "description": "This is a test campaign",
              "end_date": null,
              "id": 1,
              "is_active": 1,
              "is_deleted": 0,
              "merchant_id": 1,
              "name": "Test Campaign",
              "owner_id": 5,
              "partner_id": 3,
              "start_date": "2024-11-14T03:18:06+00:00",
              "total_rewards": 100,
              "trigger_type": 1
          }
      }
  }
  ```

  ```json 400 theme={null}
  {
    "error": "invalid_token",
    "message": "Invalid token"
  }
  ```

  ```json 401 theme={null}
  {
    "error": "unauthorized_request",
    "message": "Token is not authorized to make this request"
  }
  ```

  ```json 404 theme={null}
  {
    "error": "campaign_does_not_exist",
    "message": "The campaign does not exist"
  }
  ```
</ResponseExample>

<Tip>Note that you will only receive data that you as a loyalty partner or merchant partner are allowed to see based on the permissions in the access token you provide to the API.</Tip>
