Method for Working with WEB Resource

To work with WEB resource, execute query using the web API method (determine user token before executing the request).

To authenticate the API user, in the request send resource parameters and specify the Authorization caption:

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 authenticate the API user in the data source, in the query also specify the Web-Authorization title:

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' --header 'Web-Authorization: Basic <user token>' -d '{<request to data source>}'

If the Kerberos authentication type is selected for the data source, in the query specify the Accept title with the text/html value:

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 server name> (0.0.0.0) port 80 (#0)
> GET /api/v1/web/<resource name>/<path to resource> HTTP/1.1
> Host: <IP address or DNS server name>
> 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><response from data source></html>

See also:

Server API | Connecting Data Sources