"describeServices" (JSON Action)
Return session objects that the logged-in account is authorized to view
When the
"params"property is omitted, the"describeServices"action returns information about the current session and all other sessions directly created by the account.
Links: Concepts | Tutorials | FAQs
The "describeServices" action returns session objects that the logged-in account is authorized to view. When the "params" property is omitted, it returns information about the current session and all other sessions directly created by the account.
The "params" property is an object that contains an action's request parameters as defined by a set of properties. Each action defines its own required and optional properties. See System limits for a comprehensive overview of property requirements and limitations.
"params" property summariesProperty | Description | Default | Type | Limits (inclusive) |
|---|---|---|---|---|
(optional) contains one or more authorization token strings. |
| array | At least one |
The "authTokens" property is an array that specifies which sessions the server should return in its response. At least one valid "authToken" must be specified in this property.
{
"api": "admin",
"requestId": "2",
"action": "replaceWithCorrectAction",
"params": {
"authTokens": [
"replaceWithAuthTokenFromCreateSession",
"replaceWithAuthTokenFromCreateSession"
]
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}
The "result" property is a required object set by the server that contains the result of an action.
It is a required part of the jsonAction specification standard.
Its properties vary with each action.
Properties summary
"result" property summariesProperty | Description | Type | Limits (inclusive) | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
signifies that the client is authenticated and authorized | string | 0 to 255 bytes | ||||||||
(optional) specifies the default value for the | string | One of the following: | ||||||||
defaultDatabaseName | (optional) specifies the default value of the | string | 1 to 64 bytes | |||||||
defaultOwnerName | (optional) specifies the initial value of the | string | 1 to 64 bytes | |||||||
(optional) specifies a default value for | object | One of the following:
| ||||||||
description | (optional) describes an object for later identification. | string | 0 to 65,500 bytes | |||||||
(optional) specifies the number of seconds that a session with no activity will stay open. | integer |
| ||||||||
(optional) specifies the number of seconds to keep a cursor open. | integer |
| ||||||||
specifies the account name of a user or application. | string | 1 to 64 bytes |
The "authToken" property signifies that the client is authenticated and authorized. It is required.
It is supplied by the server in response to the connect action.
Clients must include it in all subsequent requests to validate that they are authenticated and authorized. If the client does not supply the correct values, the server returns an unauthorized error.
The "defaultResponseOptions" property is a "responseOptions" object. It defines a default value for "responseOptions" that is used by default in all other action calls. It defaults to an empty object.
JSON NAV allows you to choose how your program detects errors. By default, all error properties are included in each response – unless you override this behavior as shown in the example.
The example omits the error object in all responses which makes it easier for statically typed languages, such as C, C++, Java, C#, and VB, because they prefer properties to always be present. To help these languages, the
"errorCode","errorMessage", and"errorData"properties are always present whether there is an error or not.
Example
"defaultResponseOptions": {
"binaryFormat": "hex",
"dataFormat": "objects",
"numberFormat": "number",
"variantFormat": "json"
}"variantFormat"
The "variantFormat" property tells the server how to format the values of variant fields in its response to your request.
The "numberFormat" property is an optional, case-insensitive string enum. It defines the format of JSON numbers. The default value for "numberFormat" is the "defaultNumberFormat" defined in the "createSession" or "alterSession" actions. If it is omitted there, it defaults to the value of the "defaultNumberFormat" property in the <faircom>/config/services.json file.
When "numberFormat" occurs in "mapOfPropertiesToFields", it tells the server how to encode or decode a number assigned to a JSON property.
For example, including "numberFormat" in a "tableFieldsToJson" transform step controls if the server encodes a number in a JSON property as a number or a number embedded in a string.
"number"This causes the server to return numeric values as JSON numbers, such as
-18446744073709551616.000144722494.This is most efficient.
JSON represents numbers are base-ten numbers that may have any number of digits.
Large numbers, such as
18446744073709551616.000144722494are known to cause problems with JSON parsers and some programming languages, such as JavaScript, which are limited to the smaller range and binary rounding errors of IEEE floating point numbers."string"This returns the server to embed numeric values in JSON strings, such as
"18446744073709551616.000144722494".This is slightly less efficient because it includes two extra double quote characters
Returning numbers embedded in strings ensures JSON parsers and programming languages will not automatically convert the number to a numeric representation that loses precision, introduces rounding errors, truncates values, or generates errors. This allows your application to control how numbers are processed.
Omitted or set to
nullThis defaults to
"number".
Example request
{
"action": "someAction",
"responseOptions":
{
"numberFormat": "string"
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}
The "idleConnectionTimeoutSeconds" property is an optional integer from 0 to 2147483647. It is the number of seconds that a session with no activity will stay open.
A value of 0 keeps a session open indefinitely.
The "idleCursorTimeoutSeconds" property is an optional integer from 0 to 2147483647. It is the number of seconds to keep a cursor open.
Each time a cursor retrieves records, the cursor timer restarts.
A value of
-1keeps a cursor open indefinitely.A value of
0immediately closes a cursor after the current operation.
The "username" property is a required string from 1 to 64 bytes. It is the account name of a user or application.
It is required by the
"createSession"action for authentication.All API actions are performed in the context of the account identified by
"username". For example, all tables created by an account are owned by the account. All queries use tables owned by the account.In JSON DB API and JSON Hub API, use the
"ownerName"property to cause an action to use a different account name than the value of"username". This allows an account to use tables created by another account and to create tables that are owned by another account.Unlike other property names, such as
"databaseName","username"is all lowercase.A zero-length username is invalid.
Note
See System limits for requirements of this and all other system properties.