Skip to main content

Create Application

Este endpoint se encarga de crear una app perteneciente a una compañía. Esta aplicación tiene los siguientes campos:

KeyRequiredData TypeExampleDescription
company_idtrueInteger1
namefalseStringapplication_1
descriptionfalseStringapplication from test
bundle_idtrueStringcom.trust.app_exampleIdentificador de la aplicación, es obligatorio que tenga el siguiente formato: com.your-company.app-name.
flavor_idtrueStringcom.trust.app_exampleActúa de forma similar al bundle_id pues actúa como un identificador, es por esta razón que se recomienda que tanto bundle y flavor sean el mismo (en caso de ser distintos se indicará que la aplicación es genérica).
imgfalseStringhttps://.../googlelogo.png
ostrueStringandroidDebe ser 'android' o 'ios'
generic_appfalseBooleanfalse
img_circlefalseStringhttps://.../googlelogo.png
capabilitiestrueArray[]
client_uidfalseString
colourfalseString

Endpoint

Headers

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

Url

Method: POST
URL: https://api.trust.lat/company/api/v2/app

Body

{
"company_id": 1,
"name": "application_1",
"description": "application from test 1",
"bundle_id": "com.trust.application",
"flavor_id": "com.trust.application",
"img": "https: //picsum.photos/200/300",
"os": "android",
"generic_app": false,
"img_circle":"",
"capabilities":[],
"client_uid":"",
"colour":""
}
caution

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

Como obtener un access token

Code Examples

curl --location --request POST 'https://api.trust.lat/company/api/v2/app' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{accessToken}}' \
--data-raw '{
"company_id": 1,
"name": "application_1",
"description": "application from test 1",
"bundle_id": "com.trust.application",
"flavor_id": "com.trust.application",
"img": "https: //picsum.photos/200/300",
"os": "android",
"generic_app": false,
"img_circle":"",
"capabilities":[],
"client_uid":"",
"colour":""
}'

Responses

HTTP Code: 201 Created

{
"status": true,
"message": "The app was created.",
"app": {
"id": 1,
"bundle_id": "com.trust.application_example",
"company_id": 1,
"name": "application_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://picsum.photos/200/300",
"capabilities": [],
"flavor_id": "com.trust.application",
"os": "android",
"client_uid": "",
"img_circle": "",
"generic_app": false,
"colour": ""
}
}

HTTP Code: 404 Not Found - Bundle already exists

{
"status": false,
"message": "Bundle already exists."
}

HTTP Code: 404 Not Found - Company Not Found

{
"status": false,
"message": "Company not found."
}

HTTP Code: 422 Unprocessable Entity - Without company_id

{
"status": false,
"message": "Insufficient parameters."
}