Texpress
Each Texpress table is available as a resource in the emurestapi shim. The Texpress table name is used as the resource name when making REST API requests. The full range of CRUD operations can be performed along with data retrieval. All EMu Registry permissions are applied to a resource before it is accessed. For example if there was a security entry in the registry restricting access to a subset of a table’s records then the records will not be available through the shim. Also if column access permissions do not allow a column to be updated then the column cannot be updated through the shim.
In this section we will examine, with examples, the supported REST API requests for manipulating Texpress tables. As stated the Texpress table name becomes the resource name for requests. Hence to access the EMu Parties module the resource name eparties would be used.
Each of the requests detailed here requires a Bearer Token to be submitted with it to authenticate the request. See the Tokens creation section for details on how to generate a token.
Insert (no key)
POST /{tenant}/{resource}
The POST verb creates a new record in a Texpress table where the server assigns the IRN. The {tenant} and {resource} values identify the EMu environment and the table into which the record is to be inserted respectively. The payload of the request is the record to insert in JSON format. The record insertion follows the same process as inserting a record via the EMu client. If the insertion is successful then the inserted record, in JSON format, is returned along with a 201
status The record includes the assigned IRN and any calculated values. If an error occurs then an error status (4xx
) along with a Mason marked up JSON based error message is returned.
Example URI
POST /museum/eparties
Headers
Content-Type: application/json
Authorization: Bearer {token}
Prefer: representation=minimal
Body
{
"NamFirst": "Fred",
"NamLast": "Flinstone",
"NamOrganisation": "Bedrock Quarry"
}
Response 201
{
"id": "emu:/museum/eparties/752",
"version": 1,
"data": {
"AdmPublishWebNoPasswordFlag": "N",
"NamBriefName": "F. Flinstone",
"ExtendedData": "752\nFlinstone, Fred - Bedrock Quarry",
"SummaryData": "Flinstone, Fred - Bedrock Quarry",
"SecCanDisplay_tab": [
"Group Default"
],
"SecCanEdit_tab": [
"Group Default"
],
"AdmPublishWebPasswordFlag": "N",
"NamOrganisation": "Bedrock Quarry",
"AdmPublishWebPassword": "No",
"NamAutomatic": "Yes",
"NamFirst": "Fred",
"AdmWebMetadata": "Fred Flinstone Bedrock Quarry",
"irn": {
"id": "emu:/museum/eparties/752",
"@controls": {
"self": {
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/752"
}
}
},
"NamTaxonomicName": "Flinstone",
"AdmTimeModified": "14:16:16",
"NamCitedName": "Flinstone, Fred",
"SecCanDelete_tab": [
"Group Default"
],
"AdmDateModified": "2021-04-23",
"NamPartyType": "Person",
"AdmInsertedBy": "KE EMu Administrator",
"NamFullName": "Fred Flinstone",
"NamSalutation": "Fred",
"AdmModifiedBy": "KE EMu Administrator",
"NamLast": "Flinstone",
"AdmTimeInserted": "14:16:16",
"NamSex": "Unknown",
"AdmPublishWebNoPassword": "No",
"AdmDateInserted": "2021-04-23"
},
"@namespaces": {
"emu": {
"name": "http://axiell.com/emu#"
}
},
"@controls": {
"self": {
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/752"
},
"start": {
"method": "GET",
"href": "http://swanston.melbourne.axiell.com:8084/"
},
"emu:create": {
"method": "POST",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties",
"isHrefTemplate": true,
"encoding": "json",
"schemaUrl": "http://swanston.melbourne.axiell.com:8084/museum/resources/eparties"
},
"emu:insert": {
"method": "PUT",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/{identifier}",
"isHrefTemplate": true,
"encoding": "json",
"schemaUrl": "http://swanston.melbourne.axiell.com:8084/museum/resources/eparties"
},
"emu:replace": {
"method": "PUT",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/752",
"encoding": "json",
"schemaUrl": "http://swanston.melbourne.axiell.com:8084/museum/resources/eparties"
},
"search": {
"method": "GET",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties",
"isHrefTemplate": true,
"schema": {
"properties": {
"filter": {
"type": "string"
},
"limit": {
"type": "integer"
},
"select": {
"type": "string"
},
"sort": {
"type": "string"
}
}
}
},
"emu:update": {
"method": "PATCH",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/752",
"encoding": "json",
"schemaUrl": "http://json.schemastore.org/json-patch"
},
"emu:delete": {
"method": "DELETE",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/752"
}
}
}
Response Headers
Content-Type: application/vnd.mason+json; charset=UTF-8
Location: http://swanston.melbourne.axiell.com:8084/museum/eparties/752
Authorization: Bearer {token}
The URL used to access the new record can be found in the Location: header. The Bearer token is also returned so the client does not have to maintain its own copy.
Insert/Replace
PUT /{tenant}/{resource}/{id}
The PUT method inserts a new record or replaces an existing record. The request contains the {id} (or in the case of EMu tables, the irn) of the record to be inserted/replaced. If a record with the supplied {id} exists then it is replaced otherwise a new record is created. The creation process is exactly the same as a POST /{tenant}/{resource} request except the irn is set to the {id} value. The replacement of an existing record is logically the same as deleting the existing record followed by the insertion of a new record with the supplied {id}. If a new record is created a 201
status is returned, whereas a record replacement will return a 200
status value.
Example URI
PUT /museum/eparties/812
Headers
Content-Type: application/json
Authorization: Bearer {token}
Prefer: representation=minimal
Body
{
"NamFirst": "Boris",
"NamLast": "Badenov",
"NamOrganisation": "Fearless Leader"
}
Response 201
{
"id": "emu:/museum/eparties/812",
"version": 1,
"data": {
"AdmPublishWebNoPasswordFlag": "N",
"NamBriefName": "B. Badenov",
"ExtendedData": "812\nBadenov, Boris - Fearless Leader",
"SummaryData": "Badenov, Boris - Fearless Leader",
"SecCanDisplay_tab": [
"Group Default"
],
"SecCanEdit_tab": [
"Group Default"
],
"AdmPublishWebPasswordFlag": "N",
"NamOrganisation": "Fearless Leader",
"AdmPublishWebPassword": "No",
"NamAutomatic": "Yes",
"NamFirst": "Boris",
"AdmWebMetadata": "Boris Badenov Fearless Leader",
"irn": {
"id": "emu:/museum/eparties/812",
"@controls": {
"self": {
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/812"
}
}
},
"NamTaxonomicName": "Badenov",
"AdmTimeModified": "11:11:45",
"NamCitedName": "Badenov, Boris",
"SecCanDelete_tab": [
"Group Default"
],
"AdmDateModified": "2021-04-26",
"NamPartyType": "Person",
"AdmInsertedBy": "KE EMu Administrator",
"NamFullName": "Boris Badenov",
"NamSalutation": "Boris",
"AdmModifiedBy": "KE EMu Administrator",
"NamLast": "Badenov",
"AdmTimeInserted": "11:11:45",
"NamSex": "Unknown",
"AdmPublishWebNoPassword": "No",
"AdmDateInserted": "2021-04-26"
},
"@namespaces": {
"emu": {
"name": "http://axiell.com/emu#"
}
},
"@controls": {
"self": {
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/812"
},
"start": {
"method": "GET",
"href": "http://swanston.melbourne.axiell.com:8084/"
},
"emu:create": {
"method": "POST",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties",
"isHrefTemplate": true,
"encoding": "json",
"schemaUrl": "http://swanston.melbourne.axiell.com:8084/museum/resources/eparties"
},
"emu:insert": {
"method": "PUT",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/{identifier}",
"isHrefTemplate": true,
"encoding": "json",
"schemaUrl": "http://swanston.melbourne.axiell.com:8084/museum/resources/eparties"
},
"emu:replace": {
"method": "PUT",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/812",
"encoding": "json",
"schemaUrl": "http://swanston.melbourne.axiell.com:8084/museum/resources/eparties"
},
"search": {
"method": "GET",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties",
"isHrefTemplate": true,
"schema": {
"properties": {
"filter": {
"type": "string"
},
"limit": {
"type": "integer"
},
"select": {
"type": "string"
},
"sort": {
"type": "string"
}
}
}
},
"emu:update": {
"method": "PATCH",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/812",
"encoding": "json",
"schemaUrl": "http://json.schemastore.org/json-patch"
},
"emu:delete": {
"method": "DELETE",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/812"
}
}
}
Response Headers
Content-Type: application/vnd.mason+json; charset=UTF-8
Authorization: Bearer {token}
Since the request contains the URL required to access the record, along with the returned Mason marked up record, there is no Location: header sent in the response headers.
Edit
PATCH /{tenant}/{resource}/{id}
The PATCH method modifies values within an existing record. The payload for a PATCH request consists of a series of commands to be applied to the record specified in the URL. The commands conform to the JSON Patch standard (RFC 6902). Each command is applied sequentially to the record resulting in the final version which then replaces the existing record. The Patch Syntax section documents the available commands. If the patch is applied successfully then a 200
status is returned along with the patched record as the payload.
Example URI
PATCH /museum/eparties/812
Headers
Content-Type: application/json
Authorization: Bearer {token}
Prefer: representation=minimal
Body
[
{ "op": "replace", "path": "/NamOrganisation", "value": "Mr Big" },
{ "op": "add", "path": "/NamOtherNames_tab", "value": ["Bad Guy"] },
{ "op": "add", "path": "/AddPhysCountry", "value": "Pottsylvania" }
]
Response 200
{
"id": "emu:/museum/eparties/812",
"version": 1,
"data": {
"AdmPublishWebNoPasswordFlag": "N",
"NamBriefName": "B. Badenov",
"ExtendedData": "812\nBadenov, Boris - Mr Big",
"SummaryData": "Badenov, Boris - Mr Big",
"SecCanDisplay_tab": [
"Group Default"
],
"SecCanEdit_tab": [
"Group Default"
],
"AdmPublishWebPasswordFlag": "N",
"NamOrganisation": "Mr Big",
"NamOtherNames_tab": [
"Bad Guy"
],
"AdmPublishWebPassword": "No",
"NamAutomatic": "Yes",
"NamFirst": "Boris",
"AdmWebMetadata": "Boris Badenov Mr Big Bad Guy Pottsylvania",
"irn": {
"id": "emu:/museum/eparties/812",
"@controls": {
"self": {
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/812"
}
}
},
"NamTaxonomicName": "Badenov",
"AdmTimeModified": "17:20:22",
"NamCitedName": "Badenov, Boris",
"SecCanDelete_tab": [
"Group Default"
],
"AdmDateModified": "2021-04-26",
"NamPartyType": "Person",
"AdmInsertedBy": "KE EMu Administrator",
"NamFullName": "Boris Badenov",
"NamSalutation": "Boris",
"AddPhysCountry": "Pottsylvania",
"AdmModifiedBy": "KE EMu Administrator",
"NamLast": "Badenov",
"AdmTimeInserted": "11:11:45",
"NamSex": "Unknown",
"AdmPublishWebNoPassword": "No",
"AdmDateInserted": "2021-04-26"
},
"@namespaces": {
"emu": {
"name": "http://axiell.com/emu#"
}
},
"@controls": {
"self": {
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/812"
},
"start": {
"method": "GET",
"href": "http://swanston.melbourne.axiell.com:8084/"
},
"emu:create": {
"method": "POST",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties",
"isHrefTemplate": true,
"encoding": "json",
"schemaUrl": "http://swanston.melbourne.axiell.com:8084/museum/resources/eparties"
},
"emu:insert": {
"method": "PUT",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/{identifier}",
"isHrefTemplate": true,
"encoding": "json",
"schemaUrl": "http://swanston.melbourne.axiell.com:8084/museum/resources/eparties"
},
"emu:replace": {
"method": "PUT",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/812",
"encoding": "json",
"schemaUrl": "http://swanston.melbourne.axiell.com:8084/museum/resources/eparties"
},
"search": {
"method": "GET",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties",
"isHrefTemplate": true,
"schema": {
"properties": {
"filter": {
"type": "string"
},
"limit": {
"type": "integer"
},
"select": {
"type": "string"
},
"sort": {
"type": "string"
}
}
}
},
"emu:update": {
"method": "PATCH",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/812",
"encoding": "json",
"schemaUrl": "http://json.schemastore.org/json-patch"
},
"emu:delete": {
"method": "DELETE",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/812"
}
}
}
Response Headers
Content-Type: application/vnd.mason+json; charset=UTF-8
Authorization: Bearer {token}
Delete
DELETE /{tenant}/{resource}/{id}
The DELETE verb deletes a single record. The record to delete is supplied in the URL. The {id} value is the IRN used to identify which record to remove. When a record is deleted it is permanently removed from the specified {resource} in the given {tenant}. If the deletion is successful then a 200
status along with the deleted record as the payload is returned. The request does not have a payload.
Example URI
DELETE /musuem/eparties/812
Headers
Authorization: Bearer {token}
Prefer: representation=minimal
Response 200
{
"id": "emu:/museum/eparties/812",
"version": 1,
"data": {
"AdmPublishWebNoPasswordFlag": "N",
"NamBriefName": "B. Badenov",
"ExtendedData": "812\nBadenov, Boris - Mr Big",
"SummaryData": "Badenov, Boris - Mr Big",
"SecCanDisplay_tab": [
"Group Default"
],
"SecCanEdit_tab": [
"Group Default"
],
"AdmPublishWebPasswordFlag": "N",
"NamOrganisation": "Mr Big",
"NamOtherNames_tab": [
"Bad Guy"
],
"AdmPublishWebPassword": "No",
"NamAutomatic": "Yes",
"NamFirst": "Boris",
"AdmWebMetadata": "Boris Badenov Mr Big Bad Guy Pottsylvania",
"irn": {
"id": "emu:/museum/eparties/812",
"@controls": {
"self": {
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/812"
}
}
},
"NamTaxonomicName": "Badenov",
"AdmTimeModified": "18:07:24",
"NamCitedName": "Badenov, Boris",
"SecCanDelete_tab": [
"Group Default"
],
"AdmDateModified": "2021-04-26",
"NamPartyType": "Person",
"AdmInsertedBy": "KE EMu Administrator",
"NamFullName": "Boris Badenov",
"NamSalutation": "Boris",
"AddPhysCountry": "Pottsylvania",
"AdmModifiedBy": "KE EMu Administrator",
"NamLast": "Badenov",
"AdmTimeInserted": "18:07:16",
"NamSex": "Unknown",
"AdmPublishWebNoPassword": "No",
"AdmDateInserted": "2021-04-26"
},
"@namespaces": {
"emu": {
"name": "http://axiell.com/emu#"
}
},
"@controls": {
"self": {
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/812"
},
"start": {
"method": "GET",
"href": "http://swanston.melbourne.axiell.com:8084/"
},
"emu:create": {
"method": "POST",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties",
"isHrefTemplate": true,
"encoding": "json",
"schemaUrl": "http://swanston.melbourne.axiell.com:8084/museum/resources/eparties"
},
"emu:insert": {
"method": "PUT",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/{identifier}",
"isHrefTemplate": true,
"encoding": "json",
"schemaUrl": "http://swanston.melbourne.axiell.com:8084/museum/resources/eparties"
},
"search": {
"method": "GET",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties",
"isHrefTemplate": true,
"schema": {
"properties": {
"filter": {
"type": "string"
},
"limit": {
"type": "integer"
},
"select": {
"type": "string"
},
"sort": {
"type": "string"
}
}
}
}
}
}
Response Headers
Content-Type: application/vnd.mason+json; charset=UTF-8
Authorization: Bearer {token}
Retrieve
GET /{tenant}/{resource}/{id}[?select={selectlist}]
The GET verb with a URL identifying a single record retrieves that record. The Mason markup identifies the operations possible on the record along with generic operations like insertion, etc. There is no payload to send when retrieving a record. A 200
status is returned when the record is retrieved successfully.
By default all values in the record are returned. You can limit the values returned using the select query parameter. The parameter takes a comma separated list of field names. The field names are that of the enveloped record so most field names will start with data.. The Select Syntax section provides a complete description of acceptable values for the select query parameter.
Example URI
GET /museum/eparties/812?select=id,data.NamFirst,data.NamLast
Headers
Authorization: Bearer {token}
Prefer: representation=minimal
Response 200
{
"id": "emu:/museum/eparties/812",
"version": 1,
"data": {
"irn": {
"id": "emu:/museum/eparties/812",
"@controls": {
"self": {
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/812"
}
}
},
"NamFirst": "Boris",
"NamLast": "Badenov"
},
"@namespaces": {
"emu": {
"name": "http://axiell.com/emu#"
}
},
"@controls": {
"self": {
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/812"
},
"start": {
"method": "GET",
"href": "http://swanston.melbourne.axiell.com:8084/"
},
"emu:create": {
"method": "POST",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties",
"isHrefTemplate": true,
"encoding": "json",
"schemaUrl": "http://swanston.melbourne.axiell.com:8084/museum/resources/eparties"
},
"emu:insert": {
"method": "PUT",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/{identifier}",
"isHrefTemplate": true,
"encoding": "json",
"schemaUrl": "http://swanston.melbourne.axiell.com:8084/museum/resources/eparties"
},
"emu:replace": {
"method": "PUT",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/812",
"encoding": "json",
"schemaUrl": "http://swanston.melbourne.axiell.com:8084/museum/resources/eparties"
},
"search": {
"method": "GET",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties",
"isHrefTemplate": true,
"schema": {
"properties": {
"filter": {
"type": "string"
},
"limit": {
"type": "integer"
},
"select": {
"type": "string"
},
"sort": {
"type": "string"
}
}
}
},
"emu:update": {
"method": "PATCH",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/812",
"encoding": "json",
"schemaUrl": "http://json.schemastore.org/json-patch"
},
"emu:delete": {
"method": "DELETE",
"href": "http://swanston.melbourne.axiell.com:8084/museum/eparties/812"
}
}
}
Response Headers
Content-Type: application/vnd.mason+json; charset=UTF-8
Authorization: Bearer {token}
Search
GET /{tenant}/{resource}[?select={selectlist}&sort={sortlist}&filter={query}&limit={limit}&cursorType=[server|file]]
The GET method without an {id} searches a resource for matching records. There are a series of optional query parameters that determine what records, in what order and how many are returned. The acceptable query parameters are:
select={selectlist}
By default all values in the record are returned. You can limit the values returned using the select query parameter. The parameter takes a comma separated list of field names. The field names are that of the enveloped record so most field names will start with data.. The Select Syntax section provides a complete description of acceptable values for the select query parameter.
sort={sortlist}
The sort query parameter may be used to have records returned based on the contents of field(s) in the matching records. Support is provided for single and multi-level sorts. The sortlist is a JSON array defining the field to use for sorting and whether ascending or descending order should be used. As with the select parameter, field names are defined based on the envelope wrapping a record. An example sortlist where the sort is on NamLast in ascending order and then NamFirst in descending order is:
[
{ "data.NamFirst": { "order": "asc" } },
{ "data.NamLast": { "order": "desc" } }
]
Since the JSON is included in the URL it must be URL encoded. The above JSON array once encoded and with white space removed would look like:
sort=%5B%7B%22data.NamFirst%22%3A%7B%22order%22%3A%22asc%22%7D%7D%2C%7B%22data.NamLast%22%3A%7B%22order%22%3A%22desc%22%7D%7D%5D
The Sort Syntax section provides a complete description of acceptable values for the sort query parameter.
filter={query}
The filter query parameter allows a JSON based query to be specified to restrict the set of records returned. The JSON based query language is quite expressive providing a concise way of specifying conditions for matching records. To find all records where NamLast is Smith or Jones the following query could be used:
{
"OR": [
{ "data.NamLast": { "contains": { "value": "Smith" } } },
{ "data.NamLast": { "contains": { "value": "Jones" } } }
]
}
As with the sort query property the filter query must be URL encoded. The Query Syntax section describes the JSON query language in detail.
limit={limit}
The limit query parameter defines the maximum number of records to return when the search is performed. The {limit} value is a number greater than or equal to zero. If a limit is specified and the number of matching records exceeds the {limit} value then a Next-Search
header is included in the response. The Next-Search
header can be used to implement paging of results. See the Paging section for more details.
cursorType=[server|file]
The cursorType query parameter determines the algorithm to use when paging results, that is when the limit query parameter is set. A value of server indicates a server side Texpress cursor should be used to hold all matching records. When paging request arrive the cursor position is advanced as each matching record is returned. Once all records are returned the cursor is closed and its resources released. There is a timeout on the Texpress cursor to ensure resources are released when all matching records have not been returned. A typical timeout value is 15 minutes. The actual value is defined by the serverCursorTimeout server configuration setting.
A value of file creates a file on the server containing the keys of each matching record. Once all the matching keys have been saved the Texpress cursor is closed releasing its resources. Subsequent requests read the file retrieving each key and returning the record associated with that key. The file is removed once all the matching records have been requested. File based cursors also timeout after some time (so the files are cleaned up). The timeout is typically measured in hours with the default value being 4. The default value is defined by the fileCursorTimeout server configuration setting.
A status value of 200
is returned for successful searches, even if no records are returned.
The inclusion of the various query parameters, especially the filter parameter may exceed the acceptable length or a URL. A generally accepted limit on URL lengths is about 2000 bytes. Such a limit causes issues when a complex query is required. To solve this issue the shim implements the HTTP Method Override extension. See the HTTP Method Override appendix for details.
Example URI
GET /museum/eparties?query=%7B%22OR%22%3A%5B%7B%22data.NamLast%22%3A%7B%22contains%22%3A%7B%22value%22%3A%22Smith%22%20%7D%7D%7D%2C%7B%22data.NamLast%22%3A%7B%22contains%22%3A%7B%22value%22%3A%22Jones%22%7D%7D%5D%7D%0A&limit=10&select=id,data.NamFirst,data.NamLast&cursorType=server
Headers
Authorization: Bearer {token}
Prefer: representation=minimal
Response 200
{
"@namespaces": {
"emu": {
"name": "http://axiell.com/emu#"
}
},
"@controls": {
"self": {
"href": "http://dorrit.melbourne.axiell.com:8084/museum/eparties"
},
"start": {
"method": "GET",
"href": "http://dorrit.melbourne.axiell.com:8084/"
},
"emu:create": {
"method": "POST",
"href": "http://dorrit.melbourne.axiell.com:8084/museum/eparties",
"isHrefTemplate": true,
"encoding": "json",
"schemaUrl": "http://dorrit.melbourne.axiell.com:8084/museum/resources/eparties"
},
"emu:insert": {
"method": "PUT",
"href": "http://dorrit.melbourne.axiell.com:8084/museum/eparties/%7Bidentifier%7D",
"isHrefTemplate": true,
"encoding": "json",
"schemaUrl": "http://dorrit.melbourne.axiell.com:8084/museum/resources/eparties"
},
"search": {
"method": "GET",
"href": "http://dorrit.melbourne.axiell.com:8084/museum/eparties",
"isHrefTemplate": true,
"schema": {
"properties": {
"filter": {
"type": "string"
},
"select": {
"type": "string"
},
"sort": {
"type": "string"
}
}
}
}
},
"hits": 10734,
"matches": [
{
"id": "emu:/museum/eparties/718",
"version": 1,
"data": {
"irn": {
"id": "emu:/museum/eparties/718",
"@controls": {
"self": {
"href": "http://dorrit.melbourne.axiell.com:8084/museum/eparties/718"
}
}
},
"NamFirst": "Christine",
"NamLast": "Mekhael"
},
"@controls": {
"self": {
"href": "http://dorrit.melbourne.axiell.com:8084/museum/eparties/718"
}
}
},
{
"id": "emu:/museum/eparties/102476",
"version": 1,
"data": {
"irn": {
"id": "emu:/museum/eparties/102476",
"@controls": {
"self": {
"href": "http://dorrit.melbourne.axiell.com:8084/museum/eparties/102476"
}
}
},
"NamFirst": "Bill",
"NamLast": "GOODWIN"
},
"@controls": {
"self": {
"href": "http://dorrit.melbourne.axiell.com:8084/museum/eparties/102476"
}
}
},
{
"id": "emu:/museum/eparties/103139",
"version": 1,
"data": {
"irn": {
"id": "emu:/museum/eparties/103139",
"@controls": {
"self": {
"href": "http://dorrit.melbourne.axiell.com:8084/museum/eparties/103139"
}
}
},
"NamFirst": "Kenneth",
"NamLast": "LAIRD"
},
"@controls": {
"self": {
"href": "http://dorrit.melbourne.axiell.com:8084/museum/eparties/103139"
}
}
},
{
"id": "emu:/museum/eparties/103178",
"version": 1,
"data": {
"irn": {
"id": "emu:/museum/eparties/103178",
"@controls": {
"self": {
"href": "http://dorrit.melbourne.axiell.com:8084/museum/eparties/103178"
}
}
},
"NamFirst": "Ray",
"NamLast": "LAWLER"
},
"@controls": {
"self": {
"href": "http://dorrit.melbourne.axiell.com:8084/museum/eparties/103178"
}
}
},
{
"id": "emu:/museum/eparties/721",
"version": 1,
"data": {
"irn": {
"id": "emu:/museum/eparties/721",
"@controls": {
"self": {
"href": "http://dorrit.melbourne.axiell.com:8084/museum/eparties/721"
}
}
}
},
"@controls": {
"self": {
"href": "http://dorrit.melbourne.axiell.com:8084/museum/eparties/721"
}
}
},
{
"id": "emu:/museum/eparties/103722",
"version": 1,
"data": {
"irn": {
"id": "emu:/museum/eparties/103722",
"@controls": {
"self": {
"href": "http://dorrit.melbourne.axiell.com:8084/museum/eparties/103722"
}
}
},
"NamFirst": "Robyn",
"NamLast": "NEVIN"
},
"@controls": {
"self": {
"href": "http://dorrit.melbourne.axiell.com:8084/museum/eparties/103722"
}
}
},
{
"id": "emu:/museum/eparties/104189",
"version": 1,
"data": {
"irn": {
"id": "emu:/museum/eparties/104189",
"@controls": {
"self": {
"href": "http://dorrit.melbourne.axiell.com:8084/museum/eparties/104189"
}
}
},
"NamFirst": "Nancy",
"NamLast": "RONALDS"
},
"@controls": {
"self": {
"href": "http://dorrit.melbourne.axiell.com:8084/museum/eparties/104189"
}
}
},
{
"id": "emu:/museum/eparties/104580",
"version": 1,
"data": {
"irn": {
"id": "emu:/museum/eparties/104580",
"@controls": {
"self": {
"href": "http://dorrit.melbourne.axiell.com:8084/museum/eparties/104580"
}
}
},
"NamFirst": "Joan",
"NamLast": "SUTHERLAND"
},
"@controls": {
"self": {
"href": "http://dorrit.melbourne.axiell.com:8084/museum/eparties/104580"
}
}
},
{
"id": "emu:/museum/eparties/104786",
"version": 1,
"data": {
"irn": {
"id": "emu:/museum/eparties/104786",
"@controls": {
"self": {
"href": "http://dorrit.melbourne.axiell.com:8084/museum/eparties/104786"
}
}
},
"NamFirst": "Tony",
"NamLast": "TRIPP"
},
"@controls": {
"self": {
"href": "http://dorrit.melbourne.axiell.com:8084/museum/eparties/104786"
}
}
},
{
"id": "emu:/museum/eparties/104851",
"version": 1,
"data": {
"irn": {
"id": "emu:/museum/eparties/104851",
"@controls": {
"self": {
"href": "http://dorrit.melbourne.axiell.com:8084/museum/eparties/104851"
}
}
},
"NamFirst": "Giuseppe",
"NamLast": "VERDI"
},
"@controls": {
"self": {
"href": "http://dorrit.melbourne.axiell.com:8084/museum/eparties/104851"
}
}
}
]
}
Response Headers
Next-Search: server:0:11
Content-Type: application/vnd.mason+json; charset=UTF-8
Authorization: Bearer {token}
Paging
If a search is performed and a limit query parameter is specified and there are matching records then a Next-Search
header is included in the response. The header contains the location of the next record to be retrieved for a subsequent fetch request. The format of the Next-Search
value depends on the type of cursorType used for the search. For a server based cursor the format is:
server:{cursor}:{offset}
where {cursor} is the internal Texpress cursor number containing the matching set of records. The {offset} value is a one based number identifying the record number of the next record to retrieve. Hence an offset of 2 indicates the next record to retrieve is the second match. An offset of zero indicates the end of the matching set of records.
The format for a file based cursor is:
file:{file}:{offset}
where {file} is the name of a temporary file on the server containing the keys of the matching records. The {offset} value has the same meaning as for the server format.
To retrieve a page of matching records the Next-Search
header must be included in the request. The format of the request is:
GET /{tenant}/{resource}[?select={selectlist}&limit={limit}]
where select and limit are as defined earlier. A request of:
GET /museum/eparties?limit=5
including the header:
Next-Search: server:0:11
Authorization: Bearer {token}
Prefer: representation=minimal
will return the next five matching records starting at record number eleven. A Next-Offsets
header is included whenever a limit query parameter is specified in a request. The header contains the Next-Search
value for each record returned. In other words it returns the value to use for the Next-Search
header for each matching record allowing records from that point on to be retrieved. The value is a JSON array of strings where the index of each string corresponds to the index of the matching record. A sample header returned for a server based search where the limit was set to five matches is:
["server:0:2","server:0:3","server:0:4","server:0:5","server:0:6"]
The first entry is the Next-Search
value for the first record, the second entry for the second record and so on. It is possible to implement random access to the matching records using the Next-Offsets
values and the Next-Search
header. By reading the values in the Next-Offsets
array and using them in the Next-Search
header the starting offset can be defined. The limit query parameter can be used to determine how many matches are returned.
The Texpress cursor associated with a server cursor search is closed when the last record is retrieved. Any use of the cursor after the last record is read will result in an error. The Texpress cursor is also closed when it has not been accessed for a period of minutes, as defined by the serverCursorTimeout configuration setting.
A file cursor is closed when the last record has been retrieved. If the cursor has not been fully read and not accessed for fileCursorTimeout hours then it is also closed and the file removed.