Create Automation

Create Automation

POST https://api.ocamba.com/v2/ocamba/ebs/automations
Creates a new Automation object

Request schema

body

Response schemas

curl -X POST \
 "https://api.ocamba.com/v2/ocamba/ebs/automations" \
  -H "Authorization: Bearer {TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
  "status": "active",
  "name": "Push welcome",
  "description": "Push adex welcome notification",
  "event": {
    "id": "1000",
    "integration_id": "10000"
  },
  "actions": {
    "id": "1002",
    "integration_id": "10000",
    "data": {
      "user_id": "{{event.user_id}}",
      "zone_id": "12345678"
    }
  }
}'
const url = 'https://api.ocamba.com/v2/ocamba/ebs/automations';
const options = {
  method: 'POST',
  headers: {
    Authorization: "Bearer {TOKEN}",
    'Content-Type': "application/json"
  },
  body: JSON.stringify(
    {
      "status": "active",
      "name": "Push welcome",
      "description": "Push adex welcome notification",
      "event": {
        "id": "1000",
        "integration_id": "10000"
      },
      "actions": {
        "id": "1002",
        "integration_id": "10000",
        "data": {
          "user_id": "{{event.user_id}}",
          "zone_id": "12345678"
        }
      }
    }
  )
};

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/v2/ocamba/ebs/automations");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Authorization: Bearer {TOKEN}",
  "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
  [
    "status" => "active",
    "name" => "Push welcome",
    "description" => "Push adex welcome notification",
    "event" => [
      "id" => "1000",
      "integration_id" => "10000"
    ],
    "actions" => [
      "id" => "1002",
      "integration_id" => "10000",
      "data" => [
        "user_id" => "[[event.user_id]]",
        "zone_id" => "12345678"
      ]
    ]
  ]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

Responses

201 Created

{
  "id": "11000",
  "company_id": "6197120",
  "status": "active",
  "name": "Push welcome",
  "description": "Push adex welcome notification",
  "event": {
    "id": "1000",
    "integration_id": "10000"
  },
  "actions": {
    "id": "1002",
    "integration_id": "10000",
    "data": {
      "user_id": "{{event.user_id}}",
      "zone_id": "12345678"
    }
  },
  "create_time": "2022-07-02 12:30:40",
  "update_time": "2022-07-05 13:19:10"
}
Responses