Querying for a user

To query Edgware for the list of users connected to the bus, a JSON message of the following form is sent to the local Edgware node:

Field Value Description
op query:users Identifies a user query message.
correl <correlation-id> Client-defined correlation ID to identify the response.

The query:users message may also include the following optional fields:

Field Value Description
type <user-type> Query for a specific user type.
id <user-id> Query for a specific user ID.
affil <user-affiliation> Query for a specific user affiliation.
attr <user-attributes> Query for specific user attributes; will match any user containing these attributes exactly as specified.

If no optional fields are specified then the full list of registered user will be returned. Each optional field can contain a wildcard character (“*”) matching any string. Wildcards can be used alone or with partial text. Omiting an optional field is equivalent to giving it the value “*”.

Matching users are returned in a JSON message of the form:

Field Nested Field Value Description
op query-result:users Identifies a user query result.
correl <correlation-id> Client-defined correlation ID to identify the response.
For each matching node the following information will be returned:
users Identifies the list of users.
id <user-id> The ID of user.
type <user-type> The type of the user.
affil <user-affiliation> The organisational affiliation of the user.
desc <user-description> The free text description of the user.
attr <user-attributes> The set of attributes associated with the user.

Example

A query of the form:

{
	"op" : "query:users",
	"correl" : "<correlation-id>",
}

Will generate a response in the form:

{
	"op" : "query-result:users",
	"correl" : "<correlation-id>",
	"users" : [
		{
			"id" : "<user-id>",
			"type" "<user-type>",
			"affil" "<user-affiliation>",
			"desc" : "<user-description>",
			"attr" : "<user-attributes>"
		}
	]
}