REST API
A REST API (Representational State Transfer Application Programming Interface) is a standardized interface that allows systems to communicate over HTTP by adhering to REST principles. It uses stateless operations and standard HTTP methods like GET, POST, PUT, and DELETE to perform CRUD (Create, Read, Update, Delete) operations on resources, typically represented in JSON or XML formats.
You can use the REST API with any backend, framework, or library. If we don't provide a specific example for your stack, simply use your favorite HTTP client or library to make POST requests to the Basestack Forms endpoint.
Prerequisites
Before you begin, make sure you have:
- A Basestack Forms account
- Any library, framework, or language that supports HTTP calls
Quick Setup Guide
The Basestack Forms REST API accepts standard HTTP POST requests. Follow these steps to get started:
Understand the endpoint format
Your Basestack Forms endpoint follows this format:
https://forms-api.basestack.co/v1/s/[KEY]?mode=restReplace [KEY] with your form's unique key from the Basestack Forms Dashboard.
Make sure to include mode=rest in the query string to receive JSON responses instead of HTML redirects.
Test with cURL
Use the cURL command below to test your endpoint. This example demonstrates the required headers and request format.
curl -X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"name": "John Doe", "message": "Hello World"}' \
"https://forms-api.basestack.co/v1/s/[KEY]?mode=rest"