Create a raffle
curl --request POST \
--url https://api.rigaly.com/api/v1/raffles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Win a year of free coffee",
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z",
"points_cost": 100,
"description": "<string>",
"terms_conditions": "<string>",
"entries_per_user": 5,
"winners_count": 1
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Win a year of free coffee',
starts_at: '2023-11-07T05:31:56Z',
ends_at: '2023-11-07T05:31:56Z',
points_cost: 100,
description: '<string>',
terms_conditions: '<string>',
entries_per_user: 5,
winners_count: 1
})
};
fetch('https://api.rigaly.com/api/v1/raffles', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.rigaly.com/api/v1/raffles"
payload = {
"name": "Win a year of free coffee",
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z",
"points_cost": 100,
"description": "<string>",
"terms_conditions": "<string>",
"entries_per_user": 5,
"winners_count": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rigaly.com/api/v1/raffles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Win a year of free coffee',
'starts_at' => '2023-11-07T05:31:56Z',
'ends_at' => '2023-11-07T05:31:56Z',
'points_cost' => 100,
'description' => '<string>',
'terms_conditions' => '<string>',
'entries_per_user' => 5,
'winners_count' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"success": true,
"message": "<string>",
"data": {}
}{
"success": false,
"error": {
"message": "Provide exactly one of \"user_id\" or \"identifier\""
}
}Raffles
Create a raffle
POST
/
api
/
v1
/
raffles
Create a raffle
curl --request POST \
--url https://api.rigaly.com/api/v1/raffles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Win a year of free coffee",
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z",
"points_cost": 100,
"description": "<string>",
"terms_conditions": "<string>",
"entries_per_user": 5,
"winners_count": 1
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Win a year of free coffee',
starts_at: '2023-11-07T05:31:56Z',
ends_at: '2023-11-07T05:31:56Z',
points_cost: 100,
description: '<string>',
terms_conditions: '<string>',
entries_per_user: 5,
winners_count: 1
})
};
fetch('https://api.rigaly.com/api/v1/raffles', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.rigaly.com/api/v1/raffles"
payload = {
"name": "Win a year of free coffee",
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z",
"points_cost": 100,
"description": "<string>",
"terms_conditions": "<string>",
"entries_per_user": 5,
"winners_count": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rigaly.com/api/v1/raffles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Win a year of free coffee',
'starts_at' => '2023-11-07T05:31:56Z',
'ends_at' => '2023-11-07T05:31:56Z',
'points_cost' => 100,
'description' => '<string>',
'terms_conditions' => '<string>',
'entries_per_user' => 5,
'winners_count' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"success": true,
"message": "<string>",
"data": {}
}{
"success": false,
"error": {
"message": "Provide exactly one of \"user_id\" or \"identifier\""
}
}Authorizations
API key from the Rigaly dashboard: Authorization: Bearer rgly_sk_...
Body
application/json
⌘I