Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement API Specification #1

Open
apoclyps opened this issue Mar 4, 2023 · 0 comments
Open

Implement API Specification #1

apoclyps opened this issue Mar 4, 2023 · 0 comments

Comments

@apoclyps
Copy link
Owner

apoclyps commented Mar 4, 2023

API Specification for "Gisty"

Overview

Gisty is a web application responsible for allowing create, read, update, and delete operations on markdown files uploaded to the service or to file creates within the service through a web UI.

API Endpoints

Create a Markdown File

Creates a new markdown file in the service.

POST /api/v1/files
Content-Type: multipart/form-data

Request Parameters:

file: the markdown file to upload
Response:

Status Code: 201 Created
Location: /api/v1/files/{file_id}

Read a Markdown File

Retrieves an existing markdown file from the service.

GET /api/v1/files/{file_id}

Response:

Status Code: 200 OK
Content-Type: text/markdown
Content: the contents of the markdown file

Update a Markdown File

Updates an existing markdown file in the service.

PUT /api/v1/files/{file_id}
Content-Type: multipart/form-data

Request Parameters:

file: the new markdown file to upload
Response:

Status Code: 204 No Content

Delete a Markdown File

Deletes an existing markdown file from the service.

DELETE /api/v1/files/{file_id}

Response:

Status Code: 204 No Content

Error Responses

If an error occurs while processing a request, the API will return an error response with an appropriate status code and message.

Example Error Response

Status Code: 404 Not Found
Content-Type: application/json

{
"error": "File not found"
}

Authentication

The API requires authentication to access any of the endpoints. The authentication credentials should be sent with each request in the Authorization header using the Bearer token authentication scheme.

Example Authorization Header

Authorization: Bearer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant