-
Notifications
You must be signed in to change notification settings - Fork 1
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
5 changed files
with
170 additions
and
148 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
# API Reference Overview | ||
|
||
The Nextra API Reference provides comprehensive information about the APIs available within the Nextra framework. This documentation is intended for developers who wish to integrate Nextra's features into their own applications or extend its functionality. | ||
The `Nextra` API Reference provides comprehensive information about the APIs | ||
available within the `Nextra` framework. | ||
This documentation is intended for developers | ||
who wish to integrate `Nextra` features into their own applications | ||
or extend its functionality. | ||
|
||
Explore the various API endpoints and learn how to effectively use them in your projects. Each section includes detailed descriptions, usage examples, and response formats to help you get started quickly and efficiently. | ||
Explore the various API endpoints | ||
and learn how to effectively use them in your projects. | ||
Each section includes detailed descriptions, usage examples, | ||
and response formats to help you get started quickly and efficiently. | ||
|
||
Check out the individual API sections for more details: | ||
- [About API](reference_api/about) |
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,153 @@ | ||
# Person API | ||
|
||
The `Person` API allows you to manage personal data | ||
within your Nextra-powered documentation site. | ||
This endpoint provides functionalities to create, retrieve, update, | ||
and delete `person` information, making it a crucial component | ||
for any personalized applications. | ||
|
||
## Endpoints | ||
|
||
### Get Person | ||
|
||
Retrieve a list of all persons. | ||
|
||
**Endpoint:** | ||
``` | ||
GET /api/persons | ||
``` | ||
|
||
**Response:** | ||
|
||
The response includes a list of person objects, | ||
each containing the following fields: | ||
- `id`: The unique identifier for the person. | ||
- `name`: The name of the person. | ||
- `email`: The email address. | ||
- `role`: The role of the person has in the system. | ||
|
||
**Example:** | ||
|
||
```json | ||
[ | ||
{ | ||
"id": "1", | ||
"name": "John Doe", | ||
"email": "[email protected]", | ||
"role": "admin" | ||
}, | ||
{ | ||
"id": "2", | ||
"name": "Jane Smith", | ||
"email": "[email protected]", | ||
"role": "editor" | ||
} | ||
] | ||
``` | ||
|
||
### Create Person | ||
|
||
Add a new user to the system. | ||
|
||
**Endpoint:** | ||
``` | ||
POST /api/person | ||
``` | ||
|
||
**Request Body:** | ||
|
||
The request body should include the following fields: | ||
- `name` (required): The name of the person. | ||
- `email` (required): The email address of the person. | ||
- `role` (optional): The role of the person. Default is `viewer`. | ||
|
||
**Example:** | ||
|
||
```json | ||
{ | ||
"name": "Alice Johnson", | ||
"email": "[email protected]", | ||
"role": "editor" | ||
} | ||
``` | ||
|
||
**Response:** | ||
|
||
The response includes the created person object. | ||
|
||
```json | ||
{ | ||
"id": "3", | ||
"name": "Alice Johnson", | ||
"email": "[email protected]", | ||
"role": "editor" | ||
} | ||
``` | ||
|
||
### Update Person | ||
|
||
Modify an existing person's information. | ||
|
||
**Endpoint:** | ||
``` | ||
PUT /api/person/:id | ||
``` | ||
|
||
**Request Body:** | ||
|
||
The request body can include any of the following fields to update: | ||
- `name` (optional): The name of the person. | ||
- `email` (optional): The email address of the person. | ||
- `role` (optional): The role of the person. | ||
|
||
**Example:** | ||
|
||
```json | ||
{ | ||
"name": "Alice Johnson", | ||
"email": "[email protected]", | ||
"role": "admin" | ||
} | ||
``` | ||
|
||
**Response:** | ||
|
||
The response includes the updated person object. | ||
|
||
```json | ||
{ | ||
"id": "3", | ||
"name": "Alice Johnson", | ||
"email": "[email protected]", | ||
"role": "admin" | ||
} | ||
``` | ||
|
||
### Delete Person | ||
|
||
Remove a person from the system. | ||
|
||
**Endpoint:** | ||
``` | ||
DELETE /api/person/:id | ||
``` | ||
|
||
**Response:** | ||
|
||
The response includes a confirmation message. | ||
|
||
```json | ||
{ | ||
"message": "User deleted successfully." | ||
} | ||
``` | ||
|
||
## Summary | ||
|
||
The Person API provides essential operations | ||
for managing people within your `Nextra` documentation site. | ||
Whether you need to add a new person, update or remove existing ones, | ||
these endpoints offer the flexibility | ||
to handle all person-related tasks efficiently. | ||
For more information on other available APIs, | ||
refer back to the [API Reference](index). |
This file was deleted.
Oops, something went wrong.
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