Skip to content

muhiddinjv/oserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Documentation

Environments

Endpoints

AUTH

1) POST /auth/signin

Headers:

  • Content-Type: application/json

Request:

{
    "phoneNumber": "998935399093",
    "password": "wholesaler"
}

Response:

{
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI2NWE1NjMwNjBjZjg2M2Q4ZGEzMWNjMWIiLCJwaG9uZU51bWJlciI6Ijk5ODkzNTM5OTA5MyIsImlhdCI6MTcxMjAyNzc1NSwiZXhwIjoxNzEyMDMxMzU1fQ.nvBKOx6zayHgu1JwFZCO-TngeMDU2LIVcpt4QN4S-UM"
}

2) GET /auth/profile

Headers:

  • Content-Type: application/json
  • Authorization: Bearer Token = accessToken

Response:

  {
     "sub": "65a563060cf863d8da31cc1b",
     "phoneNumber": "998935399093",
     "iat": 1712210856,
     "exp": 1712214456
  }
USERS

1) POST /users

Headers:

  • Content-Type: application/json
  • Authorization: Bearer Token = accessToken

Request:

{
    "firstName": "Mike",
    "lastName": "Tyson",
    "phoneNumber": "998935399098",
    "address": "Tashkent, Uzbekistan",
    "password": "password",
    "role": "admin"
}

Response:

{
    "_id": "660e6c6a0bef37745202a4df",
    "bossId": null,
    "firstName": "Mike",
    "lastName": "Tyson",
    "address": "Tashkent, Uzbekistan",
    "password": "password",
    "phoneNumber": "998935399098",
    "role": "admin",
    "status": 1
}

2) PATCH | GET /users/id

Headers:

  • Content-Type: application/json
  • Authorization: Bearer Token = accessToken

Response:

{
    "_id": "660e6c6a0bef37745202a4df",
    "bossId": null,
    "firstName": "Mike",
    "lastName": "Tyson",
    "address": "Tashkent, Uzbekistan",
    "password": "password",
    "phoneNumber": "998935399098",
    "role": "admin",
    "status": 1
}

3) GET /users

Headers:

  • Content-Type: application/json
  • Authorization: Bearer Token = accessToken

Response:

[
    {
        "bossId": null,
        "_id": "65dc70c6a441a798ba5e8562",
        "firstName": "admin",
        "phoneNumber": "998935399095",
        "address": "Tashkent, Uzbekistan",
        "password": "admin",
        "role": "admin",
        "status": 1
    },
    {
        "bossId": null,
        "_id": "65a563060cf863d8da31cc1b",
        "firstName": "wholesaler",
        "phoneNumber": "998935399093",
        "address": "Tashkent, Uzbekistan",
        "password": "wholesaler",
        "role": "wholesaler",
        "status": 1
    }...
]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published