Method for Working with WEB Resource

To work with WEB resource on a mobile device, use API request with specifying parameters (before request execution determine user token).

To authenticate the API user, the request contains resource parameters and the Authorization title is specified:

curl -v '<IP address or DNS server name>/api/v1/web/<resource name>/<path to resource>' -H 'Authorization: Bearer <user token>' --header 'Content-Type: application/json' -d '{<request to data source>}'

If it is required to execute API user authentication in the data source, the request contains resource parameters and the Web-Authorization title is specified:

curl -v '<IP address or DNS server name>/api/v1/web/<название ресурса>/<path to resource>' -H 'Authorization: Bearer <user token>' --header 'Content-Type: application/json' --header 'Web-Authorization: Basic <user token>' -d '{<request to data source>}'

If the Kerberos authentication type is selected for data source, the request contains resource parameters and the Accept title is specified:

curl -v '<IP address or DNS server name>/api/v1/web/<resource name>/<path to resource>' -H  'Authorization: Bearer <user token>' --header 'Accept: text/html' --header 'Content-Type: application/json' -d '{<request to data source>}'

The <path to resource> substitution is optional. When using the substitution take into account the following:

http://<host>/<path to resource>

http://<host>/<default path>

http://<host>

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 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>/<path to resource> 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:

Server API | Connecting Data Sources