Solved

Calling and assign values to Acumatica form using 3rd party REST API

  • 29 September 2023
  • 12 replies
  • 166 views

Userlevel 3
Badge

Hi Team,

Can someone help me out to configure the 3rd party REST API to Acumatica and display it’s data on the custom screen? 

icon

Best answer by praveenpo 3 October 2023, 06:59

View original

12 replies

Userlevel 7
Badge +11

Hi @bhagyat25 

You can create a configuration screen with the necessary fields required to interact with the API calls for the 3rd-party (destination) system. You can create a custom screen according to your needs and use the API call to retrieve data from the destination system.

Sample screenshot of the configuration screen.

 

Userlevel 3
Badge

Hi @bhagyat25 

You can create a configuration screen with the necessary fields required to interact with the API calls for the 3rd-party (destination) system. You can create a custom screen according to your needs and use the API call to retrieve data from the destination system.

Sample screenshot of the configuration screen.

 

Hi @jinin ,

I need graph code sample, how to call the API and how to catch the API results and assign values into the controls. Can you help me out?

Thanks

 

Userlevel 6
Badge +3

Hi @bhagyat25,

Here is the sample code calling a REST API call.

var options = new RestClientOptions("<Your Base API Url here>")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/v1/DistributionCenters", Method.Get);
request.AddHeader("Authorization""Bearer <Bearrer Token>");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
 

response.Content will contain the response. Based on the response you can Derserialize the response and use based on your requirement.

Hop this is Helpful.


 
Userlevel 3
Badge

Hi @praveenpo ,

Thanks for your response, But showing errors, No namespaces to add. Can you help me out?

 

Userlevel 6
Badge +3

You have to use the RestSharp dll and as reference.

Userlevel 3
Badge

Is that Nuget one?

Userlevel 6
Badge +3

RestSharp dll will be available in the bin folder for the website. You can add that to your solution.

Userlevel 3
Badge

Thanks got it

Userlevel 3
Badge

Hi @praveenpo ,

Still I got this error.

 

Userlevel 6
Badge +3

You can paste the error here, so that i can get some information to suggest

Userlevel 3
Badge

I already added RestSharp.dll from the bin folder

Userlevel 6
Badge +3

@bhagyat25,

for first issue with the latest RestSharp we dont need this you can directly use the Rest Client.

for second issue you can change from Get to GET that will solve your issue.

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