Mitto v2.9 Sneak Peek - New Files APIs - download and upload

Mitto 2.9 adds new (and now documented) file related REST API endpoints:

Two endpoints in particular open up programatic Mitto use cases:

  • POST /api/v2/files/upload - Upload File
  • GET /api/v2/files/{file_name} - Get File

Upload File via Mitto’s REST API

Here’s an example of uploading a file to Mitto via the REST API.

Local file: zuar_products.json

[
    {
        "id": 1,
        "name": "Mitto"
    },
    {
        "id": 2,
        "name": "Rapid Portal"
    },
    {
        "id": 3,
        "name": "Custom Portal"
    }
]

cURL example:

curl -X POST https://{mitto_url}/api/v2/files/upload?API_KEY={api_key} -H 'accept: application/json' -H 'Content-Type: multipart/form-data' -F 'file=@zuar_products.json;type=application/json'

Here’s the resulting file:

Download File via Mitto’s REST API

Here’s an example of downloading a file from Mitto via the REST API.

cURL example:

curl -X GET https://{mitto_url}/api/v2/files/zuar_products.json?API_KEY={api_key} -H 'accept: application/json' -o zuar_products.json