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
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
Authorization | Bearer {{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
Path Variables
Key | Value | Description |
---|---|---|
uuid | 'ffffffff-ffff-ffff-ffff-ffffffffffff' | Identificador único del archivo |
Body
{
"tags": {
"company": "trust",
"rut": "12345",
"workspace":"home"
}
}
Code Examples
- Curl
- JavaScript
- Python
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"
}
}'
import requests
url = "https://api.trust.lat/chronos/v1/file_registers/ffffffff-ffff-ffff-ffff-ffffffffffff/tags/"
payload="{\n \"tags\": {\n \"company\": \"trust\",\n \"rut\": \"12345\",\n \"workspace\":\"home\"\n }\n}"
headers = {
'Content-Type': 'application/json'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
var axios = require('axios');
var data = JSON.stringify({"tags":{"company":"trust","rut":"12345","workspace":"home"}});
var config = {
method: 'patch',
url: 'https://api.trust.lat/chronos/v1/file_registers/ffffffff-ffff-ffff-ffff-ffffffffffff/tags/',
headers: {
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
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"
}