Finish draw
curl --request PUT \
--url https://api.fourthwall.com/open-api/v1.0/gifting/draw/{id}/finish \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"participants": [
{
"service": "<string>",
"userId": "<string>",
"userName": "<string>"
}
]
}
'import requests
url = "https://api.fourthwall.com/open-api/v1.0/gifting/draw/{id}/finish"
payload = { "participants": [
{
"service": "<string>",
"userId": "<string>",
"userName": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
participants: [{service: '<string>', userId: '<string>', userName: '<string>'}]
})
};
fetch('https://api.fourthwall.com/open-api/v1.0/gifting/draw/{id}/finish', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fourthwall.com/open-api/v1.0/gifting/draw/{id}/finish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'participants' => [
[
'service' => '<string>',
'userId' => '<string>',
'userName' => '<string>'
]
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fourthwall.com/open-api/v1.0/gifting/draw/{id}/finish"
payload := strings.NewReader("{\n \"participants\": [\n {\n \"service\": \"<string>\",\n \"userId\": \"<string>\",\n \"userName\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.fourthwall.com/open-api/v1.0/gifting/draw/{id}/finish")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"participants\": [\n {\n \"service\": \"<string>\",\n \"userId\": \"<string>\",\n \"userName\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fourthwall.com/open-api/v1.0/gifting/draw/{id}/finish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"participants\": [\n {\n \"service\": \"<string>\",\n \"userId\": \"<string>\",\n \"userName\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "gdr_EdJvIXu3SEiXe_QkPavHSA",
"giveawayId": "giv_EdJvIXu3SEiXe_QkPavHSA",
"giveawayFriendlyId": "D3XZFWPP",
"shopId": "sh_c689d374-22ca-43d3-8d29-9ef0805cc4cb",
"offer": {
"id": "00aa4abd-5778-4199-8161-0b49b2f212e5",
"name": "My t-shirt",
"slug": "my-t-shirt",
"description": "My t-shirt description",
"primaryImage": {
"id": "00aa4abd-5778-4199-8161-0b49b2f212e5",
"url": "https://fourthwall.com/image.png",
"width": 800,
"height": 600,
"transformedUrl": "https://fourthwall.com/image.png"
}
},
"amounts": {
"subtotal": {
"value": 10,
"currency": "USD"
},
"total": {
"value": 10,
"currency": "USD"
}
},
"email": "supporter@fourthwall.com",
"gifts": [
{
"id": "gft_EdJvIXu3SEiXe_QkPavHSA",
"orderId": "00aa4abd-5778-4199-8161-0b49b2f212e5",
"orderFriendlyId": "D3XZFWPP",
"winner": {
"selectedAt": "2020-08-13T09:05:36.939Z",
"redeemUri": "<string>",
"email": "supporter@fourthwall.com",
"username": "Johnny123"
},
"status": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"durationSeconds": 123,
"username": "Johnny123",
"message": "Sample message"
}Gifting
Finish Draw
Rate limit: 100 requests / 10 seconds per shop. See Rate limiting.
Finish draw and select winners
PUT
/
open-api
/
v1.0
/
gifting
/
draw
/
{id}
/
finish
Finish draw
curl --request PUT \
--url https://api.fourthwall.com/open-api/v1.0/gifting/draw/{id}/finish \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"participants": [
{
"service": "<string>",
"userId": "<string>",
"userName": "<string>"
}
]
}
'import requests
url = "https://api.fourthwall.com/open-api/v1.0/gifting/draw/{id}/finish"
payload = { "participants": [
{
"service": "<string>",
"userId": "<string>",
"userName": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
participants: [{service: '<string>', userId: '<string>', userName: '<string>'}]
})
};
fetch('https://api.fourthwall.com/open-api/v1.0/gifting/draw/{id}/finish', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fourthwall.com/open-api/v1.0/gifting/draw/{id}/finish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'participants' => [
[
'service' => '<string>',
'userId' => '<string>',
'userName' => '<string>'
]
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fourthwall.com/open-api/v1.0/gifting/draw/{id}/finish"
payload := strings.NewReader("{\n \"participants\": [\n {\n \"service\": \"<string>\",\n \"userId\": \"<string>\",\n \"userName\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.fourthwall.com/open-api/v1.0/gifting/draw/{id}/finish")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"participants\": [\n {\n \"service\": \"<string>\",\n \"userId\": \"<string>\",\n \"userName\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fourthwall.com/open-api/v1.0/gifting/draw/{id}/finish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"participants\": [\n {\n \"service\": \"<string>\",\n \"userId\": \"<string>\",\n \"userName\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "gdr_EdJvIXu3SEiXe_QkPavHSA",
"giveawayId": "giv_EdJvIXu3SEiXe_QkPavHSA",
"giveawayFriendlyId": "D3XZFWPP",
"shopId": "sh_c689d374-22ca-43d3-8d29-9ef0805cc4cb",
"offer": {
"id": "00aa4abd-5778-4199-8161-0b49b2f212e5",
"name": "My t-shirt",
"slug": "my-t-shirt",
"description": "My t-shirt description",
"primaryImage": {
"id": "00aa4abd-5778-4199-8161-0b49b2f212e5",
"url": "https://fourthwall.com/image.png",
"width": 800,
"height": 600,
"transformedUrl": "https://fourthwall.com/image.png"
}
},
"amounts": {
"subtotal": {
"value": 10,
"currency": "USD"
},
"total": {
"value": 10,
"currency": "USD"
}
},
"email": "supporter@fourthwall.com",
"gifts": [
{
"id": "gft_EdJvIXu3SEiXe_QkPavHSA",
"orderId": "00aa4abd-5778-4199-8161-0b49b2f212e5",
"orderFriendlyId": "D3XZFWPP",
"winner": {
"selectedAt": "2020-08-13T09:05:36.939Z",
"redeemUri": "<string>",
"email": "supporter@fourthwall.com",
"username": "Johnny123"
},
"status": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"durationSeconds": 123,
"username": "Johnny123",
"message": "Sample message"
}OAuth scope:
giveaway_writeAPI keys have full access to this endpoint.Authorizations
oauthbasicAuth
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
Body
application/json
Show child attributes
Show child attributes
Response
OK
Example:
"gdr_EdJvIXu3SEiXe_QkPavHSA"
Available options:
INITIAL, REDO Example:
"giv_EdJvIXu3SEiXe_QkPavHSA"
Example:
"D3XZFWPP"
Example:
"sh_c689d374-22ca-43d3-8d29-9ef0805cc4cb"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Example:
"supporter@fourthwall.com"
gifts
Available · object · Available · object · Available · object · Available · object · Available · object · Cancelled · object · Changed To Gift Card · object · Changed To Promotion · object · Redeemed · object[]
required
- Available
- Available
- Available
- Available
- Available
- Cancelled
- Changed To Gift Card
- Changed To Promotion
- Redeemed
Show child attributes
Show child attributes
Example:
"Johnny123"
Example:
"Sample message"
⌘I