OpenAI Schema API Documentation
To interact with the given schema using curl
, let’s assume you’re working with a JSON schema that represents questions with an ID, question text, correct answer, and multiple options. Here’s a breakdown of potential curl
commands to:
Get all questions
Add a new question
Get a question by ID
Update a question
Delete a question
I'll first outline example endpoints based on a RESTful approach, assuming FastAPI handles the backend with endpoints for managing questions.
Schema Example
Assume the JSON schema structure for each question is:
FastAPI Endpoint Structure (Assumptions)
Here’s an assumed structure for your FastAPI endpoints based on standard CRUD operations:
GET /questions
- List all questionsPOST /questions
- Add a new questionGET /questions/{id}
- Get a question by IDPUT /questions/{id}
- Update a question by IDDELETE /questions/{id}
- Delete a question by ID
curl
Commands
curl
Commands1. List All Questions
2. Add a New Question
To add a new question, provide a JSON body with id
, question
, correct_answer
, and options
.
3. Get a Specific Question by ID
4. Update a Question
To update a question by ID, include the updated JSON data in the request body.
5. Delete a Question
Summary of curl
Commands
curl
CommandsLast updated