MENU navbar-image

Introduction

OpenAPI documentation for the application

This documentation aims to provide all the information you need to work with our API.

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

Your token is generated by dataverse and sent to you. Alternatively, you can use Create api token call to generate a token using your test username-password credentials and your domain.

Authentication

APIs for user authentication

Create api token

Authenticate by username and password (log-in). Using the Avail API from server applications, just use the access token you received. No need for username-password login.

Example request:
curl --request POST \
    "https://availability-prod.dataverse.gr/api/personal-access-tokens" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"sdm@dataverse.gr\",
    \"password\": \"someHAPPYp@ssw0rd\",
    \"domain\": \"dataverse.gr\"
}"
const url = new URL(
    "https://availability-prod.dataverse.gr/api/personal-access-tokens"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "sdm@dataverse.gr",
    "password": "someHAPPYp@ssw0rd",
    "domain": "dataverse.gr"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/personal-access-tokens

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

Credentials: test user email. Must be a valid email address. Example: sdm@dataverse.gr

password   string   

Credentials: test user password. Example: someHAPPYp@ssw0rd

domain   string   

The domain of the user company. Example: dataverse.gr

Refresh api token

requires authentication

Create a new api token for the logged in user.

Example request:
curl --request POST \
    "https://availability-prod.dataverse.gr/api/personal-access-tokens/current/refresh" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://availability-prod.dataverse.gr/api/personal-access-tokens/current/refresh"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/personal-access-tokens/current/refresh

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Delete api token

requires authentication

Delete token for the logged in user (log-out).

Example request:
curl --request DELETE \
    "https://availability-prod.dataverse.gr/api/personal-access-tokens/current" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://availability-prod.dataverse.gr/api/personal-access-tokens/current"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/personal-access-tokens/current

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Availability calculation sessions

APIs for managing availability calculation sessions.

You can query for availability for one or more time constrained entity groups. A time constrained entity group, is a group of time constrained entities which form a meaningful business logic entity. For example, to get the availability of a person in a location (business logic entity) you may need to include several time constrained entities:

a) Person's specific days off.

b) Location specific holidays

c) Banking holidays of the country

d) Common working hours of a country

All the above time constrained entities (prioritized) combined together form a meaningful time constrained entity group.

In case you want to query availability of multiple business logic entities combined, ie: a PERSON with some EQUIPMENT, then you need form two time constrained entities groups:

a) For the person

b) For the equipment

Create

requires authentication

Store an availability calculation session

Example request:
curl --request POST \
    "https://availability-prod.dataverse.gr/api/availability-calculation-sessions" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"persist_result\": true,
    \"date_from\": 1704528000,
    \"date_until\": 1704639600,
    \"time_constrained_entity_groups\": [
        {
            \"time_constrained_entity_ids\": [
                \"64b507f3-9fbe-34d7-aa3a-ceb2d2682c27\"
            ]
        }
    ]
}"
const url = new URL(
    "https://availability-prod.dataverse.gr/api/availability-calculation-sessions"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "persist_result": true,
    "date_from": 1704528000,
    "date_until": 1704639600,
    "time_constrained_entity_groups": [
        {
            "time_constrained_entity_ids": [
                "64b507f3-9fbe-34d7-aa3a-ceb2d2682c27"
            ]
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "a859cf61-2467-3252-9256-0bcbc0a340a7",
        "date_from": 1704528000,
        "date_from_string": "2024-01-06T08:00:00+00:00",
        "date_until": 1704985200,
        "date_until_string": "2024-01-11T15:00:00+00:00",
        "status": "SUCCESS",
        "error": null,
        "time_constrained_entity_groups": [
            {
                "time_constrained_entity_ids": [
                    "9b0516c6-10a5-4da0-b17d-8898b5adb0b4",
                    "9b05144b-93fd-4e53-8fe0-d690f35f7cef",
                    "9aff2f1a-9c34-40f7-9a35-ae22c309f925"
                ],
                "availability_calculation_days": [
                    {
                        "id": "c4907188-62e5-47d8-9211-e6262c7e9815",
                        "availabilities": []
                    },
                    {
                        "id": "ee146a4f-050b-45bb-86e1-c52dc4a3590f",
                        "availabilities": []
                    },
                    {
                        "id": "509f3ac1-8c28-47da-ae8a-11d3eaae4486",
                        "availabilities": []
                    },
                    {
                        "id": "b73ae99a-bc55-4bf9-bd9d-bd26dc501d93",
                        "availabilities": []
                    },
                    {
                        "id": "6e9910de-f27a-4aa0-85f4-d88160a6d5fd",
                        "availabilities": [
                            {
                                "start": 1704877200,
                                "start_str": "2024-01-10T09:00:00.000000Z",
                                "end": 1704905940,
                                "end_str": "2024-01-10T16:59:00.000000Z"
                            }
                        ]
                    },
                    {
                        "id": "2b74bc10-6000-4d8f-8aea-fe8434536446",
                        "availabilities": [
                            {
                                "start": 1704956400,
                                "start_str": "2024-01-11T07:00:00.000000Z",
                                "end": 1704985140,
                                "end_str": "2024-01-11T14:59:00.000000Z"
                            }
                        ]
                    }
                ],
                "availabilities": [
                    {
                        "start": 1704877200,
                        "start_str": "2024-01-10T09:00:00.000000Z",
                        "end": 1704905940,
                        "end_str": "2024-01-10T16:59:00.000000Z"
                    },
                    {
                        "start": 1704956400,
                        "start_str": "2024-01-11T07:00:00.000000Z",
                        "end": 1704985140,
                        "end_str": "2024-01-11T14:59:00.000000Z"
                    }
                ]
            }
        ],
        "availabilities": [
            {
                "start": 1704877200,
                "start_str": "2024-01-10T09:00:00.000000Z",
                "end": 1704905940,
                "end_str": "2024-01-10T16:59:00.000000Z"
            },
            {
                "start": 1704956400,
                "start_str": "2024-01-11T07:00:00.000000Z",
                "end": 1704985140,
                "end_str": "2024-01-11T14:59:00.000000Z"
            }
        ]
    }
}
 

Request      

POST api/availability-calculation-sessions

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

persist_result   boolean  optional  

Whether to persist the availability calculation session result. If false or not provided, the result will not be stored in the database. Example: true

date_from   integer   

The date from to calculate availability for. Unix timestamp (seconds). The value must be a multiple of client time step in seconds. Example: 1704528000

date_until   integer   

The date until to calculate availability for. Unix timestamp (seconds). Example: 1704639600

time_constrained_entity_groups   object[]   

Time constrained entity groups to include in availability queries. A calculation session may contain several time constained entity groups.

time_constrained_entity_ids   string[]   

Ids of the the time constrained entities consisting the group. Must be a valid UUID.

Get

requires authentication

Get an availability calculation session by id

Example request:
curl --request GET \
    --get "https://availability-prod.dataverse.gr/api/availability-calculation-sessions/0ce149e5-caed-4143-a3ea-4359799d53ea" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://availability-prod.dataverse.gr/api/availability-calculation-sessions/0ce149e5-caed-4143-a3ea-4359799d53ea"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "56e2aae1-5b7c-31d3-bc81-f55a5355feea",
        "date_from": 1704528000,
        "date_from_string": "2024-01-06T08:00:00+00:00",
        "date_until": 1704985200,
        "date_until_string": "2024-01-11T15:00:00+00:00",
        "status": "SUCCESS",
        "error": null,
        "time_constrained_entity_groups": [
            {
                "time_constrained_entity_ids": [
                    "9b0516c6-10a5-4da0-b17d-8898b5adb0b4",
                    "9b05144b-93fd-4e53-8fe0-d690f35f7cef",
                    "9aff2f1a-9c34-40f7-9a35-ae22c309f925"
                ],
                "availability_calculation_days": [
                    {
                        "id": "c4907188-62e5-47d8-9211-e6262c7e9815",
                        "availabilities": []
                    },
                    {
                        "id": "ee146a4f-050b-45bb-86e1-c52dc4a3590f",
                        "availabilities": []
                    },
                    {
                        "id": "509f3ac1-8c28-47da-ae8a-11d3eaae4486",
                        "availabilities": []
                    },
                    {
                        "id": "b73ae99a-bc55-4bf9-bd9d-bd26dc501d93",
                        "availabilities": []
                    },
                    {
                        "id": "6e9910de-f27a-4aa0-85f4-d88160a6d5fd",
                        "availabilities": [
                            {
                                "start": 1704877200,
                                "start_str": "2024-01-10T09:00:00.000000Z",
                                "end": 1704905940,
                                "end_str": "2024-01-10T16:59:00.000000Z"
                            }
                        ]
                    },
                    {
                        "id": "2b74bc10-6000-4d8f-8aea-fe8434536446",
                        "availabilities": [
                            {
                                "start": 1704956400,
                                "start_str": "2024-01-11T07:00:00.000000Z",
                                "end": 1704985140,
                                "end_str": "2024-01-11T14:59:00.000000Z"
                            }
                        ]
                    }
                ],
                "availabilities": [
                    {
                        "start": 1704877200,
                        "start_str": "2024-01-10T09:00:00.000000Z",
                        "end": 1704905940,
                        "end_str": "2024-01-10T16:59:00.000000Z"
                    },
                    {
                        "start": 1704956400,
                        "start_str": "2024-01-11T07:00:00.000000Z",
                        "end": 1704985140,
                        "end_str": "2024-01-11T14:59:00.000000Z"
                    }
                ]
            }
        ],
        "availabilities": [
            {
                "start": 1704877200,
                "start_str": "2024-01-10T09:00:00.000000Z",
                "end": 1704905940,
                "end_str": "2024-01-10T16:59:00.000000Z"
            },
            {
                "start": 1704956400,
                "start_str": "2024-01-11T07:00:00.000000Z",
                "end": 1704985140,
                "end_str": "2024-01-11T14:59:00.000000Z"
            }
        ]
    }
}
 

Request      

GET api/availability-calculation-sessions/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   uuid   

The id of the availability calculation session. Example: 0ce149e5-caed-4143-a3ea-4359799d53ea

Delete

requires authentication

Delete an availability calculation session by id

Example request:
curl --request DELETE \
    "https://availability-prod.dataverse.gr/api/availability-calculation-sessions/0ce149e5-caed-4143-a3ea-4359799d53ea" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://availability-prod.dataverse.gr/api/availability-calculation-sessions/0ce149e5-caed-4143-a3ea-4359799d53ea"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "607d5a37-801e-3b7b-b564-9fe0616638a0",
        "date_from": 1704528000,
        "date_from_string": "2024-01-06T08:00:00+00:00",
        "date_until": 1704985200,
        "date_until_string": "2024-01-11T15:00:00+00:00",
        "status": "SUCCESS",
        "error": null,
        "time_constrained_entity_groups": [
            {
                "time_constrained_entity_ids": [
                    "9b0516c6-10a5-4da0-b17d-8898b5adb0b4",
                    "9b05144b-93fd-4e53-8fe0-d690f35f7cef",
                    "9aff2f1a-9c34-40f7-9a35-ae22c309f925"
                ],
                "availability_calculation_days": [
                    {
                        "id": "c4907188-62e5-47d8-9211-e6262c7e9815",
                        "availabilities": []
                    },
                    {
                        "id": "ee146a4f-050b-45bb-86e1-c52dc4a3590f",
                        "availabilities": []
                    },
                    {
                        "id": "509f3ac1-8c28-47da-ae8a-11d3eaae4486",
                        "availabilities": []
                    },
                    {
                        "id": "b73ae99a-bc55-4bf9-bd9d-bd26dc501d93",
                        "availabilities": []
                    },
                    {
                        "id": "6e9910de-f27a-4aa0-85f4-d88160a6d5fd",
                        "availabilities": [
                            {
                                "start": 1704877200,
                                "start_str": "2024-01-10T09:00:00.000000Z",
                                "end": 1704905940,
                                "end_str": "2024-01-10T16:59:00.000000Z"
                            }
                        ]
                    },
                    {
                        "id": "2b74bc10-6000-4d8f-8aea-fe8434536446",
                        "availabilities": [
                            {
                                "start": 1704956400,
                                "start_str": "2024-01-11T07:00:00.000000Z",
                                "end": 1704985140,
                                "end_str": "2024-01-11T14:59:00.000000Z"
                            }
                        ]
                    }
                ],
                "availabilities": [
                    {
                        "start": 1704877200,
                        "start_str": "2024-01-10T09:00:00.000000Z",
                        "end": 1704905940,
                        "end_str": "2024-01-10T16:59:00.000000Z"
                    },
                    {
                        "start": 1704956400,
                        "start_str": "2024-01-11T07:00:00.000000Z",
                        "end": 1704985140,
                        "end_str": "2024-01-11T14:59:00.000000Z"
                    }
                ]
            }
        ],
        "availabilities": [
            {
                "start": 1704877200,
                "start_str": "2024-01-10T09:00:00.000000Z",
                "end": 1704905940,
                "end_str": "2024-01-10T16:59:00.000000Z"
            },
            {
                "start": 1704956400,
                "start_str": "2024-01-11T07:00:00.000000Z",
                "end": 1704985140,
                "end_str": "2024-01-11T14:59:00.000000Z"
            }
        ]
    }
}
 

Request      

DELETE api/availability-calculation-sessions/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   uuid   

The id of the availability calculation session. Example: 0ce149e5-caed-4143-a3ea-4359799d53ea

Reservations

APIs for managing reservations

Index

requires authentication

Get-search reservations.

Example request:
curl --request GET \
    --get "https://availability-prod.dataverse.gr/api/reservations?time_constrained_entity_id=1be149e5-caed-4143-a3ea-4359799d53ea&query=Mrs+Adams&starts_after=1706180400&ends_before=1706180400&page_number=1&page_size=10" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://availability-prod.dataverse.gr/api/reservations"
);

const params = {
    "time_constrained_entity_id": "1be149e5-caed-4143-a3ea-4359799d53ea",
    "query": "Mrs Adams",
    "starts_after": "1706180400",
    "ends_before": "1706180400",
    "page_number": "1",
    "page_size": "10",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "0cdd4730-0ca4-3726-b695-5ed5013b0f46",
            "friendly_name": "Appointment with Mrs Adams",
            "definition": {
                "business_logic_key": "business_logic_value"
            },
            "multiple_reservation_definition_id": null,
            "time_constrained_entity_ids": [
                "00432624-b8b4-30be-9a05-caa2d51469d2",
                "481b10cc-6233-32d8-a072-9eeb264a164b"
            ],
            "date_from": 1671926400,
            "date_until": 1990742400,
            "date_from_string": "2022-12-25T00:00:00+00:00",
            "date_until_string": "2033-01-31T00:00:00+00:00",
            "created_at": null,
            "updated_at": null,
            "slots_duration": 15
        },
        {
            "id": "27b14751-a3cd-3318-a4e6-acef8affa661",
            "friendly_name": "Appointment with Mrs Adams",
            "definition": {
                "business_logic_key": "business_logic_value"
            },
            "multiple_reservation_definition_id": null,
            "time_constrained_entity_ids": [
                "5191cde6-173d-3659-aa03-6f07ea2c857f",
                "ce626a78-651f-30f9-bdb7-c763d4c0e94f"
            ],
            "date_from": 1671926400,
            "date_until": 1990742400,
            "date_from_string": "2022-12-25T00:00:00+00:00",
            "date_until_string": "2033-01-31T00:00:00+00:00",
            "created_at": null,
            "updated_at": null,
            "slots_duration": 15
        }
    ],
    "meta": {
        "total": 43,
        "page_number": 2,
        "page_size": 10
    }
}
 

Request      

GET api/reservations

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

time_constrained_entity_id   string  optional  

Id of the time constrained entity to get reservations for. Must be a valid UUID. Example: 1be149e5-caed-4143-a3ea-4359799d53ea

query   string  optional  

Any text-query to match definition. Must not be greater than 250 characters. Example: Mrs Adams

starts_after   integer  optional  

Unix timestamp (in seconds) UTC to filter reservations starting after the specified date. Example: 1706180400

ends_before   integer  optional  

Unix timestamp (in seconds) UTC to filter reservations ending before the specified date. Example: 1706180400

page_number   integer  optional  

Page number for pagination. First page is 1. Default: 1. Must be at least 1. Example: 1

page_size   integer  optional  

Page size for pagination. Default: 10. Must be at least 1. Must not be greater than 50. Example: 10

Get

requires authentication

Get reservation by id

Example request:
curl --request GET \
    --get "https://availability-prod.dataverse.gr/api/reservations/0ce149e5-caed-4143-a3ea-4359799d53ea" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://availability-prod.dataverse.gr/api/reservations/0ce149e5-caed-4143-a3ea-4359799d53ea"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "4b0c7887-75d7-3b3c-8e91-d876a1a950e2",
        "friendly_name": "Appointment with Mrs Adams",
        "definition": {
            "business_logic_key": "business_logic_value"
        },
        "multiple_reservation_definition_id": null,
        "time_constrained_entity_ids": [
            "f8f26826-3db3-37a7-ae2d-003c0064a78d",
            "872bbffd-72e4-3ccf-929a-51b1e5cf2581"
        ],
        "date_from": 1671926400,
        "date_until": 1990742400,
        "date_from_string": "2022-12-25T00:00:00+00:00",
        "date_until_string": "2033-01-31T00:00:00+00:00",
        "created_at": null,
        "updated_at": null,
        "slots_duration": 15
    }
}
 

Request      

GET api/reservations/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   uuid   

The id of the reservation. Example: 0ce149e5-caed-4143-a3ea-4359799d53ea

Create

requires authentication

Store a reservation (recurrent or not recurrent)

Example request:
curl --request POST \
    "https://availability-prod.dataverse.gr/api/reservations" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"friendly_name\": \"Monday appointmentment with Mr. Evans\",
    \"availability_time_constrained_entity_groups\": [
        {
            \"time_constrained_entity_ids\": [
                \"7ffc9296-b393-3f30-9b1f-bf73ac24f443\"
            ]
        }
    ],
    \"reservation_time_constrained_entity_ids\": [
        \"f3443b07-8e87-3534-818a-0d2894fe4e21\"
    ],
    \"minute_of_day_from\": 420,
    \"minute_of_day_until\": 479,
    \"date_from\": 1704758400,
    \"date_until\": 1704758400,
    \"recurrence_type\": 2,
    \"recurrence_interval\": 2,
    \"recurrence_days_of_month\": [
        20
    ],
    \"recurrence_ordinal\": [
        \"third\"
    ],
    \"recurrence_week_days\": [
        \"tuesday\"
    ]
}"
const url = new URL(
    "https://availability-prod.dataverse.gr/api/reservations"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "friendly_name": "Monday appointmentment with Mr. Evans",
    "availability_time_constrained_entity_groups": [
        {
            "time_constrained_entity_ids": [
                "7ffc9296-b393-3f30-9b1f-bf73ac24f443"
            ]
        }
    ],
    "reservation_time_constrained_entity_ids": [
        "f3443b07-8e87-3534-818a-0d2894fe4e21"
    ],
    "minute_of_day_from": 420,
    "minute_of_day_until": 479,
    "date_from": 1704758400,
    "date_until": 1704758400,
    "recurrence_type": 2,
    "recurrence_interval": 2,
    "recurrence_days_of_month": [
        20
    ],
    "recurrence_ordinal": [
        "third"
    ],
    "recurrence_week_days": [
        "tuesday"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "401b6c55-106e-390c-8823-9d570090a550",
        "friendly_name": "Appointment with Mrs Adams",
        "definition": {
            "business_logic_key": "business_logic_value"
        },
        "multiple_reservation_definition_id": null,
        "time_constrained_entity_ids": [
            "9bdef32f-c39a-3f7c-a3b8-d008e6df4a93",
            "fe03c8ed-7983-3bd7-98ff-5ab10237d364"
        ],
        "date_from": 1671926400,
        "date_until": 1990742400,
        "date_from_string": "2022-12-25T00:00:00+00:00",
        "date_until_string": "2033-01-31T00:00:00+00:00",
        "created_at": null,
        "updated_at": null,
        "slots_duration": 15
    }
}
 

Request      

POST api/reservations

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

friendly_name   string   

A friendly name for the reservation. Must not be greater than 250 characters. Example: Monday appointmentment with Mr. Evans

definition   object  optional  

Any JSON for reservation business logic data.

availability_time_constrained_entity_groups   object[]   

Time constrained entity groups to include in availability queries. A calculation session may contain several time constained entity groups.

time_constrained_entity_ids   string[]   

Ids of the the time constrained entities consisting the group. Must be a valid UUID.

reservation_time_constrained_entity_ids   string[]   

Ids of the time constrain entities this reservation refers to. Must be a valid UUID.

minute_of_day_from   integer   

The minute of day the reservation starts. First minute of day is 0. For example 420 means the time constraint starts at 07:00 (the first second of 420th minute). The value must be a multiple of client time step in minutes. Must be at least 0. Must not be greater than 1439. Example: 420

minute_of_day_until   integer   

The minute of day the specific reservation ends. Last minute of day is 1439. For example 479 means the time constraint ends at 08:00 (the last second of 479th minute). The value plus 1, must be a multiple of client time step in minutes. Must be at least 0. Must not be greater than 1439. Example: 479

date_from   integer   

Unix timestamp (in seconds) UTC of the begining of the day the time constraint starts. For example start of day Tuesday, 09th of January 2024 is 1704758400. Example: 1704758400

date_until   integer  optional  

Unix timestamp (in seconds) UTC of the begining of the day the time constraint ends. For example start of day Tuesday, 09th of January 2024 is 1704758400. Ignored when recurrence type is 0 (no recurrence). Required in any other case. This field is required unless recurrence_type is in 0. Example: 1704758400

recurrence_type   integer   

No recurrence: 0, Daily: 1, Weekly: 2, Monthly: 3. Must be at least 0. Must not be greater than 3. Example: 2

recurrence_interval   integer  optional  

Interval of the recurrence. Ignored when recurrence_type is 0 (No recurrence). For example Daily recurrence with interval 2, means every other day. For example Weekly recurrence with interval 1, means every week. For example Monthly recurrence with interval 12, means every year. Meaningless to have interval 0 for recurrence Daily, Weekly or Monthly. This field is required unless recurrence_type is in 0. Must be at least 0. Example: 2

recurrence_days_of_month   integer[]  optional  

First day of month is 1. These values are meaningful only for Monthly recurrence type, ignored when recurrence_type is 0 (No recurrence), 1 (Daily) or 2 (Weekly). Must be at least 1. Must not be greater than 31.

recurrence_ordinal   string[]  optional  

Week days ordinal: first, second, third, fourth, last. These values are meaningful only for Monthly recurrence type, ignored when recurrence_type is 0 (No recurrence), 1 (Daily) or 2 (Weekly).

Must be one of:
  • first
  • second
  • third
  • fourth
  • last
recurrence_week_days   string[]  optional  

Week days: monday, tuesday, etc. These values are meaningful only for: a) Monthly recurrence type with some Ordinal or b) Weekly recurrence type. Ignored when recurrence_type is 0 (No recurrence), 1 (Daily).

Must be one of:
  • monday
  • tuesday
  • wednesday
  • thursday
  • friday
  • saturday
  • sunday

Delete

requires authentication

Delete reservation by id

Example request:
curl --request DELETE \
    "https://availability-prod.dataverse.gr/api/reservations/0ce149e5-caed-4143-a3ea-4359799d53ea" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://availability-prod.dataverse.gr/api/reservations/0ce149e5-caed-4143-a3ea-4359799d53ea"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "69a3d122-08fb-3172-8190-994e650eb251",
        "friendly_name": "Appointment with Mrs Adams",
        "definition": {
            "business_logic_key": "business_logic_value"
        },
        "multiple_reservation_definition_id": null,
        "time_constrained_entity_ids": [
            "870a71e2-3a4b-3ecc-a65a-2c02b1a77e76",
            "aa7eaa51-3b03-3b0d-91ba-44d47df87c3b"
        ],
        "date_from": 1671926400,
        "date_until": 1990742400,
        "date_from_string": "2022-12-25T00:00:00+00:00",
        "date_until_string": "2033-01-31T00:00:00+00:00",
        "created_at": null,
        "updated_at": null,
        "slots_duration": 15
    }
}
 

Request      

DELETE api/reservations/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   uuid   

The id of the reservation. Example: 0ce149e5-caed-4143-a3ea-4359799d53ea

Batch endpoints

Batch Create

requires authentication

Batch store reservations. Returns the successfully created reservations (may be empty if silence_no_availability_exceptions is true).

Example request:
curl --request POST \
    "https://availability-prod.dataverse.gr/api/reservations/batch" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"silence_no_availability_exceptions\": false,
    \"reservations\": [
        {
            \"friendly_name\": \"Monday appointment with Mr. Evans\",
            \"availability_time_constrained_entity_groups\": [
                {
                    \"time_constrained_entity_ids\": [
                        \"33d86057-9cf2-3e5c-9163-862d17f73043\"
                    ]
                }
            ],
            \"reservation_time_constrained_entity_ids\": [
                \"5cf0993d-ca7c-3691-a9aa-c30c12a95aa7\"
            ],
            \"minute_of_day_from\": 420,
            \"minute_of_day_until\": 479,
            \"date_from\": 1704758400,
            \"date_until\": 1704758400,
            \"recurrence_type\": 2,
            \"recurrence_interval\": 2,
            \"recurrence_days_of_month\": [
                25
            ],
            \"recurrence_ordinal\": [
                \"fourth\"
            ],
            \"recurrence_week_days\": [
                \"monday\"
            ]
        }
    ]
}"
const url = new URL(
    "https://availability-prod.dataverse.gr/api/reservations/batch"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "silence_no_availability_exceptions": false,
    "reservations": [
        {
            "friendly_name": "Monday appointment with Mr. Evans",
            "availability_time_constrained_entity_groups": [
                {
                    "time_constrained_entity_ids": [
                        "33d86057-9cf2-3e5c-9163-862d17f73043"
                    ]
                }
            ],
            "reservation_time_constrained_entity_ids": [
                "5cf0993d-ca7c-3691-a9aa-c30c12a95aa7"
            ],
            "minute_of_day_from": 420,
            "minute_of_day_until": 479,
            "date_from": 1704758400,
            "date_until": 1704758400,
            "recurrence_type": 2,
            "recurrence_interval": 2,
            "recurrence_days_of_month": [
                25
            ],
            "recurrence_ordinal": [
                "fourth"
            ],
            "recurrence_week_days": [
                "monday"
            ]
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "0adcf4d1-5e2a-3c1b-852e-dd611f453099",
            "friendly_name": "Appointment with Mrs Adams",
            "definition": {
                "business_logic_key": "business_logic_value"
            },
            "multiple_reservation_definition_id": null,
            "time_constrained_entity_ids": [
                "d1eb1890-5cd1-39ba-a780-6f70f0e9063c",
                "28293398-5aec-3110-8e94-9bee393101d8"
            ],
            "date_from": 1671926400,
            "date_until": 1990742400,
            "date_from_string": "2022-12-25T00:00:00+00:00",
            "date_until_string": "2033-01-31T00:00:00+00:00",
            "created_at": null,
            "updated_at": null,
            "slots_duration": 15
        },
        {
            "id": "5016d31c-87e9-3093-b959-e3513369e22a",
            "friendly_name": "Appointment with Mrs Adams",
            "definition": {
                "business_logic_key": "business_logic_value"
            },
            "multiple_reservation_definition_id": null,
            "time_constrained_entity_ids": [
                "ecc69ea0-db55-3d42-9e7d-935455fb2b66",
                "b36a898e-d05e-380a-94a8-b1ab33192d81"
            ],
            "date_from": 1671926400,
            "date_until": 1990742400,
            "date_from_string": "2022-12-25T00:00:00+00:00",
            "date_until_string": "2033-01-31T00:00:00+00:00",
            "created_at": null,
            "updated_at": null,
            "slots_duration": 15
        }
    ]
}
 

Request      

POST api/reservations/batch

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

silence_no_availability_exceptions   boolean  optional  

Defines if no availability exceptions that may happen in one of the reservation creations should be ignored and just skip the creation of this particular reservation. Defaults to false. Example: false

reservations   object[]   

JSON array time constraints.

friendly_name   string   

A friendly name for the reservation. Must not be greater than 250 characters. Example: Monday appointment with Mr. Evans

definition   object  optional  

Any JSON for reservation business logic data.

availability_time_constrained_entity_groups   object[]   

Time constrained entity groups to include in availability queries. A calculation session may contain several time constained entity groups.

time_constrained_entity_ids   string[]   

Ids of the the time constrained entities consisting the group. Must be a valid UUID.

reservation_time_constrained_entity_ids   string[]   

Ids of the time constrain entities this reservation refers to. Must be a valid UUID.

minute_of_day_from   integer   

The minute of day the reservation starts. First minute of day is 0. For example 420 means the time constraint starts at 07:00 (the first second of 420th minute). The value must be a multiple of client time step in minutes. Must be at least 0. Must not be greater than 1439. Example: 420

minute_of_day_until   integer   

The minute of day the specific reservation ends. Last minute of day is 1439. For example 479 means the time constraint ends at 08:00 (the last second of 479th minute). The value plus 1, must be a multiple of client time step in minutes. Must be at least 0. Must not be greater than 1439. Example: 479

date_from   integer   

Unix timestamp (in seconds) UTC of the beginning of the day the time constraint starts. For example start of day Tuesday, 09th of January 2024 is 1704758400. Example: 1704758400

date_until   integer  optional  

Unix timestamp (in seconds) UTC of the beginning of the day the time constraint ends. For example start of day Tuesday, 09th of January 2024 is 1704758400. Ignored when recurrence type is 0 (no recurrence). Required in any other case. This field is required unless reservations.*.recurrence_type is in 0. Example: 1704758400

recurrence_type   integer   

No recurrence: 0, Daily: 1, Weekly: 2, Monthly: 3. Must be at least 0. Must not be greater than 3. Example: 2

recurrence_interval   integer  optional  

Interval of the recurrence. Ignored when recurrence_type is 0 (No recurrence). For example Daily recurrence with interval 2, means every other day. For example Weekly recurrence with interval 1, means every week. For example Monthly recurrence with interval 12, means every year. Meaningless to have interval 0 for recurrence Daily, Weekly or Monthly. This field is required unless reservations.*.recurrence_type is in 0. Must be at least 0. Example: 2

recurrence_days_of_month   integer[]  optional  

First day of month is 1. These values are meaningful only for Monthly recurrence type, ignored when recurrence_type is 0 (No recurrence), 1 (Daily) or 2 (Weekly). Must be at least 1. Must not be greater than 31.

recurrence_ordinal   string[]  optional  

Week days ordinal: first, second, third, fourth, last. These values are meaningful only for Monthly recurrence type, ignored when recurrence_type is 0 (No recurrence), 1 (Daily) or 2 (Weekly).

Must be one of:
  • first
  • second
  • third
  • fourth
  • last
recurrence_week_days   string[]  optional  

Week days: monday, tuesday, etc. These values are meaningful only for: a) Monthly recurrence type with some Ordinal or b) Weekly recurrence type. Ignored when recurrence_type is 0 (No recurrence), 1 (Daily).

Must be one of:
  • monday
  • tuesday
  • wednesday
  • thursday
  • friday
  • saturday
  • sunday

Batch Delete

requires authentication

Batch Delete reservations by id's

Example request:
curl --request DELETE \
    "https://availability-prod.dataverse.gr/api/reservations/batch?ids=9cf1e85e-80d3-469e-a7e3-caee10ad29fc%2C9cdbaa83-4cb5-4e9f-ae1c-9dff8fe16f57" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://availability-prod.dataverse.gr/api/reservations/batch"
);

const params = {
    "ids": "9cf1e85e-80d3-469e-a7e3-caee10ad29fc,9cdbaa83-4cb5-4e9f-ae1c-9dff8fe16f57",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (200):


{
    "number_of_reservations_deleted": 2
}
 

Request      

DELETE api/reservations/batch

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

ids   string   

ID's of the reservations to be deleted, should belong to the user's client invoking the request. Comma separated. Example: 9cf1e85e-80d3-469e-a7e3-caee10ad29fc,9cdbaa83-4cb5-4e9f-ae1c-9dff8fe16f57

Response

Response Fields

number_of_reservations_deleted   integer   

The number of the deleted reservations.

Time constrained entities

APIs for managing time constrained entities

Index

requires authentication

Get-search time constrained entities. Pagination - searching to be supported.

Example request:
curl --request GET \
    --get "https://availability-prod.dataverse.gr/api/time-constrained-entities?query=Mrs+Adams&page_number=1&page_size=10" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://availability-prod.dataverse.gr/api/time-constrained-entities"
);

const params = {
    "query": "Mrs Adams",
    "page_number": "1",
    "page_size": "10",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "ac748001-fb28-3ac5-a10d-1b0f6476f6ce",
            "name": "Country banking holidays",
            "time_constraints": [
                {
                    "id": "8d008bd4-3046-38d3-b577-f10bcc26654b",
                    "name": "Christmas",
                    "date_from": 1671926400,
                    "date_until": 1990742400,
                    "is_working": false,
                    "minute_of_day_from": 0,
                    "minute_of_day_until": 1439,
                    "order": 1,
                    "recurrence_type": 3,
                    "recurrence_interval": 12,
                    "recurrence_days_of_month": [
                        25,
                        26
                    ],
                    "recurrence_ordinal": [],
                    "recurrence_week_days": []
                },
                {
                    "id": "c0b6c8c3-2d2f-3d79-b5b8-f22a41e92daa",
                    "name": "New Years day",
                    "date_from": 1671926400,
                    "date_until": 1990742400,
                    "is_working": false,
                    "minute_of_day_from": 0,
                    "minute_of_day_until": 1439,
                    "order": 1,
                    "recurrence_type": 3,
                    "recurrence_interval": 12,
                    "recurrence_days_of_month": [
                        1
                    ],
                    "recurrence_ordinal": [],
                    "recurrence_week_days": []
                }
            ],
            "created_at": 1763010484,
            "updated_at": 1763096884
        },
        {
            "id": "2b68798c-1da7-3c24-8d3c-b4292c599a09",
            "name": "Country banking holidays",
            "time_constraints": [
                {
                    "id": "06fb5fb3-b5e2-3310-b5dc-bc1e9d31390a",
                    "name": "Christmas",
                    "date_from": 1671926400,
                    "date_until": 1990742400,
                    "is_working": false,
                    "minute_of_day_from": 0,
                    "minute_of_day_until": 1439,
                    "order": 1,
                    "recurrence_type": 3,
                    "recurrence_interval": 12,
                    "recurrence_days_of_month": [
                        25,
                        26
                    ],
                    "recurrence_ordinal": [],
                    "recurrence_week_days": []
                },
                {
                    "id": "2ff75c81-93a2-38db-a1a2-5d3fac8d1585",
                    "name": "New Years day",
                    "date_from": 1671926400,
                    "date_until": 1990742400,
                    "is_working": false,
                    "minute_of_day_from": 0,
                    "minute_of_day_until": 1439,
                    "order": 1,
                    "recurrence_type": 3,
                    "recurrence_interval": 12,
                    "recurrence_days_of_month": [
                        1
                    ],
                    "recurrence_ordinal": [],
                    "recurrence_week_days": []
                }
            ],
            "created_at": 1763010484,
            "updated_at": 1763096884
        }
    ],
    "meta": {
        "total": 43,
        "page_number": 2,
        "page_size": 10
    }
}
 

Request      

GET api/time-constrained-entities

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

query   string  optional  

Any text-query to match in name field. Must not be greater than 250 characters. Example: Mrs Adams

page_number   integer  optional  

Page number for pagination. First page is 1. Default: 1. Must be at least 1. Example: 1

page_size   integer  optional  

Page size for pagination. Default: 10. Must be at least 1. Must not be greater than 50. Example: 10

Get

requires authentication

Get a time constrained entity by id

Example request:
curl --request GET \
    --get "https://availability-prod.dataverse.gr/api/time-constrained-entities/0ce149e5-caed-4143-a3ea-4359799d53ea" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://availability-prod.dataverse.gr/api/time-constrained-entities/0ce149e5-caed-4143-a3ea-4359799d53ea"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "d16f5e54-73d3-3485-a903-49922dbb465d",
        "name": "Country banking holidays",
        "time_constraints": [
            {
                "id": "a5bf4c37-9cd4-383b-9e17-6027fd4d5101",
                "name": "Christmas",
                "date_from": 1671926400,
                "date_until": 1990742400,
                "is_working": false,
                "minute_of_day_from": 0,
                "minute_of_day_until": 1439,
                "order": 1,
                "recurrence_type": 3,
                "recurrence_interval": 12,
                "recurrence_days_of_month": [
                    25,
                    26
                ],
                "recurrence_ordinal": [],
                "recurrence_week_days": []
            },
            {
                "id": "b3daf7db-ba77-36cf-b2a4-3e21bc9a669d",
                "name": "New Years day",
                "date_from": 1671926400,
                "date_until": 1990742400,
                "is_working": false,
                "minute_of_day_from": 0,
                "minute_of_day_until": 1439,
                "order": 1,
                "recurrence_type": 3,
                "recurrence_interval": 12,
                "recurrence_days_of_month": [
                    1
                ],
                "recurrence_ordinal": [],
                "recurrence_week_days": []
            }
        ],
        "created_at": 1763010484,
        "updated_at": 1763096884
    }
}
 

Request      

GET api/time-constrained-entities/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   uuid   

The id of the time constrained entity. Example: 0ce149e5-caed-4143-a3ea-4359799d53ea

Create

requires authentication

Store time constrained entity

Example request:
curl --request POST \
    "https://availability-prod.dataverse.gr/api/time-constrained-entities" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Country banking holidays\",
    \"time_constraints\": [
        {
            \"id\": \"1be149e5-caed-4143-a3ea-4359799d53ea\",
            \"order\": 1,
            \"name\": \"Days off between Christmas and New Years day or Afternoon shift\",
            \"is_working\": true,
            \"minute_of_day_from\": 420,
            \"minute_of_day_until\": 479,
            \"date_from\": 1704758400,
            \"date_until\": 1704758400,
            \"recurrence_type\": 2,
            \"recurrence_interval\": 2,
            \"recurrence_days_of_month\": [
                19
            ],
            \"recurrence_ordinal\": [
                \"last\"
            ],
            \"recurrence_week_days\": [
                \"tuesday\"
            ]
        }
    ]
}"
const url = new URL(
    "https://availability-prod.dataverse.gr/api/time-constrained-entities"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Country banking holidays",
    "time_constraints": [
        {
            "id": "1be149e5-caed-4143-a3ea-4359799d53ea",
            "order": 1,
            "name": "Days off between Christmas and New Years day or Afternoon shift",
            "is_working": true,
            "minute_of_day_from": 420,
            "minute_of_day_until": 479,
            "date_from": 1704758400,
            "date_until": 1704758400,
            "recurrence_type": 2,
            "recurrence_interval": 2,
            "recurrence_days_of_month": [
                19
            ],
            "recurrence_ordinal": [
                "last"
            ],
            "recurrence_week_days": [
                "tuesday"
            ]
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "7715a7bb-ba23-3b05-9152-e5120d2d70c7",
        "name": "Country banking holidays",
        "time_constraints": [
            {
                "id": "dae674de-9f75-3b2b-b3c5-578b09f471cc",
                "name": "Christmas",
                "date_from": 1671926400,
                "date_until": 1990742400,
                "is_working": false,
                "minute_of_day_from": 0,
                "minute_of_day_until": 1439,
                "order": 1,
                "recurrence_type": 3,
                "recurrence_interval": 12,
                "recurrence_days_of_month": [
                    25,
                    26
                ],
                "recurrence_ordinal": [],
                "recurrence_week_days": []
            },
            {
                "id": "db14e343-b9c1-3f2e-8c7d-77db2ebf6e6c",
                "name": "New Years day",
                "date_from": 1671926400,
                "date_until": 1990742400,
                "is_working": false,
                "minute_of_day_from": 0,
                "minute_of_day_until": 1439,
                "order": 1,
                "recurrence_type": 3,
                "recurrence_interval": 12,
                "recurrence_days_of_month": [
                    1
                ],
                "recurrence_ordinal": [],
                "recurrence_week_days": []
            }
        ],
        "created_at": 1763010484,
        "updated_at": 1763096884
    }
}
 

Request      

POST api/time-constrained-entities

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

A friendly name for the entity. Must not be greater than 250 characters. Example: Country banking holidays

time_constraints   object[]   

JSON array time constraints.

id   string   

A valid UUID for the specific time constraint. Must be a valid UUID. Example: 1be149e5-caed-4143-a3ea-4359799d53ea

order   integer   

The order priority the specific time constraint is considered in availability calculation. The lower the number the higher the priority. Must be at least 1. Example: 1

name   string   

The name of the time constraint. Example: Days off between Christmas and New Years day or Afternoon shift

is_working   boolean   

A flag indicating if the specific time constraint is considered as working or non-working. Example: true

minute_of_day_from   integer   

The minute of day the specific time constraint starts. First minute of day is 0. For example 420 means the time constraint starts at 07:00 (the first second of 420th minute). The value must be a multiple of client time step in minutes. Must be at least 0. Must not be greater than 1439. Example: 420

minute_of_day_until   integer   

The minute of day the specific time constraint ends. Last minute of day is 1439. For example 479 means the time constraint ends at 08:00 (the last second of 479th minute). The value plus 1, must be a multiple of client time step in minutes. Must be at least 0. Must not be greater than 1439. Example: 479

date_from   integer   

Unix timestamp (in seconds) UTC of the begining of the day the time constraint starts. For example start of day Tuesday, 09th of January 2024 is 1704758400. Example: 1704758400

date_until   integer  optional  

Unix timestamp (in seconds) UTC of the begining of the day the time constraint ends. For example start of day Tuesday, 09th of January 2024 is 1704758400. Ignored when recurrence type is 0 (no recurrence). Required in any other case. This field is required unless time_constraints.*.recurrence_type is in 0. Example: 1704758400

recurrence_type   integer   

No recurrence: 0, Daily: 1, Weekly: 2, Monthly: 3. Must be at least 0. Must not be greater than 3. Example: 2

recurrence_interval   integer  optional  

Interval of the recurrence. Ignored when recurrence_type is 0 (No recurrence). For example Daily recurrence with interval 2, means every other day. For example Weekly recurrence with interval 1, means every week. For example Monthly recurrence with interval 12, means every year. Meaningless to have interval 0 for recurrence Daily, Weekly or Monthly. This field is required unless time_constraints.*.recurrence_type is in 0. Must be at least 0. Example: 2

recurrence_days_of_month   integer[]  optional  

First day of month is 1. These values are meaningful only for Monthly recurrence type, ignored when recurrence_type is 0 (No recurrence), 1 (Daily) or 2 (Weekly). Must be at least 1. Must not be greater than 31.

recurrence_ordinal   string[]  optional  

Week days ordinal: first, second, third, fourth, last. These values are meaningful only for Monthly recurrence type, ignored when recurrence_type is 0 (No recurrence), 1 (Daily) or 2 (Weekly).

Must be one of:
  • first
  • second
  • third
  • fourth
  • last
recurrence_week_days   string[]  optional  

Week days: monday, tuesday, etc. These values are meaningful only for: a) Monthly recurrence type with some Ordinal or b) Weekly recurrence type. Ignored when recurrence_type is 0 (No recurrence), 1 (Daily).

Must be one of:
  • monday
  • tuesday
  • wednesday
  • thursday
  • friday
  • saturday
  • sunday

Update

requires authentication

Update a time constrained entity by id

Example request:
curl --request PUT \
    "https://availability-prod.dataverse.gr/api/time-constrained-entities/0ce149e5-caed-4143-a3ea-4359799d53ea" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Country banking holidays\",
    \"time_constraints\": [
        {
            \"id\": \"1be149e5-caed-4143-a3ea-4359799d53ea\",
            \"order\": 1,
            \"name\": \"Days off between Christmas and New Years day or Afternoon shift\",
            \"is_working\": true,
            \"minute_of_day_from\": 420,
            \"minute_of_day_until\": 479,
            \"date_from\": 1704758400,
            \"date_until\": 1704758400,
            \"recurrence_type\": 2,
            \"recurrence_interval\": 2,
            \"recurrence_days_of_month\": [
                12
            ],
            \"recurrence_ordinal\": [
                \"fourth\"
            ],
            \"recurrence_week_days\": [
                \"thursday\"
            ]
        }
    ]
}"
const url = new URL(
    "https://availability-prod.dataverse.gr/api/time-constrained-entities/0ce149e5-caed-4143-a3ea-4359799d53ea"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Country banking holidays",
    "time_constraints": [
        {
            "id": "1be149e5-caed-4143-a3ea-4359799d53ea",
            "order": 1,
            "name": "Days off between Christmas and New Years day or Afternoon shift",
            "is_working": true,
            "minute_of_day_from": 420,
            "minute_of_day_until": 479,
            "date_from": 1704758400,
            "date_until": 1704758400,
            "recurrence_type": 2,
            "recurrence_interval": 2,
            "recurrence_days_of_month": [
                12
            ],
            "recurrence_ordinal": [
                "fourth"
            ],
            "recurrence_week_days": [
                "thursday"
            ]
        }
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "27106427-cbd1-3f3d-8189-c397bd64a486",
        "name": "Country banking holidays",
        "time_constraints": [
            {
                "id": "2eb19669-9297-3bc0-a893-b8a92258449b",
                "name": "Christmas",
                "date_from": 1671926400,
                "date_until": 1990742400,
                "is_working": false,
                "minute_of_day_from": 0,
                "minute_of_day_until": 1439,
                "order": 1,
                "recurrence_type": 3,
                "recurrence_interval": 12,
                "recurrence_days_of_month": [
                    25,
                    26
                ],
                "recurrence_ordinal": [],
                "recurrence_week_days": []
            },
            {
                "id": "f3359500-6b56-34fe-aae3-db43d38798df",
                "name": "New Years day",
                "date_from": 1671926400,
                "date_until": 1990742400,
                "is_working": false,
                "minute_of_day_from": 0,
                "minute_of_day_until": 1439,
                "order": 1,
                "recurrence_type": 3,
                "recurrence_interval": 12,
                "recurrence_days_of_month": [
                    1
                ],
                "recurrence_ordinal": [],
                "recurrence_week_days": []
            }
        ],
        "created_at": 1763010484,
        "updated_at": 1763096884
    }
}
 

Request      

PUT api/time-constrained-entities/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   uuid   

The id of the time constrained entity. Example: 0ce149e5-caed-4143-a3ea-4359799d53ea

Body Parameters

name   string   

A friendly name for the entity. Must not be greater than 250 characters. Example: Country banking holidays

time_constraints   object[]   

JSON array time constraints.

id   string   

A valid UUID for the specific time constraint. Must be a valid UUID. Example: 1be149e5-caed-4143-a3ea-4359799d53ea

order   integer   

The order priority the specific time constraint is considered in availability calculation. The lower the number the higher the priority. Must be at least 1. Example: 1

name   string   

The name of the time constraint. Example: Days off between Christmas and New Years day or Afternoon shift

is_working   boolean   

A flag indicating if the specific time constraint is considered as working or non-working. Example: true

minute_of_day_from   integer   

The minute of day the specific time constraint starts. First minute of day is 0. For example 420 means the time constraint starts at 07:00 (the first second of 420th minute). The value must be a multiple of client time step in minutes. Must be at least 0. Must not be greater than 1439. Example: 420

minute_of_day_until   integer   

The minute of day the specific time constraint ends. Last minute of day is 1439. For example 479 means the time constraint ends at 08:00 (the last second of 479th minute). The value plus 1, must be a multiple of client time step in minutes. Must be at least 0. Must not be greater than 1439. Example: 479

date_from   integer   

Unix timestamp (in seconds) UTC of the begining of the day the time constraint starts. For example start of day Tuesday, 09th of January 2024 is 1704758400. Example: 1704758400

date_until   integer  optional  

Unix timestamp (in seconds) UTC of the begining of the day the time constraint ends. For example start of day Tuesday, 09th of January 2024 is 1704758400. Ignored when recurrence type is 0 (no recurrence). Required in any other case. This field is required unless time_constraints.*.recurrence_type is in 0. Example: 1704758400

recurrence_type   integer   

No recurrence: 0, Daily: 1, Weekly: 2, Monthly: 3. Must be at least 0. Must not be greater than 3. Example: 2

recurrence_interval   integer  optional  

Interval of the recurrence. Ignored when recurrence_type is 0 (No recurrence). For example Daily recurrence with interval 2, means every other day. For example Weekly recurrence with interval 1, means every week. For example Monthly recurrence with interval 12, means every year. Meaningless to have interval 0 for recurrence Daily, Weekly or Monthly. This field is required unless time_constraints.*.recurrence_type is in 0. Must be at least 0. Example: 2

recurrence_days_of_month   integer[]  optional  

First day of month is 1. These values are meaningful only for Monthly recurrence type, ignored when recurrence_type is 0 (No recurrence), 1 (Daily) or 2 (Weekly). Must be at least 1. Must not be greater than 31.

recurrence_ordinal   string[]  optional  

Week days ordinal: first, second, third, fourth, last. These values are meaningful only for Monthly recurrence type, ignored when recurrence_type is 0 (No recurrence), 1 (Daily) or 2 (Weekly).

Must be one of:
  • first
  • second
  • third
  • fourth
  • last
recurrence_week_days   string[]  optional  

Week days: monday, tuesday, etc. These values are meaningful only for: a) Monthly recurrence type with some Ordinal or b) Weekly recurrence type. Ignored when recurrence_type is 0 (No recurrence), 1 (Daily).

Must be one of:
  • monday
  • tuesday
  • wednesday
  • thursday
  • friday
  • saturday
  • sunday

Delete

requires authentication

Delete a time constrained entity by id

Example request:
curl --request DELETE \
    "https://availability-prod.dataverse.gr/api/time-constrained-entities/0ce149e5-caed-4143-a3ea-4359799d53ea" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://availability-prod.dataverse.gr/api/time-constrained-entities/0ce149e5-caed-4143-a3ea-4359799d53ea"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "7d7f7b8d-3a47-3fba-a21f-1327ec36bee3",
        "name": "Country banking holidays",
        "time_constraints": [
            {
                "id": "7d6302c8-1daa-3ad5-8959-65235e44c61b",
                "name": "Christmas",
                "date_from": 1671926400,
                "date_until": 1990742400,
                "is_working": false,
                "minute_of_day_from": 0,
                "minute_of_day_until": 1439,
                "order": 1,
                "recurrence_type": 3,
                "recurrence_interval": 12,
                "recurrence_days_of_month": [
                    25,
                    26
                ],
                "recurrence_ordinal": [],
                "recurrence_week_days": []
            },
            {
                "id": "586f3d99-f547-3dd4-96e6-931384e5fa6e",
                "name": "New Years day",
                "date_from": 1671926400,
                "date_until": 1990742400,
                "is_working": false,
                "minute_of_day_from": 0,
                "minute_of_day_until": 1439,
                "order": 1,
                "recurrence_type": 3,
                "recurrence_interval": 12,
                "recurrence_days_of_month": [
                    1
                ],
                "recurrence_ordinal": [],
                "recurrence_week_days": []
            }
        ],
        "created_at": 1763010484,
        "updated_at": 1763096884
    }
}
 

Request      

DELETE api/time-constrained-entities/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   uuid   

The id of the time constrained entity. Example: 0ce149e5-caed-4143-a3ea-4359799d53ea

Users

APIs for users

Current

requires authentication

Get current logged in user

Example request:
curl --request GET \
    --get "https://availability-prod.dataverse.gr/api/users/current" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://availability-prod.dataverse.gr/api/users/current"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": null,
        "name": "sdm@dataverse.gr",
        "email": "sdm@dataverse.gr",
        "created_at": "2025-11-13T05:08:04.000000Z",
        "updated_at": "2025-11-14T05:08:04.000000Z",
        "client_id": "9d6e003c-cc06-4b91-b5df-5b68e21efafe",
        "client": null
    }
}
 

Request      

GET api/users/current

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json