Run a User-Defined Query Synchronously

Use a synchronous request when the query completes quickly and the calling application requires the result immediately.

  1. Identify the enabled user-defined query that you want to run.

  2. If the query includes parameters, obtain the required parameter names and values.

  3. Submit a POST request to the runExtract endpoint.

    POST /fscmRestApi/scm/redwood/11.13.18.05/runExtract

Request Example

{
  "UserDefinedQueryName": "PendingInvoiceSync",
  "Type": "ORA_SYNC",
  "Parameters": {
    "pOrgCode": "M1",
    "pWoNumber": "M1-1100"
  }
}

Response Example

{
  "Type": "ORA_SYNC",
  "ExecutionId": "300100679988222",
  "ExtractDefinitionName": null,
  "UserDefinedQueryName": "PendingInvoiceSync",
  "CallbackFlag": null,
  "OutputFormat": null,
  "Parameters": {
    "pOrgCode": "M1",
    "pWoNumber": "M1-1100"
  },
  "RequestId": null,
  "Status": "Success",
  "Result": [
    {
      "woWorkOrderNumber": "M1-1100",
      "woId": 2448,
      "woOrganizationId": 207,
      "woOrganizationCode": "M1",
      "nextOperationNum": 400,
      "releasedDate": "2017-02-28T17:02:10Z"
    }
  ]
}

The response includes the query output in the Result attribute.