Skip to content
logoBack to home screen

Legacy REST Query

Query REST calls allow you to build your own query statements, using Generic Model Query Language (GMQL).

This is the documentation for the old REST API endpoint. For the documentation for the latest REST endpoint, see REST v2 Introduction.

Available Calls

NameSyntaxMethodsParameters
Query.../rest/queryGET, OPTIONSsessionId, accessId, statement
Assembly Query.../rest/assembly-queryGET, POST, PUT, OPTIONSsessionId, accessId, body
Assembly Stream Query.../rest/assembly-stream-queryPOST, PUT, OPTIONSsessionId, accessId

For examples of query calls, see Legacy REST query examples.

Encoding over HTTP

When using a REST call over HTTP, you must ensure the call whitespace and other special characters are encoded properly. Most browsers, for example, do this automatically for you, but this is not guaranteed.

Passing Numbers

There is also a special format for passing numbers using REST calls. For example, most ID properties are of the type long, meaning that id = 5 is interpreted as an integer with the value of 5. This causes type exceptions in some cases.

There are three possible number values that can be passed using REST calls. A simple number with no character attached is read as Integer, a number with L at the end is interpreted as a Long, and a number with D at the end is interpreted as a Double, for example:

  • 5 - interpreted as an Integer with the value of 5
  • 10L - interpreted as a Long with the value of 10
  • 25D - interpreted as a Double with the value of 25

For more information on GMQL syntax, see the Query API in our API documentation.

Query

The query call allows you to build a query and receive the results.

URL Syntax

https://TRIBEFIRE_SERVER:PORT_NUMBER/tribefire-services/rest/query?PARAMETERS

Parameters

NameDescriptionRequired
sessionIdThe valid session that grants the call access to tribefire.Yes
accessIdThe access through which the query should be executed.Yes
statementThe GMQL statement.Yes

Projections

NameDescription
first-of-payloadReturns the first object that matches the query.
envelopeReturns the query object responsible for the returning the results.
payloadReturns all the objects that match the query. This is the default projection.

Assembly Query

The query assembly request allows you to execute queries by passing a serialized JSON object using the body parameter.

URL Syntax

https://TRIBEFIRE_SERVER:PORT_NUMBER/tribefire-services/rest/assembly-query?PARAMETERS

Parameters

NameDescriptionRequired
sessionIdThe valid session that grants the call access to tribefire.Yes
accessIdThe access through which the query should be executed.Yes
bodyThe serialized JSON object that contains the query.Yes

Projections

NameDescription
first-of-payloadReturns the first object that matches the query.
envelopeReturns the query object responsible for the returning the results.
payloadReturns all the objects that match the query. This is the default projection.

Assembly Stream Query

The Query Assembly Request allows you to execute queries by passing a serialized JSON object using the body parameter.

URL Syntax

https://TRIBEFIRE_SERVER:PORT_NUMBER/tribefire-services/rest/assembly-stream-query?PARAMETERS

Parameters

NameDescriptionRequired
sessionIdThe valid session that grants the call access to tribefire.Yes
accessIdThe access through which the query should be executed.Yes
bodyThe serialized JSON object that contains the query.Yes

The actual JSON object that defines the entity or entities that should be created or edited should be defined in the body of the REST call.

Projections

NameDescription
first-of-payloadReturns the first object that matches the query.
envelopeReturns the query object responsible for the returning the results.
payloadReturns all the objects that match the query. This is the default projection.