Issue description
This error code typically indicates the certificate associated with the API user making the call has expired.
Fireblocks API body response
{ message 'Unauthorized: Invalid token format.', code: -5 }
Python SDK error message
fireblocks_sdk.api_types.FireblocksApiException: Got an error from fireblocks server: { "message": "Unauthorized: Invalid token format.", "code": -5 }
JavaScript SDK error response
response: {
status: 401,
statusText: 'Unauthorized',
headers: {
server: 'nginx',
date: ‘Tue, 28 Feb 2023 20:58:37 GMT’,
'Content-Type': 'application/octet-stream',
'content-length': '59',
'content-type': 'application/json',
connection: ‘keep-alive’
},
config: <REMOVED_CONFIG_DATA>,
request: <REMOVED_REQUEST_DATA>,
data: { "message": "Unauthorized: Invalid token format.", "code": -5 }
}
Resolution
You have two options for resolving this issue:
- Create a new API user, and remove the problematic user.
- Contact Fireblocks Support, and specify the problematic user. We will generate a new, valid certificate for the API user using the CSR provided during user creation.