-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
64 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# API Testing Guide | ||
|
||
## Overview | ||
This guide explains how to test the ReproSchema backend API endpoints manually. | ||
|
||
## Prerequisites | ||
- `curl` command-line tool | ||
- Running ReproSchema server (via `docker compose up`) | ||
- Initial token (found in backend logs) | ||
|
||
## Getting Started | ||
|
||
1. First, check the backend logs to get the initial token: | ||
|
||
|
||
2. Get an auth token using the initial token: | ||
|
||
|
||
|
||
3. Use the auth token to submit data: | ||
|
||
|
||
## API Endpoints | ||
|
||
### Health Check | ||
|
||
|
||
### Get Auth Token | ||
|
||
Parameters: | ||
- `token`: Initial token from backend logs | ||
- `project`: Project name (default: "study") | ||
- `expiry_minutes`: Token expiry in minutes (default: 90) | ||
|
||
### Submit Data | ||
|
||
Headers: | ||
- `Authorization`: Auth token from `/api/token` endpoint | ||
- `Content-Type`: Must be `application/json` | ||
|
||
### Get Schema | ||
|
||
|
||
## Data Storage | ||
Submitted responses are stored in: | ||
|
||
|
||
## Common Issues | ||
1. "Invalid token" error: | ||
- Make sure you're using the correct initial token from logs | ||
- Initial tokens are regenerated on container restart | ||
|
||
2. "Invalid auth token" error: | ||
- Auth tokens expire after 90 minutes | ||
- Get a new auth token using the initial token | ||
- Don't include "Bearer " prefix in Authorization header | ||
|
||
## Development Testing | ||
For development mode features: |