Change Properties of a file

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

Endpoint Description
PUT /v1/file/{file_uuid}/properties Override the current properties and replace it with the one provided in the body
PUT /v1/file/{file_uuid}/properties/{key}(/{value}) Override only the key value. Value can be pass in the URL or in the body.
DELETE /v1/file/{file_uuid}/properties Delete the content of properties
DELETE /v1/file/{file_uuid}/properties/{key} Delete the content of properties Key

Permissions (TODO)

Permission Valid
FILE_UPLOAD Authorized
FILE_LIST Denied
FILE_FETCH Denied
CONFIG_CHANGE Denied

Rest API - Change Properties

PUT /v1/file/{file_uuid}/properties

Body

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

API Demo

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

Response Format

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

Rest API - Change Properties key

A - With value in the URL

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

API Demo

host: 'https://example.api.airstore.io' path: '/v1/file/{file_uuid}/properties/{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}/properties/{key}

Body

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

API Demo

host: 'https://example.api.airstore.io' path: '/v1/file/{file_uuid}/properties/{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":"properties_value_updated",
    "file_uuid": "4045f60e-8a91-5039-bb4e-3d3d247056e9",
    "properties": {.....}
}

Rest API - Delete Properties

DELETE /v1/file/{file_uuid}/properties

API Demo

host: 'https://example.api.airstore.io' path: '/v1/file/{file_uuid}/properties' 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":"properties_deleted",
    "file_uuid": "4045f60e-8a91-5039-bb4e-3d3d247056e9",
    "properties": {.....}
}

Rest API - Delete Properties value

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

API Demo

host: 'https://example.api.airstore.io' path: '/v1/file/{file_uuid}/properties/{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":"properties_value_deleted",
    "file_uuid": "4045f60e-8a91-5039-bb4e-3d3d247056e9",
    "properties": {.....}
}