Resend reward
curl --request PUT \
--url https://api-testbed.giftbit.com/papi/v1/gifts/{uuid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"resend": true
}'import requests
url = "https://api-testbed.giftbit.com/papi/v1/gifts/{uuid}"
payload = { "resend": True }
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({resend: true})
};
fetch('https://api-testbed.giftbit.com/papi/v1/gifts/{uuid}', 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-testbed.giftbit.com/papi/v1/gifts/{uuid}",
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([
'resend' => true
]),
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-testbed.giftbit.com/papi/v1/gifts/{uuid}"
payload := strings.NewReader("{\n \"resend\": true\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-testbed.giftbit.com/papi/v1/gifts/{uuid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"resend\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-testbed.giftbit.com/papi/v1/gifts/{uuid}")
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 \"resend\": true\n}"
response = http.request(request)
puts response.read_body{
"gift": {
"uuid": "7e0ef82bc386493498f145578268f1b2",
"campaign_uuid": "f11712f1102248ea94c47bdd3ed95690",
"delivery_status": "DELIVERED",
"status": "SENT_AND_REDEEMABLE",
"redelivery_count": 1,
"recipient_email": "tim+1@giftbit.com",
"recipient_name": "tim1",
"price_in_cents": 500,
"brand_code": "itunesus",
"created_date": "2016-05-11 14:18:44",
"delivery_date": "2016-05-11 14:18:47"
},
"info": {
"code": "INFO_GIFTS_RESENT",
"name": "Gift resent",
"message": "The gift has been resent."
},
"status": 200
}Resend reward
Triggers another delivery attempt for the reward. Rewards delivered in-app via
/embedded are not eligible for resending.
PUT
/
gifts
/
{uuid}
Resend reward
curl --request PUT \
--url https://api-testbed.giftbit.com/papi/v1/gifts/{uuid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"resend": true
}'import requests
url = "https://api-testbed.giftbit.com/papi/v1/gifts/{uuid}"
payload = { "resend": True }
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({resend: true})
};
fetch('https://api-testbed.giftbit.com/papi/v1/gifts/{uuid}', 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-testbed.giftbit.com/papi/v1/gifts/{uuid}",
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([
'resend' => true
]),
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-testbed.giftbit.com/papi/v1/gifts/{uuid}"
payload := strings.NewReader("{\n \"resend\": true\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-testbed.giftbit.com/papi/v1/gifts/{uuid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"resend\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-testbed.giftbit.com/papi/v1/gifts/{uuid}")
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 \"resend\": true\n}"
response = http.request(request)
puts response.read_body{
"gift": {
"uuid": "7e0ef82bc386493498f145578268f1b2",
"campaign_uuid": "f11712f1102248ea94c47bdd3ed95690",
"delivery_status": "DELIVERED",
"status": "SENT_AND_REDEEMABLE",
"redelivery_count": 1,
"recipient_email": "tim+1@giftbit.com",
"recipient_name": "tim1",
"price_in_cents": 500,
"brand_code": "itunesus",
"created_date": "2016-05-11 14:18:44",
"delivery_date": "2016-05-11 14:18:47"
},
"info": {
"code": "INFO_GIFTS_RESENT",
"name": "Gift resent",
"message": "The gift has been resent."
},
"status": 200
}