# Generate Public Token This API returns the Public Token which are short lived tokens required for you to access MeasureOne APIs. The Authorization header should contain the word word followed by a space and a base64-encoded string . For example, to authorize as demo / p@55w0rd you should send ### Public Tokens Endpoint: POST /v3/auth/generate_public_token Version: 3.0 Security: Basic ## Header parameters: - `Authorization` (string) Provide the Base64 representation of your e.g. "Basic \\>". - `Content-type` (string) Content-type of the request payload. MeasureOne accepts content in application/json format unless specified otherwise ## Request fields (application/json): - `validity` (number) Public token validity in seconds - `scopes` (array) List of scopes for the generated public token. Each scope defines the set of API endpoints that can be accessed using the token. See the table above for details Compatibility note: An unspecified scope will default to Enum: "WIDGET", "GLOBAL" - `policy` (object) A set of attributes for specifying data access rules associated with this token. - `policy.individual_id` (string) Restricts access to the Individual identified by the specified MeasureOne ID. ## Response 200 fields (application/json): - `access_token` (string) Access token generated for you to access MeasureOne API Example: "6fd5122a-9a91-4bd6-1219-d6e71fd123b0" - `token_type` (string) Type of access token. This value is always Example: "bearer" - `expires_in` (number) Seconds left to expire Example: 899 - `expires_at` (number) Timestamp in milliseconds at which access token will expire Example: 1681191048000 ## Response 400 fields (application/json): - `timestamp` (number) Timestamp in milliseconds - `error_code` (string) MeasureOne Error code - `error_message` (string) Details of the error ## Response 401 fields (application/json): - `timestamp` (number) Timestamp in milliseconds - `error_code` (string) MeasureOne Error code - `error_message` (string) Details of the error ## Response 405 fields (application/json): - `timestamp` (number) Timestamp in milliseconds Example: 1655227025839 - `error_code` (string) MeasureOne Error code Example: "METHOD_NOT_ALLOWED" - `error_message` (string) Details of the error Example: "Given Method not allowed" - `http_code` (number) Example: 405 ## Response 500 fields (application/json): - `timestamp` (number) Timestamp in milliseconds - `error_code` (string) MeasureOne Error code - `error_message` (string) Details of the error