To work with WEB resource on a mobile device, use API request with specifying parameters (before request execution determine user token).
The request contains resource parameters, and the Authorization title is specified for API user authentication, and if required, the Web-Authorization title is specified for authentication in data source:
curl -v '<IP address or DNS server name>/api/v1/web/<resource name>/<path to resource>/' -H "Authorization: Bearer <user token>" "Web-Authorization: Basic <user token>" -H "Content-Type: application/json" -d "{<request to data source>}"
NOTE. If resource GET parameters are set in the mobile client request and via administrator console, only the specified GET parameters are used in the mobile client request.
The <path to resource> substitution is optional. When using the substitution take into account the following:
If the path to resource is specified in the substitution, the following request is sent to the WEB data source:
http://<host>/<path to resource>/
If the path to resource is not specified in the substitution, the request with the use of the specified default path is sent to the WEB data source:
http://<host>/<default path>/
If the path to resource and the default path are not specified in the substitution, the following request is sent to the WEB data source:
http://<host>/
The example in the JSON format:
Trying 0.0.0.0...
TCP_NODELAY set
Connected to <IP address or DNS name of server> (0.0.0.0) port 80 (#0)
> GET /api/v1/web/<resource name>/HTTP/1.1
> Host: <IP address or DNS name of server>
> User-Agent: curl/7.55.1
> Content-Type: application/json
> Authorization: Bearer <user token>
> Accept: text/plain
>
< HTTP/1.1 200 OK
< Server: nginx/1.9.11
< Date: <date>
< Content-Type: *.*; charset=utf-8
< Content-Length: 139685
< Connection: keep-alive
< Cache-Control: no-cache,no-store,max-age=0,must-revalidate
< Expires: <date>
< Last-Modified: <date>
< X-Frame-Options: DENY
< X-Content-Type-Options: nosniff
< Allow: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, TRACE
< Vary: Origin, Cookie, Accept-Encoding
<
<!DOCTYPE html>)<data source response></html>
See also: