Connecting to the API
Aerostack provides a dedicated endpoint to verify your API connection and ensure your API key is correctly configured. This is the recommended first step when integrating with the Aerostack API.
Connection Test Endpoint
Section titled “Connection Test Endpoint”Use this endpoint to “ping” the API and verify that you can access your project.
Endpoint
Section titled “Endpoint”GET https://api.aerostack.dev/v1/public/projects/:projectSlug/connect
Headers
Section titled “Headers”| Header | Value | Description |
|---|---|---|
X-API-Key | YOUR_API_KEY | Required. Your project’s secret API Key. |
Example Request
Section titled “Example Request”curl -X GET https://api.aerostack.dev/v1/public/projects/my-project-slug/connect \ -H "X-API-Key: ak_Live_..."Success Response
Section titled “Success Response”If your API key is valid and matches the project, you will receive a 200 OK response:
{ "success": true, "message": "Successfully connected to project 'My Awesome Project'", "project": { "name": "My Awesome Project", "slug": "my-project-slug", "id": "proj_123456789" }}Error Responses
Section titled “Error Responses”- 401 Unauthorized: API Key is missing or invalid.
- 403 Forbidden: API Key is valid but does not belong to the specified project.
- 404 Not Found: The project slug is incorrect.
Next Steps
Section titled “Next Steps”Once you have successfully connected:
- Browse Components: Use
/v1/public/projects/:slug/componentsto see your schema. - Fetch Content: Use
/v1/public/projects/:slug/collections/:collection_slug/itemsto get your data.