Slotify

Create a Workflow

Following endpoint will help you create a workflow in Slotify using create endpoint:

Authentication

This endpoint needs app token for authentication.

MethodPOST
Endpointv1/workflow
HeadersAccept: application/json 
Authorization: Bearer <base64_encoded_token> 
Token typeApp

Query Parameters

This endpoint supports query parameters:

FieldValueDescription
includeapp,actionsshow app and actions
searchnamesearch workflow by name

Request Body:

This endpoint requires following parameters to be sent via post body:

Param NameRequiredDescription
nametruename of the workflow
descriptiontruedescription of workflow

Example Request:

Following code shows how to send request to create a workflow in Slotify api.

  • PHP
  • BASH
  • JSON
$apiEndpoint = 'https://api.slotify.ca/v1/workflow';
$apiToken = base64_encode("app-token");

$data = array(
   "name" => "Webhook Workflow",
   "description" => "This should apply to all my bookings"
);

$ch = curl_init($apiEndpoint);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Authorization: Bearer ' . $apiToken,
    'Content-Type: application/json'
));
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));

$response = curl_exec($ch);

if(curl_errno($ch)){
    echo 'Error: ' . curl_error($ch);
}

curl_close($ch);

echo $response;
curl -X POST \
     -H "Authorization: Bearer <APP_TOKEN>" \
     -H "Content-Type: application/json" \
     -d '{"name": "Webhook Workflow","description": "This should apply to all my bookings"}' \
     https://api.slotify.ca/v1/workflow
{
   "name": "Webhook Workflow",
   "description": "This should apply to all my bookings"
}

Example Response:

Following response will be provided by Slotify server when this endpoint is called:

  • 201 Created
  • 400 Bad Request
{
    "success": true,
    "data": {
        "uuid": "cc0be72c-5214-48ff-a62a-336c8fb65ed5",
        "name": "Webhook Workflow",
        "created_at": "2024-09-03T16:27:43+00:00",
        "updated_at": "2024-09-03T16:27:43+00:00",
        "description": "This should apply to all my bookings"
    }
}
{
    "success": false,
    "errors": {
        "name": "This field is required",
        "timezone": "This field is required",
        "email": "This field is required",
        "role": "This field is required",
        "password": "This field is required",
        "confirm_password": "This field is required"
    }
}