175 lines
3.4 KiB
HTTP
Executable File
175 lines
3.4 KiB
HTTP
Executable File
/*
|
|
# API version V1
|
|
|
|
> [Base URL: http://localhost:8000/api/v1/*]
|
|
|
|
Purpose to handle authentication with [JWT](https://jwt-auth.readthedocs.io/en/develop/quick-start/)
|
|
|
|
*/
|
|
/*
|
|
## Response
|
|
### 200
|
|
Success:
|
|
```js
|
|
{
|
|
"data": [] | {},
|
|
"status": true
|
|
}
|
|
```
|
|
Fail:
|
|
```js
|
|
{
|
|
"data": [] | {},
|
|
"status": false
|
|
}
|
|
```
|
|
### 203
|
|
* On/Off for button switch:
|
|
* Success/Fail:
|
|
```js
|
|
{
|
|
// no content
|
|
}
|
|
```
|
|
### 400
|
|
* Validate fail.
|
|
* Fail:
|
|
```js
|
|
{
|
|
"attribute": [
|
|
"The :attribute field is required.",
|
|
...
|
|
]
|
|
...
|
|
}
|
|
```
|
|
### 401
|
|
* Unauthentication, not login.
|
|
* Fail:
|
|
```js
|
|
{
|
|
"message": "Token has expired"
|
|
}
|
|
```
|
|
### 403
|
|
* Permission denied.
|
|
* Fail:
|
|
```js
|
|
{
|
|
"message": "..."
|
|
}
|
|
```
|
|
### 404
|
|
* Page not found.
|
|
* Fail:
|
|
```js
|
|
{
|
|
"message": "The route {path} could not be found."
|
|
}
|
|
```
|
|
### 500
|
|
* Server error.
|
|
* Fail:
|
|
```js
|
|
{
|
|
"message": "..."
|
|
}
|
|
```
|
|
### 503
|
|
* Server maintain.
|
|
* Fail:
|
|
```js
|
|
{
|
|
"message": "..."
|
|
}
|
|
```
|
|
*/
|
|
@url=http://localhost:8000
|
|
@token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwMDAvYXBpL3YxL2xvZ2luIiwiaWF0IjoxNzAwMTIyNzkwLCJleHAiOjE3MDAxMjYzOTAsIm5iZiI6MTcwMDEyMjc5MCwianRpIjoiT1FyWW9mazkwWXJSTnlyWSIsInN1YiI6IjEiLCJwcnYiOiI5Yjk4MmUxNDA4MzM2MmVjMmViZjE4MDQxM2NmNGVlMGFjM2VkY2U4In0.VT1-FwvSdMsbHiJ6-dQfoH3LfF2_14GxzgYbQWdRATc
|
|
|
|
{{
|
|
exports.defaultHeaders = {
|
|
"Content-Type": "application/json",
|
|
"Accept": "application/json"
|
|
}
|
|
}}
|
|
###
|
|
# @name logout
|
|
POST {{url}}/api/v1/logout
|
|
...defaultHeaders
|
|
Authorization: Bearer {{token}}
|
|
|
|
HTTP/1.1 200 - OK
|
|
host: localhost:8000
|
|
date: Thu, 16 Nov 2023 08:20:13 GMT, Thu, 16 Nov 2023 08:20:13 GMT
|
|
connection: close
|
|
x-powered-by: PHP/8.2.11
|
|
cache-control: no-cache, private
|
|
content-type: application/json
|
|
x-ratelimit-limit: 60
|
|
x-ratelimit-remaining: 57
|
|
phpdebugbar-id: X29245e892030a261594af408e13086a3
|
|
access-control-allow-origin: *
|
|
###
|