The REST API provides the following methods to perform lookups against a lookup table on the Rhapsody engine:

POST /api/lookuptable/lookup

URI

POST /api/lookuptable/lookup

Description

Performs a single lookup against a table in Rhapsody, returning the first matching row.

Refer to LookupTable Object for details.

Request Header

Accept:application/json
Content-Type: application/json

Accept: application/vnd.orchestral.rhapsody.6_1+json
Content-Type: application/vnd.orchestral.rhapsody.6_1+json

Request Body

{
  "table":"my_table", 
  "queryColumns":[
     {"name":"a","value":"1"},
     {"name":"b","value":"11"}
  ], 
  "returnColumn":"c"
}
Response Status

200 OK - operation successful.

Response Body

A list of lookup results:

  • name - [str] the column name.
  • value - [str] the column value.

{
  "data":[
    {"name":"c","value":"12"}
  ],
  "error": null
}

Access Rights

'Perform lookup REST API'.

POST /api/lookuptable/lookupall

URI POST /api/lookuptable/lookupall
Description

Performs a lookup against a table in Rhapsody, returning all matching rows (subject to an optional limit).

Refer to LookupTable Object for details.

Request Header

Accept:application/json
Content-Type: application/json

Accept: application/vnd.orchestral.rhapsody.6_4+json
Content-Type: application/vnd.orchestral.rhapsody.6_4+json

Request Body

The request body has the following structure:

{
  "table":"my_table",
  "queryColumns":[
     {"name":"a","value":"1"},
     {"name":"b","value":"11"}
   ],
  "returnColumns":["b", "c"],
  "sortColumns":[{"name":"b", "sortOrder":"Ascending"}],
  "limit":10
}

The sort order is case-sensitive.

Response Status 200 OK - operation successful.
Response Body

A list of lookup results:

  • name - [str] the column name.
  • value - [str] the column value.
{
  "data":[
    [
      {"name":"b","value":"11"},
      {"name":"c","value":"111"}
    ],
    [
      {"name":"b","value":"11"},
      {"name":"c","value":"222"}
    ],
    [
      {"name":"b","value":"11"},
      {"name":"c","value:"333"}
    ] 
  ],
  "error": null
}
Access Rights 'Perform lookup REST API'.