Access token

Authenticate with the REST API

post

Authenticate and retrieve an access_token to use as a bearer token in the header for other API calls.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
usernamestringOptional
passwordstringOptional
Responses
200Success
application/json
post
/api/access_token
POST /api/access_token HTTP/1.1
Host: app.personaify.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 46

{
  "username": "johnsmith",
  "password": "password"
}
200Success
{
  "access_token": "abcdefg"
}
api_base_url = "https://app.personaify.ai/api/"
username = "your_username"
password = "your_password"

access_token = get_access_token(api_base_url, username, password)

print(f"Successfully obtained access token for: {username}")

Last updated