Fetch Entry Page Fields
POST
https://api-v3.sweeppea.com/entrypage/fields
Description
This endpoint allows you to fetch entry page fields configuration using SweepstakesToken, including form fields, KeyEmail, and KeyPhoneNumber settings. Use this to retrieve complete entry page field information programmatically through the Sweeppea API.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
SweepstakesToken |
String (UUID v4) | Yes | Unique identifier of the sweepstakes |
Code Examples
curl -X POST "https://api-v3.sweeppea.com/entrypage/fields" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"SweepstakesToken": "uuid-v4-string"}'
const response = await fetch('https://api-v3.sweeppea.com/entrypage/fields', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
'SweepstakesToken': 'your-sweepstakes-token'
})
});
const data = await response.json();
console.log(data);
import requests
import json
url = "https://api-v3.sweeppea.com/entrypage/fields"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"SweepstakesToken": "uuid-v4-string"
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())
Response
{
"Response": true,
"Data": {
"SweepstakesToken": "uuid-v4-string",
"EntryPageToken": "uuid-v4-string",
"FormFields": [
{
"FieldID": "email",
"FieldType": "email",
"FieldName": "Email Address",
"FieldPlaceholder": "Enter your email",
"FieldRequired": true,
"PrimaryField": true
},
{
"FieldID": "phone",
"FieldType": "tel",
"FieldName": "Phone Number",
"FieldPlaceholder": "Enter your phone",
"FieldRequired": false,
"PrimaryField": false
}
],
"KeyEmail": "email",
"KeyPhoneNumber": "phone"
}
}
Error Responses
{
"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": "Missing SweepstakesToken In Request Body",
"Help": {
"ExpectedBody": {
"SweepstakesToken": "string (required) \u2014 UUID v4 of the sweepstakes"
}
},
"Code": 400
}
{
"Response": false,
"Message": "Entry Page Not Found",
"Code": 404
}