How to download JSON via API
This guide will help you download and save JSON data from Lootfabriq using the curl command-line tool.
Requirements
- curl: Ensure curl is installed on your device. It’s a tool used to transfer data from or to a server.
 
Steps to download and save JSON
- Retrieve and save the latest completed report
 
Use the following command to download the latest completed report and save it as a JSON file:
curl -s -X GET https://api.lootfabriq.io/v1/api/instances/YOUR_INSTANCE_ID/reports/last-completed \-H "x-lootf-token: YOUR_API_TOKEN" \-O latest_report.json- Retrieve and save a specific report
 
If you have a specific report ID, you can retrieve it and save it with this command:
 curl -s -X GET https://api.lootfabriq.io/v1/api/instances/YOUR_INSTANCE_ID/reports/YOUR_REPORT_ID \-H "x-lootf-token: YOUR_API_TOKEN" \-O specific_report.json- Download and save a specific JSON file
 
To download and save a specific JSON file from a report, use:
curl -s -L -X GET https://api.lootfabriq.io/v1/api/dictionaries/YOUR_FILE_PATH \-H "x-lootf-token: YOUR_API_TOKEN" \-O your_file.jsonExample
Here is an example of downloading and saving JSON data:
# Retrieve and save the latest completed reportcurl -s -X GET https://api.lootfabriq.io/v1/api/instancse/YOUR_INSTANCE_ID/reports/last-completed \-H "x-lootf-token: YOUR_API_TOKEN" \-O latest_report.jsonor retrieve and save a specific report by ID:
curl -s -X GET https://api.lootfabriq.io/v1/api/instances/YOUR_INSTANCE_ID/reports/66acc87f0c93866a6b2a65cb \-H "x-lootf-token: YOUR_API_TOKEN" \-O specific_report.jsonExample output:
{  "id": "66acc87f0c93866a6b2a65cb", // REPORT_ID  "dictionaries": [    {      "id": "66acc87f0c93866a6b2a65cc",      "template_id": "character",      "file": "2TVwo8Vsr48V54n42J4t/exp/1fpv75969ksmb/character.json" // YOUR_FILE_PATH    },    {      "id": "66acc87f0c93866a6b2a65cd",      "template_id": "quest",      "file": "2TVwo8Vsr48V54n42J4t/exp/1fpv75969ksmb/quest.json"    },    {      "id": "66acc87f0c93866a6b2a65ce",      "template_id": "resource",      "file": "2TVwo8Vsr48V54n42J4t/exp/1fpv75969ksmb/resource.json"    }  ]}# Download and save the 'quest.json' file from the reportcurl -s -L -X GET https://api.lootfabriq.io/v1/api/dictionaries/2TVwo8Vsr48V54n42J4t/exp/1fpv75969ksmb/quest.json \-H "x-lootf-token: YOUR_API_TOKEN" \-O quest.json