Services / Event Types
An event-type
is the fundamental concept of TimeTime. An event-type
represents a service that can be booked.
For example, a hairdresser can have two types of events: "Haircut" and "Wash and blow dry". Each event-type
will have its own particular availability rules, for example the duration of "haircut" will be 20m while "wash and blow dry" could be 40m.
An event-type
can be created manually from the application or it can be created by making an HTTP request to our API passing.
A detailed description of all the fields and options can be read in our API specification.
The following code snippet shows the required fields to create an event-type
from our API:
fetch("https://api.timetime.in/v1/event-types/<event-type-uuid>", {
method: "PUT",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer: <your-api-key>",
},
body: JSON.stringify({
// Event duration is specified in ISO 8601 format
"duration": "PT1H",
// Service name
"name": "Corte de pelo",
// The slug is used to generate the URL of the booking page
"slug": "corte-de-pelo",
// The start frecuency of the service
"step": "PT1H",
// The UUID of the user that owns the service
"userId": "<user-uuid>",
// We can ignore those fields for now
"questions": [],
"thirdPartyCalendars": { "toSyncBookings": [], "toVerifyAvailability": [] },
"busyIntervals": [],
}),
});
<event-type-uuid>
: Is an UUID of your choice to identify the event type.- If it already exists, the existing service will be modified and if it does not exist, a new one will be created.
- You can use this autogenerated id to make tests:
<user-uuid>>
: Is the universally unique identifier UUID of the user who owns the service.- The userID can be consulted in the profile/developers section of the application.
<your-api-key>
: Is the API key of the developer.- The api key can be consulted in the profile/developers section of the application.
Each time a service is created, timetime generates a booking page where customers can check the availability.
The booking page url looks like this:
https://app.timetime.in/book/<event-type-uuid>
.
The availability of a service can also be consulted from the API as we will see in the next section.