Generate Curl to get Audit Logs

Hello we would like to store the Audit Logs from Fireblocks in a database but to do this we need to retrieve them by HTTP Request with our API Key and Secret.
I couldn’t find a valid Curl (which would be the first step) to authorize and retrieve the Logs. Also in the docs there is nothing shown like this.
Could somebody maybe provide an example how to Authenticate and retrieve the Logs with a Curl?

Kind regards,

Philipp

Hey @mralladinz

In order to create an API call to Fireblocks, you would need to set 2 headers in your HTTP request:

  1. X-API-KEY: contains your API Key created in Fireblocks
  2. Authorization: contains a JWT token that is signed using the API Secret Key you created.

If you have both you can call:

curl -X GET 'https://api.fireblocks.io/v1/management/audit_logs' \
    -H 'Accept: application/json' \
    -H 'X-API-KEY: your_api_key' \
    -H 'Authorization: Bearer your_jwt_token_here' \
    -i

Please follow the guide below to generate the JWT:

You can also use our Postman Collection for this first request:

Or one of our SDKs:
JS - JavaScript Guide
Py - Python Guide

Hi SlavaSereb can I not generate the Bearer Token with a Curl? Because we are using a middleware which is not able to execute Javascript or Python.

Hey @mralladinz the JWT should be created in a programmatic way. You won’t be able to generate and sign the token with curl only.

What middleware are you using? I can share examples in additional programming languages that might assist you here.

We are using X-Gen it provides also the possibility GetOAuth2Token but we were not successfully yet.

Unfortunately, I’m not familiar with X-Gen.

I think it is better if you’ll be able to share your high level topology/architecture so I’ll be able to suggest how to approach this correctly.

Eventually, some code would need to generate this JWT before using any http client to send the request out.