Skip to main content

Hello,
We've added a new screen that displays the UserReportEx DAC in a table and created an action to move reports (with a specific checkbox selected) to another tenant on the same instance. For example, reports SO641010 and SO642000 are currently in Tenant A, and we want to move them to Tenant B.

We discovered that the Report Designer uses the ServiceGate API, accessible under /api/servicegate.asmx for any instance, but we’re struggling to make it work.

Here’s the code we currently have https://pastebin.com/sfd6AYdp, but it always returns the following error:

Report Response: System.InvalidOperationException: Not authenticated. at PX.Api.WebServiceBase.VerifyLogin() in C:\build\code_repo\NetTools\PX.Data\Api\Legacy\AbstractServiceGate.cs:line 572 at PX.Api.WebServiceBase.ReportSave(String name, String xml) in C:\build\code_repo\NetTools\PX.Data\Api\Legacy\AbstractServiceGate.cs:line 241 Status code: InternalServerError

Does anyone know how to resolve this? We've gone through several iterations of the code, but it still doesn’t seem to work and the API documentation under /api/servicegate.asmx does not seem to be very helpful. We do login successfull, it always seems to error at using ReportSave (or ReportSaveEx)

We do have the ReportDesigner Role on both Tenants.

Just FYI, serviceGate API is obsolete. It is replaced with a new report API in 2024r2.


Just FYI, serviceGate API is obsolete. It is replaced with a new report API in 2024r2.


Hi @Dmitrii Naumov , thanks for the information. Unfortunately, we’ll be stuck to ServiceGate for quite some time since we’re working with the German version of Acumatica, known as X360. We are currently on Major 23R1 and are hoping to update to 24R1 before Christmas. However, we won’t receive 24R2 until summer 2025, which means we’ll have to continue using the old ServiceGate API until Haufe updates the German version to 24R2. So, even though ServiceGate might become obsolete, we would still appreciate assistance for ServiceGate for the time being!


Hi @jwestermann17 
First of all, I want to confirm @Dmitrii Naumov’s statement about ServiceGate API. It is removed in Acumatica 2024R2.

Another question is why do you want to use API calls if you do it on the same Acumatica instance?


Hi @jwestermann17 
First of all, I want to confirm @Dmitrii Naumov’s statement about ServiceGate API. It is removed in Acumatica 2024R2.

Another question is why do you want to use API calls if you do it on the same Acumatica instance?

 

Thank you for confirming @snikomarov36 . However, as mentioned earlier, we're tied to older versions of Acumatica until at least the summer of 2025, so we don't have many options at the moment as the update cycle of X360 is quite a bit slower.

That said, I'm curious—what alternative approach would you recommend?

Here’s what we need to accomplish:

  1. Transfer selected reports (one or multiple) from our Screen that displays the UsersReportEx DAC from Tenant A to Tenant B and save them as new active versions on the target tenant.
  2. Upload reports from our GitHub repository to Instance X and Tenant X.

This is why we initially considered sticking with the same API that the Report Designer currently uses.


We found the solution. Cookies have to be added like this for the servicegate API:

var cookies = loginResponse.Cookies;
foreach (var cookie in cookies){    reportRequest.AddCookie(cookie.Name, cookie.Value);}

Hi @jwestermann17 

Originally, I meant that since you have your own screen as the original post says, then you can create a graph action (if you don’t have it already) to move it to another tenant.

However, I checked it more and I understood that you can’t do it now with existing report helpers (PX.Data.Reports.ReportDbStorage static class, for example) used by ServiceGate API, because you need to specify a different CompanyID for a report record. You also can’t use standard graph/PXCache API or BQL for this reason since they automatically add the current tenant as the company ID. All of this is done to enforce the isolation of tenant data.

I have discussed this with the team lead of our ORM team. While there are some very internal APIs that allow to do this, Acumatica platform forbids their usage due to risks to break the data isolation of tenants. So, the call to API may be a valid alternative here.

The other recommendation was to manipulate reports via customization packages. You an achieve this with the help of the PX.CommandLine tool. You can read about it here:


 


Hi @snikomarov36 

Thanks for the detailed explanation. I understand now why manipulating reports through standard graph/PXCache API or BQL isn't feasible due to tenant isolation enforcement. Since using internal APIs is discouraged for the same reason, exploring the ServiceGate API route seems to be the most viable option.

Regarding the customization packages, I agree that while they could be effective, the performance impact—especially in instances with heavy workloads or multiple customizations—makes it less desirable. Given that ServiceGate API offers a more lightweight alternative, it sounds like a better approach overall.


Hi @jwestermann17 

After I have discussed this issue within our team, another suggestion appeared. You may create a new idea here on Acumatica Community Portal to add a new public API to the Acumatica Framework which would allow developers to move or copy system entities such as GIs and reports to other tenants with the preservation of the isolation of tenant data.

I believe, such API will be a better solution to such tasks in the future because the ServiceGate API is deleted in 2024r2, and the new API was created only for the internal usage.

Then, we will see how much traction this idea will get. If it gains popularity then such API can be added to Acumatica Framework.


Hi @snikomarov36

Thank you for discussing this with your team. I will definitely create an idea on the Acumatica Community Portal in the coming days, as such an API makes a lot of sense. Especially with the removal of the ServiceGate API in 2024r2, it’s unfortunate that there will likely be no API to move reports, such as those from GitHub, into Acumatica. A dedicated public API for this would really be a valuable addition to the framework.


Hi @snikomarov36 

We have one more question: Will it still be possible in Acumatica 2024r2 to export and import reports via the new REST API, for example, to transfer them to and from GitHub, despite the removal of the ServiceGate API?

Thank you in advance for the information, as we were considering releasing our solution in the Haufe ISV corner for automating report backups to GitHub and more. However, some features, such as tenant-to-tenant transfers, would definitely need to be excluded.


@jwestermann17 the new REST API has the same capabilities as the ServiceGate API.

However, it is currently internal for Acumatica and not documented. I’m not aware about plans to make it public and document it. Again, you can create an idea on the Acumatica Community portal for such feature.


Hi @snikomarov36 

I’ve created this idea yesterday 


Just to clarify once and for all: aside from using the Customization Package approach, which may not be very performance-friendly, starting with version 24R2, will there be no other way to download and upload reports through any kind of customization at all? 


@jwestermann17 currently, yes. The REST API will be present, ReportDesigner is working through it. But AFAIK REST API is internal.

I will ask if there are plans to make it public. The best thing you can do currently IMO is to create an idea with such request. You can cooperate with other ServiceGate API users like in this question:
https://community.acumatica.com/other-developer-topics-290/reportdesigner-api-documentation-23509?postid=105064


@snikomarov36 Thank you for the information! If there are no plans to make it public, that would be a real pity, as it’s such an important feature. In that case, I’ll happily take the next step and create an idea for it after you found out if it is planned to make it public or not.

 


@jwestermann17 I got a reply that there are no plans to make the REST API for reports public.
I was told that an idea should be created to estimate the popularity of the request to make this API public.If it gains traction, Acumatica may do it.\

In addition, you may also try creating a support request for Acumatica describing your situation - you used functionality of the public API that is not available now because the new API is internal. This may bring attention to your situation and improve chances that the API will be made public.

I would advise you to do both and also look for other cases related to ServiceGate usage with reports and ask them to support you idea, because all of them will be affected.   


Hi @snikomarov36 , we are a Haufe Partner for the German product Haufe X360, and I’m not sure if we have the ability to create Acumatica tickets directly. I’m also not entirely sure where we would do that if it were possible. Would it make more sense for me to report this to Haufe instead, as they might be able to make the API public specifically for X360?


@jwestermann17 I think, yes. Haufe is an Acumatica OEM. I’m not sure that they will be able to access the new REST API themselves since it is internal.
But they definitely can create a support request for Acumatica to get more information about this API, request to access it, or request to make the new REST API public.


Reply