Retrieve Data from an Inquiry Form

To retrieve data from an inquiry form of MYOB Acumatica by using the contract-based REST API, you access the needed URL with the PUT HTTP method and pass the parameters of the inquiry in JSON format in the request body. See the following sections for details on the request and the response.

HTTP Method and URL

If you need to retrieve data from an inquiry form, you use the PUT HTTP method and the following URL.

PUT http://<Base endpoint URL>/<Top-level entity>
The URL includes the following components:
  • <Base endpoint URL> is the URL of the contract-based endpoint through which you are going to work with MYOB Acumatica, which has the following format: http://<MYOB Acumatica instance URL>/entity/<Endpoint name>/<Endpoint version>/.
  • <Top-level entity> is the name of the entity that corresponds to the inquiry form from which you are going to retrieve data.

For example, suppose that you want to retrieve data from the Inventory Summary (IN401000) form in a local MYOB Acumatica instance with the name AcumaticaDB by using the system endpoint with the name Default and Version 23.200.001. You would use the following HTTP method and URL to retrieve data.

PUT http://localhost/AcumaticaDB/entity/Default/23.200.001/InventorySummaryInquiry

Parameter

When you are retrieving data from an inquiry form, you should use the $expand parameter to expand the detail entity, which contains the results of the inquiry. For a detailed description of the parameter, see Parameters for Retrieving Records.

Request Headers

You can specify the following headers in the request.

HeaderDescription
Accept

Specifies the format of the response body, which should be application/json.

Content-Type

Specifies the format of the request body, which should be application/json.

Request Body

You pass parameters of the inquiry in JSON format in the request body. See below for an example of the representation of parameters of the Inventory Summary inquiry form in JSON format.
{
  "InventoryID" : {"value" : "APJAM08" } ,
  "WarehouseID" : {"value" : "RETAIL" }
}

Response Status Codes

The following table lists the HTTP status codes that the system returns for a request that retrieves data from an inquiry form.

Code Description
200 The request has been completed successfully. The response body contains the data retrieved from the inquiry form.
400

The data specified in the request is invalid.

401

The user is not signed in to the system.

403

The user has insufficient rights to access the MYOB Acumatica form that corresponds to the entity.

429

The number of requests has exceeded the limit imposed by the license (see License Restrictions for API Users).

500

An internal server error has occurred.

Example

The following request shows an example of the retrieval of data from the Inventory Summary (IN401000) inquiry form.
Tip: In the request example below, <MYOB Acumatica instance URL> is the URL of the MYOB Acumatica instance (such as https://my.acumatica.com/MyInstance). You can omit the instance name in the URL (that is, you can use https://my.acumatica.com) if the instance is installed in the root of the website.
PUT ?$expand=Results HTTP/1.1
Host: [<MYOB Acumatica instance URL>]/entity/Default/23.200.001/InventorySummaryInquiry
Accept: application/json
Content-Type: application/json

{
  "InventoryID" : {"value" : "APJAM08" } ,
  "WarehouseID" : {"value" : "RETAIL" }
}