Assigning eventDates
Creating eventDates
Event dates represent distinct dates within created events and provide a more
fine-grained approach for managing timeslots and capacity. Adding multiple event dates to a single
event is possible, making this feature particularly useful for, for example, multi-day festivals. To
create an eventDate, the following information is required:
event_id: GUID of theeventthat associated with this event date.start: the start date and time of the event date, in standard date-time form with time zone.end: the end date and time of the event date, in standard date-time form with time zone.
Besides that, the capacity of an event date can also be set. However, this field is not required,
and not setting it will result in an event date with no capacity.
capacity: the capacity of the event date.
Use this information to create a POST request to
https://api.weeztix.com/eventdate. See the following code blocks for
examples of such requests.
- PHP
- GO
- Node
- Shell
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer $accessToken"
],
CURLOPT_POSTFIELDS => [
"event_id" => $eventGUID,
"start" => "2030-08-29T09 =>00 =>00+02 =>00",
"end" => "2030-08-30T13 =>00 =>00+02 =>00",
"capacity" => 2025
],
CURLOPT_URL => "https://api.weeztix.com/eventdate"
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
payloadBuf := new(bytes.Buffer)
json.NewEncoder(payloadBuf).Encode({
"event_id": eventGUID,
"start": "2030-08-29T09:00:00+02:00",
"end": "2030-08-30T13:00:00+02:00",
"capacity": 2025
})
req, _ := http.NewRequest("PUT", "https://api.weeztix.com/eventdate", bytes.NewBuffer(body))
req.Header.Add("Authorization", "Bearer " + accessToken)
resp, _ := http.DefaultClient.Do(req)
respBody, _ := io.ReadAll(resp.Body)
fmt.Println(string(respBody))
const options = {
"method": "POST",
"headers": {
"Authorization": `Bearer ${accessToken}`,
"Content-Type": "application/json"
},
"body": JSON.stringify({
"event_id": eventGUID,
"start": "2030-08-29T09:00:00+02:00",
"end": "2030-08-30T13:00:00+02:00",
"capacity": 2025
})
};
fetch("https://api.weeztix.com/eventdate", options)
.then(response => response.json())
.then(response => console.log(response))
curl -X POST \
-H "Authorization: Bearer $accessToken" \
-F "event_id=$eventGUID" \
-F "start=2030-08-29T09:00:00+02:00" \
-F "end=2030-08-30T13:00:00+02:00" \
-F "capacity=2025" \
"https://api.weeztix.com/eventdate"
Response
{
"start": "2030-08-29T09:00:00+02:00",
"end": "2030-08-30T13:00:00+02:00",
"capacity": 2025,
"event_id": "68096ad5-2eb7-45fb-977d-931b3485fe30",
"guid": "23e91fdb-9a37-41eb-8a5c-c1cb4bc66a18",
"updated_at": "2023-10-02T13:17:09+02:00",
"created_at": "2023-10-02T13:17:09+02:00",
"seated": false
}
Getting eventDates
After creating an eventDate resource, you can retrieve the information stored in this resource. To
do this, make a GET request to https://api.weeztix.com/eventdate/:GUID.
Making a GET request to https://api.weeztix.com/eventdate is also possible,
and will list all eventDates currently stored in the Weeztix.
Updating an eventDate
If you want to update the information of an eventDate, you need its unique identifier:
GUID: the GUID of theeventDate.
Use the unique identifier to make a PUT-request to
https://api.weeztix.com/event/:GUID. The payload of the request should
contain the information that needs to be updated. Any information that can be associated with an
eventDate but that is not contained in the payload is left unchanged. See the following code
blocks for examples of such requests and the expected response to the requests. In these example
requests, the name of an eventDate is updated, which allows you to easily distinguish different
eventDate resources.
- PHP
- GO
- Node
- Shell
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer $accessToken"
],
CURLOPT_POSTFIELDS => http_build_query([
"name" => "Festival",
"start" => "2030-09-29T09 =>00 =>00+02 =>00",
"end" => "2030-09-30T13 =>00 =>00+02 =>00"
]),
CURLOPT_URL => "https://api.weeztix.com/eventdate/$GUID"
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
payloadBuf := new(bytes.Buffer)
json.NewEncoder(payloadBuf).Encode({
"name": "Festival",
"start": "2030-09-29T09:00:00+02:00",
"end": "2030-09-30T13:00:00+02:00"
})
req, _ := http.NewRequest("PUT", "https://api.weeztix.com/eventdate/" + GUID, bytes.NewBuffer(body))
req.Header.Add("Authorization", "Bearer " + accessToken)
resp, _ := http.DefaultClient.Do(req)
respBody, _ := io.ReadAll(resp.Body)
fmt.Println(string(respBody))
const options = {
"method": "PUT",
"headers": {
"Authorization": `Bearer ${accessToken}`,
"Content-Type": "application/json"
},
"body": JSON.stringify({
"name": "Festival",
"start": "2030-09-29T09:00:00+02:00",
"end": "2030-09-30T13:00:00+02:00"
})
};
fetch(`https://api.weeztix.com/eventdate/${GUID}`, options)
.then(response => response.json())
.then(response => console.log(response))
curl -X PUT \
-H "Authorization: Bearer $accessToken" \
-d "name=Festival" \
-d "start=2030-09-29T09%3A00%3A00%2B02%3A00" \
-d "end=2030-09-30T13%3A00%3A00%2B02%3A00" \
"https://api.weeztix.com/eventdate/$GUID"
Response
{
"guid": "23e91fdb-9a37-41eb-8a5c-c1cb4bc66a18",
"location_id": null,
"event_id": "68096ad5-2eb7-45fb-977d-931b3485fe30",
"name": "",
"capacity": 0,
"start": "2030-08-29T09:00:00+02:00",
"end": "2030-08-30T13:00:00+02:00",
"seats_event_key": null,
"facebook_event_id": null,
"created_at": "2023-10-02T13:17:09+02:00",
"updated_at": "2023-10-02T13:17:09+02:00",
"seated": false
}