Create Tag

Create Tag

POST https://api.ocamba.com/v1/hood/tags
Creates a Tag

Rate limits:

  • Burst: 10/s
  • Steady: 150/m

Request schema

body

Response schemas

curl -X POST \
 "https://api.ocamba.com/v1/hood/tags" \
  -H "Authorization: Bearer {TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
  "account_id": "86446726",
  "name": "Tag",
  "status": "active",
  "apps": {
    "web": [
      "example.com"
    ],
    "android": [
      "com.example.demo"
    ],
    "ios": [
      "com.example.iosdemo"
    ]
  }
}'
const url = 'https://api.ocamba.com/v1/hood/tags';
const options = {
  method: 'POST',
  headers: {
    Authorization: "Bearer {TOKEN}",
    'Content-Type': "application/json"
  },
  body: JSON.stringify(
    {
      "account_id": "86446726",
      "name": "Tag",
      "status": "active",
      "apps": {
        "web": [
          "example.com"
        ],
        "android": [
          "com.example.demo"
        ],
        "ios": [
          "com.example.iosdemo"
        ]
      }
    }
  )
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
$ch = curl_init("https://api.ocamba.com/v1/hood/tags");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Authorization: Bearer {TOKEN}",
  "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
  [
    "account_id" => "86446726",
    "name" => "Tag",
    "status" => "active",
    "apps" => [
      "web" => [
        "example.com"
      ],
      "android" => [
        "com.example.demo"
      ],
      "ios" => [
        "com.example.iosdemo"
      ]
    ]
  ]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

Responses

201 Created

{
  "id": "1000",
  "company_id": "1000000",
  "account_id": "1000001",
  "account": {
    "id": "1000001",
    "status": "active",
    "configured_status": "active",
    "name": "Demo Account",
    "image": "https://path/logo.jpeg"
  },
  "creator_id": "1000002",
  "name": "Demo Tag",
  "status": "active",
  "apps": {
    "web": [
      "ocamba.com"
    ],
    "android": [
      "com.Ocamba.demo"
    ],
    "ios": [
      "com.ocamba.iosdemo"
    ]
  },
  "icon": "http://ocamba.storage.com/1000000/hood/tags/1000/icons/favicon.ico",
  "utm_ht": "NjY4bL60NobpWTQ2O94xNDY4MjE0Np6l",
  "settings": {
    "general": {
      "include_subdomains": true,
      "analytics": true,
      "push": true,
      "consent": true
    },
    "web": {
      "push_key": "KKV4lql8gxn0lC6NLiLWMSgGq9Orq7ZVYsbbspNlNthspH_Uul5DzG9nx_zUvRiCvox8bLfhvjYbqWfDv9iqbLze"
    }
  },
  "description": "This is my first tag.",
  "stats": {
    "pageviews": 10,
    "sessions": 6,
    "users": 4,
    "push_subscriptions": 2,
    "push_unsubscriptions": 1
  },
  "create_time": "2021-10-29 12:47:00",
  "update_time": "2021-10-30 14:27:26"
}

400 Bad Request

{
  "code": 400,
  "title": "Bad request.",
  "message": "The request body is not valid.",
  "trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}

500 Internal Server Error

{
  "code": 500,
  "title": "Internal server error.",
  "trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}
Responses
Note
Web app names are sanitized to be all lowercase. Android and iOS app names stay the same. Mandatory fields are Tag Name and Account.