Progeny Docs
  • Welcome
  • Our solution
  • Use cases
  • API reference
    • Overview
    • /token/obtain
    • /register_face
    • /authenticate_face
    • /face_liveness
    • /ocr_card
    • /ocr_passport
    • /kyc_card
    • /kyc_passport
    • /background_check
    • /kyc_card_with_background_check
    • /kyc_passport_with_background_check
  • Frequently asked questions
Powered by GitBook
On this page
  • Exchange username and password for a token
  • Get a new access token

Was this helpful?

  1. API reference

/token/obtain

Authenticate and obtain an access token

Endpoint

https://be.progeny.tech/api/v3/accounts/token/obtain/

Purpose

Allows you to exchange the username and password provided by Progeny, for an access token and refresh token.

To access API endpoints that require authentication, you should include the access token in the header of all requests.

Sample request and response

Exchange username and password for a token

POST https://be.progeny.tech/api/v3/accounts/token/obtain/

Request Body

Name
Type
Description

username*

String

The username provided by Progeny

password*

String

The password provided by Progeny

{
    "refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTY0OTg3MzI0NywianRpIjoiN2YxZjBjNWFhNWNmNGY1NTg5ZWQ0NGMzYWRjZjRmZmEiLCJ1c2VyX2lkIjo0MX0.7sN29T5abguGOGR3dmwxNfVJZcMxE9qDSxFcYXIKYEc",
    "access": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjQ4NjYzOTQ3LCJqdGkiOiJhMjg3MmQ4ZmIzY2Y0NTVkYWE3ZmRiMWVmZmZjM2UzZSIsInVzZXJfaWQiOjQxfQ.L4GXorALzmFOuu-NnyumEY7SbQum4kCdAQJ3QolGbqc"
}
{
    "detail": "No active account found with the given credentials"
}
{
    "password": [
        "This field is required."
    ]
}

The "access" token used to make API calls is only valid for five minutes. To obtain a new access token without having to re-enter username/password, use the /refresh endpoint.

Get a new access token

POST https://be.progeny.tech/api/v3/accounts/token/refresh/

Request Body

Name
Type
Description

refresh*

String

The refresh value from /obtain

{
    "access": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjQ4NjY0NTQzLCJqdGkiOiI3YjkwYTgwMWU2ZGI0OTY4YTJmYTc3NmI1NmUzNDJkMCIsInVzZXJfaWQiOjQxfQ.-FPwOlMLX4WqGsJmmeY74F9R7EldudpvNnxO65hyeTw",
    "refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTY0OTg3Mzg0MywianRpIjoiZGY2YTdhNmViMTlkNGE5YWE1ZTg1NTAwZWMwMDYyNGMiLCJ1c2VyX2lkIjo0MX0.FKJnVtXGyWu5_5s4TAHOuoF0iW8TmDe-Chcnt4XcWq0"
}
{
    "detail": "Token is invalid or expired",
    "code": "token_not_valid"
}
PreviousOverviewNext/register_face

Last updated 3 years ago

Was this helpful?