GET /campaigns/:id
Retrieve campaign information.
Description
This endpoint allows you to retrieve a specific campaign by its unique identifier.
HTTP Request
GET https://api.andopen.com/campaigns/:id
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | String | Yes | The campaign identifier (UUID) |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
include | String | No | Comma-separated list of relationships to include |
Available Relationship Tree
The following relationship tree shows all available include paths:
campaigns
├── products
├── variants
├── variant_stock_levels
└── warehouse
Valid Include Paths
Based on the relationship tree above, these are the valid include parameter values:
| Path | Description | Levels |
|---|---|---|
products | Include campaign products | 1 |
products.variants | Include products with their variants | 2 |
products.variants.variant_stock_levels | Include products, variants, and stock levels | 3 |
products.variants.variant_stock_levels.warehouse | Include full inventory hierarchy | 4 |
Example Requests
curl -X GET \
'https://api.andopen.co/campaigns/b543b00b-7394-4185-972e-f060f6724298?include=products.variants.variant_stock_levels.warehouse'
Responses
The state field indicates the current status of the campaign and can have one of the following values:
| Value | Description |
|---|---|
available | Campaign is active and available for use |
archived | Campaign has been archived and is no longer active |
🟢 Success Response (200 Success)
{
"data": {
"id": "ee57e819-d0d8-44f2-9513-438ae025d2b9",
"type": "campaigns",
"attributes": {
"name": "Engineers birthday automation",
"description": "Automated campaign for gifting to segment Engineers",
"state": "available",
"archived_at": null,
"created_at": "2025-07-01T15:59:48.479Z",
"updated_at": "2025-07-01T15:59:48.479Z"
},
"relationships": {
"products": {
"data": [
{
"type": "products",
"id": "1e9c46b4-e38d-4db5-83c5-94c6ff466694"
},
{
"type": "products",
"id": "1e9c46b4-e38d-4db5-83c5-94c6ff466694"
},
{
"type": "products",
"id": "1e9c46b4-e38d-4db5-83c5-94c6ff466694"
}
]
}
}
},
"included": [
{
"id": "1e9c46b4-e38d-4db5-83c5-94c6ff466694",
"type": "products",
"attributes": {
"name": "Nicely Odd Candle",
"enabled": true,
"created_at": "2021-01-15T12:11:00.822Z",
"updated_at": "2025-07-01T18:00:16.953Z"
},
"relationships": {
"variants": {
"data": [
{
"type": "variants",
"id": "e234ed04-3d65-4116-b8d2-8e06b91e3804"
},
{
"type": "variants",
"id": "6f5d7c09-de58-4cde-ba45-4b40d195bb47"
},
{
"type": "variants",
"id": "e27cf6c4-6b0d-44ec-bf8b-8cf8d2e06d76"
}
]
}
}
},
{
"id": "e234ed04-3d65-4116-b8d2-8e06b91e3804",
"type": "variants",
"attributes": {
"name": "Default Title",
"sku": "AO-HAY01-001",
"enabled": true,
"created_at": "2022-07-28T15:04:31.162Z",
"updated_at": "2023-02-02T12:57:52.685Z"
},
"relationships": {
"variant_stock_levels": {
"data": [
{
"type": "variant_stock_levels",
"id": "66d61ce7-ea1a-490a-aa69-2ebb261f595e"
}
]
}
}
},
{
"id": "6f5d7c09-de58-4cde-ba45-4b40d195bb47",
"type": "variants",
"attributes": {
"name": "Blue",
"sku": "AO-HAY01-001",
"enabled": false,
"created_at": "2021-01-15T12:11:05.788Z",
"updated_at": "2023-05-31T14:08:36.994Z"
},
"relationships": {
"variant_stock_levels": {
"data": [
{
"type": "variant_stock_levels",
"id": "d445bc34-ae57-4afd-a5a5-d5a3d5bad379"
}
]
}
}
},
{
"id": "e27cf6c4-6b0d-44ec-bf8b-8cf8d2e06d76",
"type": "variants",
"attributes": {
"name": "Yellow",
"sku": "AO-HAY02-002",
"enabled": false,
"created_at": "2021-01-15T12:11:01.538Z",
"updated_at": "2025-07-01T18:00:13.821Z"
},
"relationships": {
"variant_stock_levels": {
"data": [
{
"type": "variant_stock_levels",
"id": "5f8ff719-972f-457b-b846-18200620cd0a"
}
]
}
}
},
{
"id": "66d61ce7-ea1a-490a-aa69-2ebb261f595e",
"type": "variant_stock_levels",
"attributes": {
"available": 4,
"created_at": "2022-08-10T00:00:42.827Z",
"updated_at": "2025-02-12T11:55:52.168Z"
},
"relationships": {
"warehouse": {
"data": {
"type": "warehouses",
"id": "3f7f3b2c-1903-4ddb-ba7d-f5a3041db66c"
}
}
}
},
{
"id": "d445bc34-ae57-4afd-a5a5-d5a3d5bad379",
"type": "variant_stock_levels",
"attributes": {
"available": 4,
"created_at": "2021-09-02T14:21:56.576Z",
"updated_at": "2025-02-12T11:55:49.694Z"
},
"relationships": {
"warehouse": {
"data": {
"type": "warehouses",
"id": "3f7f3b2c-1903-4ddb-ba7d-f5a3041db66c"
}
}
}
},
{
"id": "5f8ff719-972f-457b-b846-18200620cd0a",
"type": "variant_stock_levels",
"attributes": {
"available": 50,
"created_at": "2021-09-02T14:21:56.970Z",
"updated_at": "2024-09-13T09:20:35.269Z"
},
"relationships": {
"warehouse": {
"data": {
"type": "warehouses",
"id": "3f7f3b2c-1903-4ddb-ba7d-f5a3041db66c"
}
}
}
},
{
"id": "3f7f3b2c-1903-4ddb-ba7d-f5a3041db66c",
"type": "warehouses",
"attributes": {
"name": "Dublin/Ireland",
"enabled": true,
"created_at": "2021-09-02T14:21:26.238Z",
"updated_at": "2024-05-24T09:17:46.843Z"
}
}
],
"jsonapi": {
"version": "1.0"
}
}
🔴 Error Response (404 NotFound)
{
"errors":
[
{
"status": "404",
"detail": "Couldn't find Campaign with e276c11e-f27b-4a6d-b9e4-f53cd5cd3d32"
}
],
"jsonapi": {
"version": "1.0"
}
}
Code Examples
- cURL
- Ruby
- JavaScript
- Java
- Python
- PHP
curl -X GET "https://api.andopen.com/campaigns/e276c11e-f27b-4a6d-b9e4-f53cd5cd3d32" \
-H 'Content-Type: application/vnd.api+json' \
-H 'AndOpen-API-Version: 2025-09' \
-H "Authorization: Bearer <api_key>
require 'net/http'
require 'json'
uri = URI('https://api.andopen.com/campaigns/e276c11e-f27b-4a6d-b9e4-f53cd5cd3d32')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Content-Type'] = 'application/vnd.api+json'
request['Authorization'] = 'Bearer <api_key>'
request['AndOpen-API-Version'] = '2025-09'
response = http.request(request)
campaign = JSON.parse(response.body)
fetch('https://api.andopen.com/campaigns/e276c11e-f27b-4a6d-b9e4-f53cd5cd3d32', {
method: 'GET',
headers: {
'Content-Type': 'application/vnd.api+json',
'Authorization': 'Bearer <api_key>',
'AndOpen-API-Version': '2025-09'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.BufferedReader;
import java.io.InputStreamReader;
URL url = new URL("https://api.andopen.com/campaigns/e276c11e-f27b-4a6d-b9e4-f53cd5cd3d32");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setRequestProperty("Content-Type", "application/vnd.api+json");
conn.setRequestProperty("Authorization", "Bearer <api_key>");
conn.setRequestProperty("AndOpen-API-Version", "2025-09");
int responseCode = conn.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_OK) {
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String inputLine;
StringBuilder response = new StringBuilder();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
}
import requests
url = "https://api.andopen.com/campaigns/e276c11e-f27b-4a6d-b9e4-f53cd5cd3d32"
headers = {
"Content-Type": "application/vnd.api+json",
"Authorization": "Bearer <api_key>",
"AndOpen-API-Version": "2025-09"
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
campaign = response.json()
print(campaign)
else:
print(f"Error: {response.status_code} - {response.text}")
<?php
$url = 'https://api.andopen.com/campaigns/e276c11e-f27b-4a6d-b9e4-f53cd5cd3d32';
$headers = [
'Content-Type: application/vnd.api+json',
'Authorization: Bearer <api_key>',
'AndOpen-API-Version: 2025-09'
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($http_code === 200) {
$campaign = json_decode($response, true);
print_r($campaign);
} else {
echo "Error: HTTP " . $http_code . " - " . $response;
}
curl_close($ch);
?>