Skip to main content

Update Tags From File

Actualiza los tags de un archivo ingresando su uuid. En caso que un archivo no tenga tags, aquellos que se ingresen por medio de este endpoint serán añadidos y en caso que el/los tags existan, serán reemplazados por los nuevos valores que fueron proporcionados. Los tags deben ser entregados en un body tipo JSON siguiendo una estructura Map<String:String>, es obligatorio que tanto la clave como el valor de un tag sean del tipo String.

Endpoint#

Headers

KeyValueDescription
Content-Typeapplication/json
AuthorizationBearer {{access_token}}access_token obtained in Atenea

Url

Method: PATCH
URL: https://api.trust.lat/chronos/v1/file_registers/:uuid/tags/
caution

Recuerda que para utilizar este endpoint es necesario un access token obtenido en el servicio Atenea

Como obtener un access token

Path Variables

KeyValueDescription
uuid'ffffffff-ffff-ffff-ffff-ffffffffffff'Identificador único del archivo

Body#

{
"tags": {
"company": "trust",
"rut": "12345",
"workspace":"home"
}
}

Code Examples#

curl --location --request PATCH 'https://api.trust.lat/chronos/v1/file_registers/ffffffff-ffff-ffff-ffff-ffffffffffff/tags/' \
--header 'Content-Type: application/json' \
--data-raw '{
"tags": {
"company": "trust",
"rut": "12345",
"workspace":"home"
}
}'

Responses#

HTTP Code: 200 OK (Tags updated successfully)#

{
"code": 200,
"resource": "File Register",
"data": {
"uuid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"name": "dog.jpg",
"size": "1687.421875 KB",
"created_at": "2021-09-23T21:01:08.946Z",
"tags": {
"company": "trust",
"rut": "12345",
"workspace": "home"
},
"path": "dog.jpg"
},
"message": "Updated"
}

HTTP Code: 200 OK (No tags updated)#

{
"code": 200,
"resource": "File Register",
"data": {
"uuid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"name": "dog.jpg",
"size": "1687.421875 KB",
"created_at": "2021-09-23T21:01:08.946Z",
"tags": {
"rut": "12345",
"company": "trust",
"workspace": "office"
},
"path": "dog.jpg"
},
"message": "No tags updated"
}

HTTP Code: 404 Not Found#

{
"code": 404,
"resource": "File Register",
"message": "Not found"
}
Last updated on by Claudio-Franco