Skip to main content
Solved

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

  • Sep 29, 2023 9:25 AM UTC
  • 12 replies
  • 313 views
  • Translate All

Forum|alt.badge.img

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? 

Best answer by praveenpo

@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.

View original

12 replies

jinin
Pro I
Forum|alt.badge.img+12
  • Pro I
  • Sep 29, 2023 9:42 AM UTC

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.

 

Translate

Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • Oct 2, 2023 8:45 AM UTC

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

 

Translate

praveenpo
Semi-Pro III
Forum|alt.badge.img+3
  • Semi-Pro III
  • Oct 2, 2023 3:08 PM UTC

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.


 
Translate

Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • Oct 2, 2023 3:16 PM UTC

Hi @praveenpo ,

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

 

Translate

praveenpo
Semi-Pro III
Forum|alt.badge.img+3
  • Semi-Pro III
  • Oct 2, 2023 3:17 PM UTC

You have to use the RestSharp dll and as reference.

Translate

Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • Oct 2, 2023 3:18 PM UTC

Is that Nuget one?

Translate

praveenpo
Semi-Pro III
Forum|alt.badge.img+3
  • Semi-Pro III
  • Oct 2, 2023 3:19 PM UTC

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

Translate

Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • Oct 2, 2023 3:22 PM UTC

Thanks got it

Translate

Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • Oct 2, 2023 3:46 PM UTC

Hi @praveenpo ,

Still I got this error.

 

Translate

praveenpo
Semi-Pro III
Forum|alt.badge.img+3
  • Semi-Pro III
  • Oct 2, 2023 3:48 PM UTC

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

Translate

Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • Oct 2, 2023 3:52 PM UTC

I already added RestSharp.dll from the bin folder

Translate

praveenpo
Semi-Pro III
Forum|alt.badge.img+3
  • Semi-Pro III
  • Answer
  • Oct 3, 2023 4:59 AM UTC

@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.

Translate