Creating a signup
Creating a signup
The previous section of the documentation describes
how to create a waiting list. In this part of the documentation, you will create a signup for this waiting list.
For this, you need the following information:
waitingListGUID: GUID of the waiting list for which the signup will be created.
First, use the required information to create a POST
request to https://waiting_list_api.weeztix.com/waiting_list/$GUID/signup. See the following
code blocks for examples of such requests and the expected response to the requests.
- PHP
- GO
- Node
- Shell
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer $accessToken"
],
CURLOPT_POSTFIELDS => [
"shop_id" => "d0a3f370-cd43-11ed-9c9c-bbcffde24a48",
"event_id" => "68096ad5-2eb7-45fb-977d-931b3485fe30",
"first_name" => "Bobby",
"last_name" => "Tables",
"email" => "foo@bar.com",
"quantity" => "1"
],
CURLOPT_URL => "https://waiting_list_api.weeztix.com/waiting_list/$GUID/signup"
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
payloadBuf := new(bytes.Buffer)
json.NewEncoder(payloadBuf).Encode({
"shop_id": "d0a3f370-cd43-11ed-9c9c-bbcffde24a48",
"event_id": "68096ad5-2eb7-45fb-977d-931b3485fe30",
"first_name": "Bobby",
"last_name": "Tables",
"email": "foo@bar.com",
"quantity": "1"
})
req, _ := http.NewRequest("PUT", "https://waiting_list_api.weeztix.com/waiting_list/" + GUID + "/signup", 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({
"shop_id": "d0a3f370-cd43-11ed-9c9c-bbcffde24a48",
"event_id": "68096ad5-2eb7-45fb-977d-931b3485fe30",
"first_name": "Bobby",
"last_name": "Tables",
"email": "foo@bar.com",
"quantity": "1"
})
};
fetch(`https://waiting_list_api.weeztix.com/waiting_list/${GUID}/signup`, options)
.then(response => response.json())
.then(response => console.log(response))
curl -X POST \
-H "Authorization: Bearer $accessToken" \
-F "shop_id=d0a3f370-cd43-11ed-9c9c-bbcffde24a48" \
-F "event_id=68096ad5-2eb7-45fb-977d-931b3485fe30" \
-F "first_name=Bobby" \
-F "last_name=Tables" \
-F "email=foo@bar.com" \
-F "quantity=1" \
"https://waiting_list_api.weeztix.com/waiting_list/$GUID/signup"
Response
[
{
"guid": "1b3760ca-c999-4b24-8e51-ea4ab4552957",
"shop_id": "d0a3f370-cd43-11ed-9c9c-bbcffde24a48",
"event_id": "68096ad5-2eb7-45fb-977d-931b3485fe30",
"first_name": "Bobby",
"last_name": "Tables",
"email": "foo@bar.com",
"quantity": "1",
"locale": "en-gb",
"allow_marketing": false,
"reseller_ticketswap_enabled": false,
"reseller_ticketswap_status": "Disabled",
"reseller_tixel_enabled": false,
"reseller_tixel_status": "Disabled",
"source": "shop",
"created_at": "2023-10-02T13:19:32+02:00",
"updated_at": "2023-10-02T13:19:32+02:00",
"deleted_at": null
}
]
When a POST request to create a signup is submitted for a specific waiting list with the same email,
the original signup will be updated instead of creating a new one. If the original signup had been soft-deleted,
it will be updated and reinstated.