Log in

POST {{url}}/login

This request lets users log in.

It has a test script that sets the authorization token received in the response in the accessToken collection variable. This helps you reuse the token in other requests easily.

Request Body

{"username"=>"harry123", "password"=>"harry123"}

RESPONSES

status: OK

{"status":true,"data":{"user":{"id":1,"username":"harry123","email":"harry.smith@example.com","password":"d4cfaf03600bf1a55ba4372ceb17ff9234576eb062c1f8b78bd3c53c703f194c","age":33,"role":"admin","firstName":"Harry","lastName":"Smith","createdAt":"2023-05-12T10:34:32.864Z","updatedAt":"2023-05-12T10:34:32.864Z"},"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEsInVzZXJuYW1lIjoiaGFycnkxMjMiLCJpYXQiOjE2ODM4ODc4MjcsImV4cCI6MTY4Mzg5MTQyN30.hLf55ZfzHcr4mwi8l7dpzJWuHYOZCdfZMDav9X_rfZE"}}