Prismic

Prismic Headless CMS integration

Instead of using the /list endpoint (API documentation), this API supports Prismic's format directly.

This endpoint lists the assets with the following settings:

  • 50 elements per pages

  • ordered by last_update

Endpoint

GET {API_SECRET_KEY}@api.filerobot.com/{TOKEN}/integration/prismic/assets

API_SECRET_KEY

can be generated in the Asset hub (documentation)

TOKEN

your Filerobot token

GET Parameters

ParameterDescription

folder

the path to the folder you would like to list default: /

page

the result page number, starting from 1 default: 1

Examples

Request

Copy-paste the cURL request in your Terminal to see the API in action.

curl 'https://aecb26ec-f78f-4aec-a9f6-0fbaf38346b4@api.filerobot.com/fdocs/integration/prismic/assets?folder=/demo'
curl 'https://aecb26ec-f78f-4aec-a9f6-0fbaf38346b4@api.filerobot.com/fdocs/integration/prismic/assets?folder=/&page_num=4'

Response

The response format will look like this:

{
    "results_size": 81,
    "results": [
        {
            "id": "0de50f0c-d5dd-5a8c-ae96-9b8b32e500",
            "title": "c998f98fc77e833b3487b6e70dcbe0c7e62e7469cf1c572996d49e6c469e94.jpg",
            "description": "Some description colorful prismic_files",
            "image_url": "https://frtoksmp.filerobot.com/prismic_files/c998f98fce833b3487b6e70dcbe0c7e62e748969cf1c572996d49e6c469e94.jpg?vh=6aeec9&w=100&h=100&func=fit",
            "last_update": 1603813143000,
            "blob": {
                "name": "c998f98fc77e833b3487b6e70dcbe0c7e62e7469cf1c572996d49e6c469e94.jpg",
                "url": "https://frtoksmp.filerobot.com//prismic_files/c998f98fc77e833b3487b6e70dcbe0c7e62e7469cf1c572996d49e6c469e94.jpg?vh=6aeec9",
                "type": "image/jpeg",
                "size": 377727,
                "info": {
                    "img_h": 1000,
                    "img_w": 803,
                    "img_type": "JPEG"
                },
                "meta": {
                    "test key2": null,
                    "test key3": null,
                    "qa_tags": null
                    "tags": [
                        "colorful"
                    ],
                    "search": "Some description colorful prismic_files",
                    "description": "Some description"
                },
                "blurhash": null,
                "created_at": "2020-10-27T15:37:25Z",
                "modified_at": "2020-10-27T15:39:03Z"
            }
        },
        ...
    ]
}

Where:

  • results_size is the total counting of the listing result; and could be easily understood as the sum of size(results) of all pages, while each page contains a maximum of 50 files.

  • image_url is fixed to be resized to 100x100

  • description would be returned as a concatenation from blob->meta->search and blob->meta->tags and the parsed list of directories and sub-directories. In case the file doesn't have this field (and is at the root folder), it defaults to No description for this file is available.

Last updated