Advisor
This section shows how to manage users and incorporate Advisor queries into your platform
User management
1 - Creating users
NOTE: All calls to users management are made through the API https://corewebapi.asisprojetos.com.br
POST /api/v1/usuario
Headers:
- app-key: App key
- account-key: Account key
Request:
curl -X POST "https://corewebapi.asisprojetos.com.br/api/v1/usuario" \ -H 'Content-Type: application/json' \ -H 'app-key: 6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb' \ -H 'account-key: b601b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52dcd' \ -d '{ "nome": "string", "email": "string", "cargo": "string" }'
Response:
- HTTP Status 400: Invalid email address
- HTTP Status 200 and user information in JSON format. Example:
{ "id": "integer", "nome": "string", "email": "string", "cargo": "string", "uuid": "string" }
2 - Updating users
PUT /api/v1/usuario
Headers:
- app-key: App key
- account-key: Account key
Request:
curl -X PUT "https://corewebapi.asisprojetos.com.br/api/v1/usuario" \ -H 'Content-Type: application/json' \ -H 'app-key: 6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb' \ -H 'account-key: b601b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52dcd' \ -d '{ "id": "integer", "nome": "string", "email": "string", "cargo": "string" }'
Response:
- HTTP Status 400: Invalid email address
- HTTP Status 200 and updated user information in JSON format. Example:
{ "id": "integer", "nome": "string", "email": "string", "cargo": "string" }
3 - Listing users
GET /api/v1/usuario
Headers:
- app-key: App key
- account-key: Account key
Request:
curl -X GET "https://corewebapi.asisprojetos.com.br/api/v1/usuario" \ -H 'app-key: 6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb' \ -H 'account-key: b601b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52dcd'
Response:
- List of account users in JSON format. Example:
{ "content": [ { "id": "integer", "nome": "string", "email": "string", "cargo": "string" }, { "id": "integer", "nome": "string", "email": "string", "cargo": "string" } ], "pageable": { "sort": { "sorted": "boolean", "unsorted": "boolean", "empty": "boolean" }, "pageSize": "integer", "pageNumber": "integer", "offset": "integer", "paged": "boolean", "unpaged": "boolean" }, "totalPages": "integer", "totalElements": "integer", "last": "boolean", "first": "boolean", "sort": { "sorted": "boolean", "unsorted": "boolean", "empty": "boolean" }, "number": "integer", "numberOfElements": "integer", "size": "integer", "empty": "boolean" }
4 - Querying users by ID
GET /api/v1/usuario/{id}
Parameters:
- id*: User ID
Headers:
- app-key: App key
- account-key: Account key
Request:
curl -X GET "https://corewebapi.asisprojetos.com.br/api/v1/usuario/1" \ -H 'app-key: 6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb' \ -H 'account-key: b601b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52dcd'
Response:
- User information in JSON format. Example:
{ "id": "integer", "nome": "string", "email": "string", "cargo": "string" }
5 - Deleting users
DELETE /api/v1/usuario/{id}
Parameters:
- id*: User ID
Headers:
- app-key: App key
- account-key: Account key
Request:
curl -X DELETE "https://corewebapi.asisprojetos.com.br/api/v1/usuario/1" \ -H 'app-key: 6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb' \ -H 'account-key: b601b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52dcd'
Response:
- HTTP Status 200: Ok
- HTTP Status 404: User not found
Advisor Connection
Add the following iframe to your HTML page and replace the ${token} variable with the user's uuid
<iframe src="https://kolossus.asisprojetos.com.br/advisor/embedded?token=${token}"></iframe>