List Variables

List Variables

GET https://api.ocamba.com/v1/hood/variables
Returns a list of Variables

Tip

Sortable fields are: name, system, is_visible, create_time and update_time.

Searchable field is: name.

Filterable fields are: id, name, group_type, type, system, is_visible, create_time and update_time.

Rate limits:

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

Query parameters

parameters

Response schemas

curl -X GET \
 "https://api.ocamba.com/v1/hood/variables" \
  -H "Authorization: Bearer {TOKEN}"
const url = 'https://api.ocamba.com/v1/hood/variables';
const options = {
  method: 'GET',
  headers: {
    Authorization: `Bearer {TOKEN}`
  }
};

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/variables");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Authorization: Bearer {TOKEN}"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

Responses

200 OK

{
  "total": 27,
  "items": [            
    {
      "id": "1000",
      "company_id": "4391241",
      "name": "url variable",
      "group_type": "navigation",
      "type": "url",
      "settings": {
          "component_type": "host-name",
          "strip": true
      },
      "formatting": {
          "change_case": "lowercase",
          "convert_null_to": "test",
          "convert_undefined_to": "test",
          "convert_true_to": "false"
      },
      "system": 0,
      "is_visible": false,
      "create_time": "2025-01-22 13:26:27",
      "update_time": "2025-01-22 13:26:27"
    },
    {
      "id": "1001",
      "company_id": "4391241",
      "name": "referrer variable",
      "group_type": "navigation",
      "type": "referrer",
      "settings": {
          "component_type": "path",
          "default_pages": "/home"
      },
      "formatting": {
          "change_case": "lowercase",
          "convert_null_to": "test",
          "convert_undefined_to": "test",
          "convert_true_to": "false"
      },                  
      "system": 0,
      "is_visible": false,
      "create_time": "2025-01-22 13:26:27",
      "update_time": "2025-01-22 13:26:27"
    },
    {
      "id": "1001",
      "company_id": "4391241",
      "name": "page element variable",,
      "group_type": "page-elements",,
      "type": "element-visibility",
      "settings": {
          "selection_method": "id",
          "output_type": "true/false",
          "percent": 50
      },
      "formatting": {
          "change_case": "lowercase",
          "convert_null_to": "test",
          "convert_undefined_to": "test",
          "convert_true_to": "false"
      },                  
      "system": 0,
      "is_visible": false,
      "create_time": "2025-01-22 13:26:27",
      "update_time": "2025-01-22 13:26:27"
    },
    {
      "id": "1001",
      "company_id": "4391241",
      "name": "dom-element variable",
      "group_type": "page-elements",
      "type": "dom-element",
      "settings": {
          "selection_method": "id",
          "element_id": "TEST123",
          "attribute_name": "example-name"
      },
      "formatting": {
          "change_case": "lowercase",
          "convert_null_to": "test",
          "convert_undefined_to": "test",
          "convert_true_to": "false"
      },                  
      "system": 0,
      "is_visible": false,
      "create_time": "2025-01-22 13:26:27",
      "update_time": "2025-01-22 13:26:27"
    }            
  ]
}                

400 Bad Request

{
  "code": 400,
  "title": "Bad request.",
  "message": "The request 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