Overview
ShortStack offers an Entries API that enables you to retrieve entry data collected and stored in your account. ShortStack's API is intended for use by software developers and is an advanced feature. If you are unsure, please feel free to use one of the Form Integration options detailed below.
Before You Start
- Every request needs the header
Authorization: Token token=YOUR_API_KEY. If you don’t yet have an API key, you can create one using the API Explorer (see next section). - Successful calls return JSON that looks like
{ "data": [...] }. Errors come back with a short text message and a status code such as401(bad key) or404(item not found).
API Explorer
You can use the Entries Manager to filter entries based on your chosen criteria, then use our Entry API Explorer to build a curl command to retrieve the same entries via our API.
- From the navigation bar, choose Manage > Entries.
- (Optional) Sort and filter by the list you wish to export.
- Click the Actions drop-down at the top right of the Entries Manager.
- Select Explore Entries API.
- Follow the API Explorer instructions to select an existing API key (if any) or to create a new one.
- The generated
curlcommand will reflect any filters applied in the Entries Manager.
Basic List Request
Fetch the first 25 entries you can see:
curl -i -H "Authorization: Token token=$API_KEY" \ "https://entries.shortstack.com/entries?per_page=25"
Sample response:
{
"data": [
{
"id": 12345,
"campaign_id": 678,
"list_id": 91011
}
]
}Paging Through Results
-
Run your request with
-iso headers are shown:curl -i -H "Authorization: Token token=$API_KEY" \ "https://entries.shortstack.com/entries?sort=received&direction=descending&per_page=50"
- Look in the output for a header named
Link:. Copy the web address inside<>that ends withrel="next". -
Call that address to load the next page:
curl -i -H "Authorization: Token token=$API_KEY" \ "https://entries.shortstack.com/entries?sort=received&direction=descending&per_page=50&last_id=45678&last_sort=2024-04-10T16:45:00Z"
- Repeat until the header no longer shows
rel="next". -
To jump back to the beginning with the same filters, copy the address that ends with
rel="first"and call it:curl -i -H "Authorization: Token token=$API_KEY" \ "https://entries.shortstack.com/entries?sort=received&direction=descending&per_page=50"
Paging & Sorting Parameters
-
per_page– how many entries to return (default 100, max 5000). -
sort– the field to order results by (defaults toid). -
direction–ascendingordescendingorder. -
last_id– the finalidfrom the previous page when you follow anextlink. -
last_sort– the last value of yoursortfield when sorting by something other thanid.
Filtering Parameters
-
campaign– one or more campaign IDs, passed ascampaign=1,2. -
list– one or more list IDs. -
feed– one or more social media feed IDs. -
list_tag– one or more tag names that map to list IDs. -
category– one or more category names. -
city– one or more city names. -
country– one or more country codes or names. -
province– one or more state or province names. -
postal_code– one or more postal or ZIP codes (dashes are ignored). -
label– one or more label values. -
email– exact email address to match. -
received– date range in the formstart,end(ISO8601). -
age– age range in the formmin,max. -
id– ID range in the formmin,max. -
votes1,votes2,votes3– vote count ranges in the formmin,max. -
image_width,image_height– image dimension ranges in the formmin,max. -
recaptcha_score– decimal score range in the formmin,max. -
approved–true,false,1, or0to filter by approval status. -
exclude_feeds– set totrue/1to include only entries without a feed unlessfeedis also sent. -
image–true/falseto require an image. -
test–true/falseto find test entries. -
video–true/falseto require a video. -
profile– export profile ID that controls which fields appear. -
es_boolean_X– filters on a custom boolean field defined in your profile (Xis the number shown in the profile). -
es_date_X– filters on a custom date range for profile fieldX. -
es_number_X– filters on a custom numeric range for profile fieldX. -
es_list_X– filters on a custom list field for profile fieldX; pass multiple values as a list.
Filter Examples by Parameter Type
-
Text match: add
country=USto find entries from the United States. -
Boolean switch: add
approved=trueto find only approved entries (true,false,1, or0are accepted). -
List of IDs: add
list=12,34to pull entries from those two lists. -
Date range: add
received=2024-01-01,2024-01-31for entries received in January 2024 (leave a side blank for open-ended ranges, e.g.,received=,2024-01-31). -
Number range: add
age=18,to find ages 18 and higher, orvotes1=10,20for a specific span. -
Search term: add
search=winnerto look across indexed text fields; emails likename@example.comare matched exactly. -
Profile output: add
profile=42if you have an export profile that maps fields for download. -
Custom profile field: add
es_list_2=VIP,Priorityto filter on a mapped list-type custom field.
Combine filters by joining them with &, for example:
curl -i -H "Authorization: Token token=$API_KEY" \ "https://entries.shortstack.com/entries?per_page=50&country=US&approved=true&received=2024-01-01,2024-03-31"
Get a Single Entry
Provide the entry ID, and optionally a profile to shape the response:
curl -i -H "Authorization: Token token=$API_KEY" \ "https://entries.shortstack.com/entries/12345?profile=42"
If the entry belongs to another account or does not exist you will receive a 404 response.
Other Options for Form Integrations
ShortStack also supports form integrations to enhance your campaign functionality. These include:
- MailChimp
- Google Maps
- Webhooks
Learn more about Form Integrations.