forked from LibreMV/GridFlow
sigin docs
This commit is contained in:
9
docs/index.md
Normal file
9
docs/index.md
Normal file
@@ -0,0 +1,9 @@
|
||||
## Fenaka API docs
|
||||
|
||||
|
||||
### Fenaka app uses fixed token authorization token header in all request, for all users.
|
||||
```
|
||||
authorization: Bearer T5kr13UksdBT5Mq3NqNrXQr8uapaje7ONveQMPJsS3
|
||||
```
|
||||
I will be not be repeating token for rest of this document.
|
||||
|
88
docs/sigin.md
Normal file
88
docs/sigin.md
Normal file
@@ -0,0 +1,88 @@
|
||||
## Signin request
|
||||
|
||||
#### You will need to provide existing account phone number and password in this request
|
||||
|
||||
```bash
|
||||
curl --request POST \
|
||||
--url https://api.fenaka.mv/auth/signin \
|
||||
--header 'authorization: Bearer TOKEN' \
|
||||
--header 'content-type: application/json' \
|
||||
--data '{"mobile":"PHONE_NUMBER","password":"PASSWORD"}'
|
||||
```
|
||||
|
||||
## HTTP 200
|
||||
```json
|
||||
{
|
||||
"id": ,
|
||||
"name": "",
|
||||
"mobile": "",
|
||||
"email": "",
|
||||
"createdAt": "1970-01-01T00:00:00.000Z",
|
||||
"updatedAt": "1970-01-01T00:00:00.000Z",
|
||||
"deletedAt": null
|
||||
}
|
||||
```
|
||||
`updatedAt` and `createdAt` are retuned in ISO 8601 with milliseconds and in UTC timezone.
|
||||
You will also get a "Set-Cookie" in reponse header, which will be needed for later requests, store this header somewhere for later requests
|
||||
|
||||
```
|
||||
Set-Cookie: connect.sid=; HttpOnly; Path=/; Expires=Mon, 22 Sep 2025 15:24:18 GMT
|
||||
```
|
||||
(you only need the part before the first ";")
|
||||
|
||||
## HTTP 401
|
||||
```json
|
||||
{
|
||||
"error": "incorrect credentials"
|
||||
}
|
||||
```
|
||||
This is the response you will get if username or password is not correct
|
||||
- reset password
|
||||
- register an account
|
||||
|
||||
## HTTP 422
|
||||
Invalid password or invalid phone number
|
||||
- Phone number must contain 7 characters and password must contain 8 characters.
|
||||
```json
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"value": "1111",
|
||||
"msg": "must be at least 8 characters",
|
||||
"param": "password",
|
||||
"location": "body"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
- Invalid phone number
|
||||
```json
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"value": "0000",
|
||||
"msg": "invalid mobile",
|
||||
"param": "mobile",
|
||||
"location": "body"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
- Invalid password and phone number
|
||||
```json
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"value": "0000",
|
||||
"msg": "invalid mobile",
|
||||
"param": "mobile",
|
||||
"location": "body"
|
||||
},
|
||||
{
|
||||
"value": "Kee",
|
||||
"msg": "must be at least 8 characters",
|
||||
"param": "password",
|
||||
"location": "body"
|
||||
}
|
||||
]
|
||||
```
|
Reference in New Issue
Block a user