GET /gift_requests/:id
Retrieve gift request information.
Description
This endpoint allows you to retrieve a specific gift request by its unique identifier.
HTTP Request
GET https://api.andopen.com/gift_requests/:id
Responses
The state field indicates the current status of the gift request and can have one of the following values:
| Value | Description |
|---|---|
submitted | Gift request has been submitted and is awaiting redemption |
redeemed | Gift request has been redeemed by the recipient |
dispatched | Gift has been dispatched for delivery |
delivered | Gift has been successfully delivered |
cancelled | Gift request has been cancelled |
🟢 Success Response (200 Success)
{
"data": {
"type": "gift_requests",
"id": "4fb4cb3f-9666-43b5-8884-7f5194483d1a",
"attributes": {
"redemption_url": "https://from.andopen.co/r/yJVd73kgurRzEX",
"state": "submitted",
"created_at": "2025-01-27T10:30:00Z",
"updated_at": "2025-01-27T10:30:00Z"
}
}
}
🔴 Error Response (404 NotFound)
{
"errors":
[
{
"status": "404",
"detail": "Couldn't find GiftRequest with e276c11e-f27b-4a6d-b9e4-f53cd5cd3d32"
}
],
"jsonapi": {
"version": "1.0"
}
}
Code Examples
- cURL
- Ruby
- JavaScript
- Java
- Python
- PHP
curl -X GET "https://api.andopen.com/gift_requests/e276c11e-f27b-4a6d-b9e4-f53cd5cd3d32" \
-H 'Content-Type: application/vnd.api+json' \
-H 'AndOpen-API-Version: 2025-09' \
-H "Authorization: Bearer <api_key>
require 'net/http'
require 'json'
uri = URI('https://api.andopen.com/gift_requests/e276c11e-f27b-4a6d-b9e4-f53cd5cd3d32')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Content-Type'] = 'application/vnd.api+json'
request['Authorization'] = 'Bearer <api_key>'
request['AndOpen-API-Version'] = '2025-09'
response = http.request(request)
gift_request = JSON.parse(response.body)
fetch('https://api.andopen.com/gift_requests/e276c11e-f27b-4a6d-b9e4-f53cd5cd3d32', {
method: 'GET',
headers: {
'Content-Type': 'application/vnd.api+json',
'Authorization': 'Bearer <api_key>',
'AndOpen-API-Version': '2025-09'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.BufferedReader;
import java.io.InputStreamReader;
URL url = new URL("https://api.andopen.com/gift_requests/e276c11e-f27b-4a6d-b9e4-f53cd5cd3d32");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setRequestProperty("Content-Type", "application/vnd.api+json");
conn.setRequestProperty("Authorization", "Bearer <api_key>");
conn.setRequestProperty("AndOpen-API-Version", "2025-09");
int responseCode = conn.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_OK) {
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String inputLine;
StringBuilder response = new StringBuilder();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
}
import requests
url = "https://api.andopen.com/gift_requests/e276c11e-f27b-4a6d-b9e4-f53cd5cd3d32"
headers = {
"Content-Type": "application/vnd.api+json",
"Authorization": "Bearer <api_key>",
"AndOpen-API-Version": "2025-09"
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
gift_request = response.json()
print(gift_request)
else:
print(f"Error: {response.status_code} - {response.text}")
<?php
$url = 'https://api.andopen.com/gift_requests/e276c11e-f27b-4a6d-b9e4-f53cd5cd3d32';
$headers = [
'Content-Type: application/vnd.api+json',
'Authorization: Bearer <api_key>',
'AndOpen-API-Version: 2025-09'
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($http_code === 200) {
$gift_request = json_decode($response, true);
print_r($gift_request);
} else {
echo "Error: HTTP " . $http_code . " - " . $response;
}
curl_close($ch);
?>