-
Notifications
You must be signed in to change notification settings - Fork 1
Describing Functions
Here we suppose that you use REST API included in the portal module, so all requests have the URL starting with {host:port}/app-portal/api. If you use REST API in web module, the URL should start with {host:port}/app/dispatch/api.
All functions require an authenticated user session, which means that you must perform the login first and then pass the resulting session identifier to subsequent requests.
Login can be performed by either GET or POST request.
For GET request, create the URL {host:port}/app-portal/api/login with the following parameters:
- u - user login
- p - user password
- l - user locale (optional)
For example:
http://localhost:8080/app-portal/api/login?u=admin&p=admin&l=ru
To perform login using POST, execute request by {host:port}/app-portal/api/login address, passing JSON (Content-Type header has the value application/json) or form (Content-Type header has the value application/x-www-form-urlencoded) in request body.
Example of the JSON format:
{
"username" : "admin",
"password" : "admin",
"locale" : "en"
}Example of the form:
username: admin
password: admin
locale: en
The service will return userSessionId in response body and status 200 or status 401 if the authentication fails.
To login through REST API, the user must have cuba.restApi.enabled specific permission. Notice that the user will have the permission if there are no roles explicitly revoking it.