# acr-api-pull

Query ACRCloud's API by a set of file_ids in a csv and save into a local database for review.

## Setup

1. Copy environment file
```
$ cp .env.shadow .env
```
2. Edit `.env`, adding `ACR_TOKEN` secret value used for API authentication
3. Add a `.csv` file into `./data` that has single column called `file_id`
* :warning: These are file_ids as ACRCloud knows them, `OrchardAsset.id` for assets in the ows-assets-db or a long non-deterministic string sent via the initial catalog import that must be retrieved from logs or an export.
4. Change `INPUT_FILENAME` in `docker-compose.yaml` to match your input data filename

## Execute

```
$ docker-compose up --build app
```
:bulb: Mappings already in the database will not be re-fetched from API.

## Review

Use your favourite mysql database client to connect to local database using credentials defined in `.env` and query the table `db.mappings`.