Update Application
A través de este endpoint es posible actualizar los siguientes campos de una aplicación.
Atributte | Required | Data Type | Example |
---|---|---|---|
name | false | String | application_1 |
description | false | String | application from test |
img | false | String | https://google.com/.../googlelogo_color.png |
img_circle | false | String | https://google.com/.../googlelogo_color.png |
status | false | Boolean | true |
Endpoint
Headers
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
Authorization | Bearer {{access_token}} | access_token obtained in Atenea |
Url
Method: PUT
URL: https://api.trust.lat/company/api/v1/app/:app_id
Body
{
"name": "Trust",
"description": "This is a Trust app",
"img": "https://google.com/.../googlelogo.png",
"status": true
}
caution
Recuerda que para utilizar este endpoint es necesario un access token obtenido en el servicio Atenea
Code Examples
- Curl
- JavaScript
- Python
curl --location --request PUT 'https://api.trust.lat/company/api/v1/app/1' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{accessToken}}' \
--data-raw '{
"name": "Trust",
"description": "This is a Trust app",
"img": "https://google.cl",
"status": true
}'
import requests
url = "https://api.trust.lat/company/api/v1/app/1"
payload="{\n\t\"name\": \"Trust\",\n\t\"description\": \"This is a Trust app\",\n\t\"img\": \"https://google.cl\",\n\t\"capabilities\": [\"block\", \"logout\"],\n\t\"status\": true\n}"
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {{accessToken}}'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
var axios = require('axios');
var data = JSON.stringify({"name":"Trust","description":"This is a Trust app","img":"https://google.cl","status":true});
var config = {
method: 'put',
url: 'https://api.trust.lat/company/api/v1/app/1',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer {{accessToken}}'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Responses
HTTP Code: 200 Found
{
"status": true,
"app": {
"id": 1,
"bundle_id": "com.trust.application_example_updated",
"company_id": 1,
"name": "applicacion_1",
"description": "application from test 1",
"created_at": "2021-07-09T16:48:12.828Z",
"updated_at": "2021-07-09T16:48:12.828Z",
"status": true,
"img": "https://google.cl",
"capabilities": [],
"flavor_id": "com.trust.application_example_updated",
"os": "android",
"client_uid": "",
"img_circle": "",
"generic_app": false,
"colour": ""
}
}
HTTP Code: 404 Not Found
{
"status": false
}