Public
Documentation Settings

Stock Manage (PDI)

Stock Api feito para o artigo "Construindo uma Api com Django e Django Rest Framework" por Leonardo de Souza Chaves

Github do repositório: https://github.com/Leonardo8133/StockApp-PDI-

AUTHORIZATIONBearer Token
Token

<token>

User

AUTHORIZATIONBearer Token
This folder is using Bearer Token from collectionStock Manage (PDI)

GETRetrieve User Data

http://127.0.0.1:8000/api/user/me/
AUTHORIZATIONBearer Token
This request is using Bearer Token from collectionStock Manage (PDI)
Example Request
curl
curl --location 'http://127.0.0.1:8000/api/user/me/'
401 Unauthorized
Example Response
json
{
  "detail": "Authentication credentials were not provided."
}
Date

Thu, 08 Dec 2022 19:52:14 GMT

Server

WSGIServer/0.2 CPython/3.9.6

Content-Type

application/json

WWW-Authenticate

Bearer

Vary

Accept

Allow

PUT, PATCH, DELETE, OPTIONS

X-Frame-Options

DENY

Content-Length

58

X-Content-Type-Options

nosniff

Referrer-Policy

same-origin

Cross-Origin-Opener-Policy

same-origin

PATCHUpdate User Data

http://127.0.0.1:8000/api/user/me/
AUTHORIZATIONBearer Token
This request is using Bearer Token from collectionStock Manage (PDI)
Bodyformdata
email

teste@teste.com

Example Request
curl
curl --location --request PATCH 'http://127.0.0.1:8000/api/user/me/' \
--form 'email="teste@teste.com"'
200 OK
Example Response
json
{
  "id": 3,
  "last_login": null,
  "is_superuser": false,
  "username": "leo2",
  "first_name": "",
  "last_name": "",
  "is_staff": false,
  "is_active": true,
  "date_joined": "2022-12-08T20:13:58.601840",
  "name": "",
  "email": "teste@teste.com",
  "max_products": 50,
  "customer": null,
  "groups": [],
  "user_permissions": []
}
Date

Thu, 08 Dec 2022 21:00:58 GMT

Server

WSGIServer/0.2 CPython/3.9.6

Content-Type

application/json

Vary

Accept

Allow

GET, PUT, PATCH, DELETE, HEAD, OPTIONS

X-Frame-Options

DENY

Content-Length

277

X-Content-Type-Options

nosniff

Referrer-Policy

same-origin

Cross-Origin-Opener-Policy

same-origin

PUTUpdate User Data

http://127.0.0.1:8000/api/user/me/
AUTHORIZATIONBearer Token
This request is using Bearer Token from collectionStock Manage (PDI)
Bodyformdata
email

teste-novo@teste.com

Example Request
curl
curl --location --request PUT 'http://127.0.0.1:8000/api/user/me/' \
--form 'email="teste-novo@teste.com"'
400 Bad Request
Example Response
json
{
  "password": [
    "This field is required."
  ],
  "username": [
    "This field is required."
  ],
  "name": [
    "This field is required."
  ]
}
Date

Mon, 12 Dec 2022 23:48:10 GMT

Server

WSGIServer/0.2 CPython/3.9.6

Content-Type

application/json

Vary

Accept

Allow

GET, PUT, PATCH, DELETE, HEAD, OPTIONS

X-Frame-Options

DENY

Content-Length

114

X-Content-Type-Options

nosniff

Referrer-Policy

same-origin

Cross-Origin-Opener-Policy

same-origin