Solved

Deploying a Customization Project to other Acumatica ERP instances

  • 22 February 2023
  • 9 replies
  • 160 views

Userlevel 1
Badge

Hi guys,

I am currently developing an integration to pull data from Acumatica ERP. I am trying to implement an OAuth 2.0 flow using the Authorization Code Flow.

From reading through the resources, I have gotten this flow to work for my local Acumatica ERP instance. However, I am struggling to understand how to expand this to other Acumatica ERP instances, such as those used by our clients.

I understand that a key part of the OAuth flow is creating a record in the Connected Applications form, and being issued a Client ID and a secret. I’ve seen that I can export this Connected Applications form as part of a Customization Project, but when I import this Customization Project in another Acumatica ERP instance, it loses the record in the Connected Applications form. I suspect this may have to do with the tenant name being different in the other instance, but I am unsure how to get around this.

Even if I do get this Customization Project approach to work, it doesn’t seem logical to me to have each of my clients import this project in order for me to be able to kick off the OAuth process with them. Is there a step that I’m missing somewhere? Does this process differ in production environments?

Any advice would be appreciated.

Thanks,
Jonah

icon

Best answer by Dmitrii Naumov 24 February 2023, 01:55

View original

9 replies

Userlevel 7
Badge +5

Hello @Jonah 

Are you sure you export/import customization package properly and publish it after importing?

I’ve just retested it and it works fine for me.

 

As for the clients importing a customization package to enable some integration, this is standard process that Acumatica uses. Maybe at some point there will be a centralized repository of trusted connected applications, but for now it’s per customer instance only.

Userlevel 1
Badge

Hi @Dmitrii Naumov 

Thank you for your response.

​Are you sure you export/import customization package properly and publish it after importing?

I’ve just retested it and it works fine for me.

You were indeed correct, I forgot to publish after importing and now it worked fine. I just have one question on this now - the Client ID remains the same as the exported Client ID, up until the end where it has “@{{tenant name}}”. How do I know what the tenant name is? Do I have to ask the user to type it in?

In a similar vein, I have read this response to another question regarding getting the base path to hit for the endpoint URL. I don't quite understand what they're saying in this response. Could you please clarify how I would go about obtaining the base path for the web service endpoints? Will this path be different for each Acumatica ERP instance?

 

As for the clients importing a customization package to enable some integration, this is standard process that Acumatica uses. Maybe at some point there will be a centralized repository of trusted connected applications, but for now it’s per customer instance only.

Thank you for clearing that up.

 

Userlevel 7
Badge +5

@Jonah

As for the @{{tenant name}}, yes, I think you need to get it from the user, probably at the same time when you get the site URL. 

 

As for the endpoint URL, I think you can find it useful that you can read available endpoints and their paths using GET: {{sitemane}}/entity request. 

However, these paths may indeed contain a part of a site URL, e.g. /AcumaticaERP/entity/Default/22.200.001 vs /entity/Default/22.200.001.

 

In that case I didn’t find a better solution than parsing the URL around the keyword ‘entity’. Hope that helps.

As for the response that you are pointing to, it simply explains that the URL is configured in IIS settings and Acumatica ERP itself does not handle the URL structure.

 

Userlevel 1
Badge

@Dmitrii Naumov thank you for your response.

In that case I didn’t find a better solution than parsing the URL around the keyword ‘entity’. Hope that helps.

Could you please clarify what you mean by this? I think I understand everything else you said.

Userlevel 7
Badge +5

@Jonah  you can check here:

https://github.com/Acumatica/AcumaticaRESTAPIClientForCSharp/blob/4.0-preview/Acumatica.RESTClient/BaseApi/UrlParser.cs

I just check the location of ‘entity’ keyword and consider everything after that. Everything before ‘entity’ I consider a part of site URL

Userlevel 1
Badge

@Dmitrii Naumov thank you for the example.

Where do you get the location from (the full URL that you parse)? Do I have to ask the user to enter it?

Userlevel 7
Badge +5

@Jonah you can read available endpoints and their paths using GET: {{sitemane}}/entity request. 

See here:

https://help.acumatica.com/Help?ScreenId=ShowWiki&pageid=da0fe495-b2e5-4d34-ab5a-5829e408f684

 

The site URL you definitely need to get from a user.

Userlevel 1
Badge

@Dmitrii Naumov sorry to open up this thread again, I just had a follow up question on my initial question here.

I am occasionally experiencing issues when trying to publish my Customisation Project to another Acumatica ERP instance. For some reason, it shows as having published but my Connected Application does not show up on the form.

I wanted to ask, is it unconventional to have the user import an XML file directly into the Connected Applications form? As opposed to publishing a Customisation Project. This method seems to work much more reliably for me and the Connected Application was the only thing present in my Customisation Project.

Userlevel 7
Badge +5

 @Jonah  I’m not sure what can be the reason for it not publishing through a customization package. Maybe the user has the version of Acumatica ERP that does not have the support for it yet? (it has been introduced in one of the recent versions)

 

Importing xml may also work, but users generally are less aware of that way.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved