Fetch Entry Page Fields
Fetch Entry Page Fields API endpoint for Sweeppea. POST entrypage/fields. Complete documentation with code examples in cURL, JavaScript, and Python.
POST
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.
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"}'
Response
200 OK
{
"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
401 Unauthorized
{
"Response": false,
"Message": "Invalid or Missing Bearer Token",
"Code": 401
}
403 Forbidden
{
"Response": false,
"Message": "Invalid API Token",
"Code": 403
}
400 Bad Request
{
"Response": false,
"Message": "Missing SweepstakesToken In Request Body",
"Code": 400
}
404 Not Found
{
"Response": false,
"Message": "Entry Page Not Found",
"Code": 404
}