Fetch Data Transfer
Retrieve all data transfer logs for a specific sweepstakes. Returns bandwidth usage history and payment details.
POST
https://api-v3.sweeppea.com/billing/datatransfer
Description
This endpoint retrieves all data transfer logs for a specific sweepstakes. The sweepstakes must exist and belong to the authenticated user. Returns data transferred in bytes, payment status, and transaction details.
Authentication
This endpoint requires Bearer token authentication via the Authorization header.
Request Body
{
"SweepstakesToken": "uuid-v4-string"
}
Code Examples
curl -X POST "https://api-v3.sweeppea.com/billing/datatransfer" \
-H "Authorization: Bearer uuid-v4-string" \
-H "Content-Type: application/json" \
-d '{"SweepstakesToken":"uuid-v4-string"}'
const response = await fetch('https://api-v3.sweeppea.com/billing/datatransfer', {
method: 'POST',
headers: {
'Authorization': 'Bearer uuid-v4-string',
'Content-Type': 'application/json'
},
body: JSON.stringify({
SweepstakesToken: 'uuid-v4-string'
})
});
const data = await response.json();
console.log(data);
import requests
url = "https://api-v3.sweeppea.com/billing/datatransfer"
headers = {
"Authorization": "Bearer uuid-v4-string",
"Content-Type": "application/json"
}
payload = {
"SweepstakesToken": "uuid-v4-string"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
Response
{
"Response": true,
"Data": {
"TotalRecords": 3,
"DataTransfer": [
{
"SweepstakesToken": "uuid-v4-string",
"DataTransferred": 125000000,
"Paid": true,
"AmountPaid": 15.50,
"Rate": 1,
"TransactionID": "numeric-string",
"Date": "2025-01-20T10:15:00.000Z"
}
]
}
}
Error Responses
{
"Response": false,
"Message": "Missing SweepstakesToken in request body",
"Help": {
"ExpectedBody": {
"SweepstakesToken": "string (required) \u2014 UUID v4 of the sweepstakes"
}
},
"Code": 400
}
{
"Response": false,
"Message": "Missing or invalid Bearer token. Send your API token in the Authorization header as: Authorization: Bearer YOUR_API_TOKEN",
"Code": 401
}
{
"Response": false,
"Message": "Invalid API token. It does not match any account.",
"Code": 403
}
{
"Response": false,
"Message": "Sweepstakes not found or does not belong to user",
"Code": 404
}
{
"Response": false,
"Message": "Internal server error. Please try again; if it persists, contact support with the time of this request.",
"Code": 500
}