Change Properties of a file

We have implemented a precise way of handling the properties you can attach to your directories. Those properties will help for search and indexing.

EndpointDescription
PUT /v1/dir/{dir_uuid}/propertiesOverride the current properties and replace it with the one provided in the body
PUT /v1/dir/{dir_uuid}/properties/{key}(/{value})Override only the key value. Value can be pass in the URL or in the body.
DELETE /v1/dir/{dir_uuid}/propertiesDelete the content of properties
DELETE /v1/dir/{dir_uuid}/properties/{key}Delete the content of properties Key

Permissions (TODO)

PermissionValid
FILE_UPLOADAuthorized
FILE_LISTDenied
FILE_FETCHDenied
CONFIG_CHANGEDenied

Rest API - Change Properties

PUT /v1/dir/{dir_uuid}/properties

Body

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

API Demo

host: 'https://example.api.airstore.io' path: '/v1/dir/{dir_uuid}/properties' headers: X-Airstore-Secret-Key: aaaabbbbbccccc variables: dir_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",
    "dir_uuid": "4045f60e-8a91-5039-bb4e-3d3d247056e9",
    "properties": {.....}
}

Rest API - Change Properties key

A - With value in the URL

PUT /v1/dir/{dir_uuid}/properties/{key}/{value}

API Demo

host: 'https://example.api.airstore.io' path: '/v1/dir/{dir_uuid}/properties/{key}/{value}' headers: X-Airstore-Secret-Key: aaaabbbbbccccc variables: dir_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/dir/{dir_uuid}/properties/{key}

Body

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

API Demo

host: 'https://example.api.airstore.io' path: '/v1/dir/{dir_uuid}/properties/{key}' headers: X-Airstore-Secret-Key: aaaabbbbbccccc variables: dir_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",
    "dir_uuid": "4045f60e-8a91-5039-bb4e-3d3d247056e9",
    "properties": {.....}
}

Rest API - Delete Properties

DELETE /v1/dir/{dir_uuid}/properties

API Demo

host: 'https://example.api.airstore.io' path: '/v1/dir/{dir_uuid}/properties' headers: X-Airstore-Secret-Key: aaaabbbbbccccc variables: dir_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",
    "dir_uuid": "4045f60e-8a91-5039-bb4e-3d3d247056e9",
    "properties": {.....}
}

Rest API - Delete Properties value

DELETE /v1/dir/{dir_uuid}/properties/{key}

API Demo

host: 'https://example.api.airstore.io' path: '/v1/dir/{dir_uuid}/properties/{key}' headers: X-Airstore-Secret-Key: aaaabbbbbccccc variables: dir_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",
    "dir_uuid": "4045f60e-8a91-5039-bb4e-3d3d247056e9",
    "properties": {.....}
}