Deepfactor exposes APIs that can invoked to pull insights about your artifacts and workloads. These APIs are authenticated and require a valid token to be passed. In order to generate a token to access these APIs, you will need to create an Integration client.
Create Integration Client #
- On the left panel, navigate to ‘Admin Settings.’
- Select the ‘Deepfactor API’ tab.
- Click on ‘Add Integration Client’
- Enter name and description. Click Save.
- Copy or download the client details
#
Create Access Token #
You can create an access token using the Integration Client details retrieved in the previous step by invoking the following API.
POST https://<YOUR_DEEPFACTOR_SITE_DOMAIN>/api/auth/v1/access-token Headers: Accept: application/json Content-Type: application/json Request Body: { "client_id": "CLIENT_ID", "client_secret": "CLIENT_SECRET", "customer_id": "CUSTOMER_ID", "token_type": "integration" } Sample Response: { "data": { "access_token": "ACCESS_TOKEN" } }
Note: The generated access token is valid for 5 minutes. If you intend to invoke APIs post that interval, you will need to generate another access token by invoking the above API again.
Invoke Deepfactor APIs #
Now that you have generated an access token, you can invoke Deepfactor APIs provided in the swagger document accessible from Integrations -> API. Please pass the access token in the Authorization header in the following format
Authorization: Bearer ACCESS_TOKEN