Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The following describes MTAPI-SRQL language: the MTOA Service Request Query Language used to perform filtering of Service Requests

via the  “POST  “POST /api/v1/servicerequests/query” endpoint.

 The MTAPI-SRQL language allowsService Request to be filtered using a set of filter type. The current supported types are:

...

Note the following use-cases are currently using the dataset available in MTOA-PLATFORM-TEST.

MITRACK USECASES

  • Query Service Requests but also include the Service Request Status History associated with each Service Request

This can be done by setting the "IncludeStatusHistory" property to true.

Code Block
languagejson
{
    "UserId": 10005,
    "IncludeStatusHistory": true,
    "Page": 1,
    "PageSize": 25,
}

The returned Service Request List payload will include the Service Request Status history within each Service Request in as follow:

Code Block
languagejson
{
  "ServiceRequests": [
  ...
    {
      "StatusHistory": [
        {
          "ServiceHistoryEntryId": 12054,
          "Status": "Submitted",
          "EnglishDisplayName": "Submitted",
          "FrenchDisplayName": "Soumise",
          "Date": "2021-08-18T18:34:41",
          "ServiceCategoryCode": "ON",
          "ServiceStandardId": 0
        },
        {
          "ServiceHistoryEntryId": 12051,
          "Status": "InProgress",
          "EnglishDisplayName": "In-Progress",
          "FrenchDisplayName": "En cours",
          "Date": "2021-08-19T18:34:33",
          "ServiceCategoryCode": "OFF",
          "ServiceStandardId": 0
        }
      ],
      "DateUpdatedUtc": "2021-08-18T22:34:41",
    }
  • Query a list of Service Request Assignees by specifying user Ids (the Assignees) in a comma delimited list

Code Block
languagejson
{
  "Assignees": "11577,11578",
  "IncludeRegulatedEntities": true,
  "Page": 1,
  "PageSize": 25
}

  • Query a list of Services by specifying the Service Ids in a comma delimited list

...

Code Block
languagejson
{
    "UserId": 9873,
    "ServiceId": 0,
    "Services": null,
    "OrganizationId": 0,
    "IncludeRegulatedEntities": false,
    "Page": 1,
    "PageSize": 25,
    "Filter": "DateRangeUtc=20210801-20210803"
}

OrderBy Syntax

OrderBy-{Id|Date}={Asc|Ascending|Desc|Descending} the query itself is case insensitive

Notes

OrderBy-Id=Ascending is the same as OrderBy-Id=Asc
OrderBy-Date=Ascending is the same as OrderBy-Date=Asc
OrderBy-Id=Descending is the same as OrderBy-Id=Desc and is the same as OrderBy-Id (without using a sort direction)
OrderBy-Date=Descending is the same as OrderBy-Id=Desc and is the same as OrderBy-Date (without using a sort direction)

OrderBy Syntax

OrderBy-{Id|Date}={Asc|Ascending|Desc|Descending} the query itself is case insensitive

...