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>
<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.
Header | Description |
---|---|
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
{
"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
<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" }
}