Change Meta of a file

We have implemented a precise way of handling the meta you can attach to your image. Those meta will help for search and will be added to your file on download in the header X-Airstore-Meta.

EndpointDescription
PUT /file/{file_uuid}/metaOverride the current meta and replace it with the one provided in the body
PUT /file/{file_uuid}/meta/{key}(/{value})Override only the key value. Value can be pass in the URL or in the body.
DELETE /file/{file_uuid}/metaDelete the content of Meta
DELETE /file/{file_uuid}/meta/{key}Delete the content of Meta Key

API Permission: FILE_META_CHANGE

Rest API - Change Meta

PUT /file/{file_uuid}/meta

Body

{
    "meta": {
        "key1": "hello",
        "key2": [
            "something",
            "else"
        ]
    }
}

API Demo

host: 'https://example.api.airstore.io' path: '/v1/file/{file_uuid}/meta' headers: X-Airstore-Secret-Key: aaaabbbbbccccc variables: file_uuid: 4045f60e-8a91-5039-bb4e-3d3d247056e9 theme: clouds-midnight editor_theme: clouds_midnight method: PUT body: | { "meta": { "key1": "hello", "key2": [ "something", "else" ] } } render: curl_tab: true

Response Format

{
    "status":"success",
    "action":"meta_updated",
    "file_uuid": "4045f60e-8a91-5039-bb4e-3d3d247056e9",
    "meta": {.....}
}

Rest API - Change Meta key

A - With value in the URL

PUT /v1/file/{file_uuid}/meta/{key}/{value}

API Demo

host: 'https://example.api.airstore.io' path: '/v1/file/{file_uuid}/meta/{key}/{value}' headers: X-Airstore-Secret-Key: aaaabbbbbccccc variables: file_uuid: 4045f60e-8a91-5039-bb4e-3d3d247056e9 key: hello value: world theme: clouds-midnight editor_theme: clouds_midnight method: PUT render: curl_tab: true

B - With value un the body

PUT /v1/file/{file_uuid}/meta/{key}

Body

{
    "value": {
        "hello": "world",
        "something": "nice"
    }
}

API Demo

host: 'https://example.api.airstore.io' path: '/v1/file/{file_uuid}/meta/{key}' headers: X-Airstore-Secret-Key: aaaabbbbbccccc variables: file_uuid: 4045f60e-8a91-5039-bb4e-3d3d247056e9 key: hello theme: clouds-midnight editor_theme: clouds_midnight method: PUT body: | { "value": { "something": "else", "other": [ "something", "else" ] } } render: curl_tab: true

Response Format

{
    "status":"success",
    "action":"meta_value_updated",
    "file_uuid": "4045f60e-8a91-5039-bb4e-3d3d247056e9",
    "meta": {.....}
}

Rest API - Delete Meta

DELETE /v1/file/{file_uuid}/meta

API Demo

host: 'https://example.api.airstore.io' path: '/v1/file/{file_uuid}/meta' headers: X-Airstore-Secret-Key: aaaabbbbbccccc variables: file_uuid: 4045f60e-8a91-5039-bb4e-3d3d247056e9 theme: clouds-midnight editor_theme: clouds_midnight method: DELETE render: curl_tab: true

Response Format

{
    "status":"success",
    "action":"meta_deleted",
    "file_uuid": "4045f60e-8a91-5039-bb4e-3d3d247056e9",
    "meta": {.....}
}

Rest API - Delete Meta value

DELETE /v1/file/{file_uuid}/meta/{key}

API Demo

host: 'https://example.api.airstore.io' path: '/v1/file/{file_uuid}/meta/{key}' headers: X-Airstore-Secret-Key: aaaabbbbbccccc variables: file_uuid: 4045f60e-8a91-5039-bb4e-3d3d247056e9 key: hello theme: clouds-midnight editor_theme: clouds_midnight method: DELETE render: curl_tab: true

Response Format

{
    "status":"success",
    "action":"meta_value_deleted",
    "file_uuid": "4045f60e-8a91-5039-bb4e-3d3d247056e9",
    "meta": {.....}
}