Skip to main content
Question

Retrieval of Reports Through the REST API


Forum|alt.badge.img

Hello, we need to help in getting report using API.

From screen, when we click on report button, we are executing some logic and then opening up report. So we would like to know how can we achieve this using APIs.

3 replies

jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • 693 replies
  • January 30, 2025

@ckwiat46 

Please refer to the link below, page No 11
AcumaticaERP_2023R2_ReleaseNotes_for_Developers.pdf

 


Forum|alt.badge.img

Web Services: Retrieval of Reports Through the REST API

In previous versions of Acumatica ERP, it was impossible to retrieve a report through the REST API. In Acumatica

ERP 2023 R2, a developer can create a custom endpoint or extend an existing endpoint with an entity of the new

Report type and use this entity to obtain the report from Acumatica ERP.

Adding a Report Entity to an Endpoint

On the Web Service Endpoints (SM207060), the developer performs the following general steps to add a Report

entity to an endpoint:

1. Extends an existing endpoint or adds a new endpoint, as described in To Extend an Existing Endpoint or To

Create a Custom Endpoint.

2. In the endpoint, adds the entity of the Report type, as shown in the following screenshot.

Figure: Adding a Report entity

3. On the Fields tab, specifies the parameters that should be specified to run the report. By default, the tab is populated with the fields for each parameter of the report.

Requesting the Report

To obtain the report from Acumatica ERP, the developer executes an HTTP request that satisfies the following

requirements:

• HTTP method and URL: The developer sends the POST HTTP method to the following URL.

POST http://<Endpoint URL>/<Report entity>

For example, suppose that the created endpoint has the http://localhost/AcumaticaDB/entity/Report/0001/

URL and the name of the report entity is CashAccountSummary. The developer would use the following

HTTP method and URL.

POST http://localhost/AcumaticaDB/entity/Report/0001/CashAccountSummary

Web Services: Retrieval of Reports Through the REST API | 12

• Request headers: In the Accept header, the developer specifies the format in which the report should be

returned. The format (and the respective header value) can be one of the following:

• PDF: application/pdf

• HTML: text/html

• Excel: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

• Request body: In the request body, the developer specifies the parameters of the report in JSON format,

such as in the following example.

{

}

"CompanyBranch": {"value": "SOFT"},

"IncludeNonClearedTransactions": {"value": true}

 

If no parameters are specified in the request body, the default parameters of the report are used. The response of a successful request has the 202 Accepted status and includes the Location header, which specifies the URL that the developer should use to obtain the requested report by using the GET HTTP method.

When the report is ready, this GET request returns the 200 OK status code. The requested report is returned in the response body.


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 44 replies
  • February 8, 2025

Thanks for the response.

We have noticed a time delay, what’s happening is, consider a report takes one minutes to generate from Acumatica screen, then if we run the same report in Postman, when we hit the send button we are getting the report id in Response Header Location but the process is still running in Acumatica we have verified this in System Monitor. So, because of this when we make the next GET call to get the report file, we are not getting any response. 

How can we solve this, please help us. 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings