Hi,
For demo purpose I am trying to call Kaizala Rest APIs (
https://docs.microsoft.com/en-us/Kaizala/).
I want to use RestSharp(
http://restsharp.org/) DLL for this purpose. I tried with following code:
Variables
Client DotNet RestSharp.RestClient.'RestSharp, Version=106.0.1.0, Culture=neutral, PublicKeyToken=598062e77f915f75'
Request DotNet RestSharp.RestRequest.'RestSharp, Version=106.0.1.0, Culture=neutral, PublicKeyToken=598062e77f915f75'
Method DotNet RestSharp.Method.'RestSharp, Version=106.0.1.0, Culture=neutral, PublicKeyToken=598062e77f915f75'
ParameterType DotNet RestSharp.ParameterType.'RestSharp, Version=106.0.1.0, Culture=neutral, PublicKeyToken=598062e77f915f75'
Response DotNet RestSharp.RestResponse.'RestSharp, Version=106.0.1.0, Culture=neutral, PublicKeyToken=598062e77f915f75'
CAL Code
Client := Client.RestClient(STRSUBSTNO(GeneratePinURLTxt,ApiRoot));
Request := Request.RestRequest(Method.POST);
Request.AddHeader('postman-token', GetPostmanToken);
Request.AddHeader('cache-control', 'no-cache');
Request.AddHeader('content-type', 'application/json');
Request.AddParameter('application/json',GetGeneratePinParameter,ParameterType.RequestBody);
Response := Client.Execute(Request);
Compilation error for last line :
Microsoft Dynamics NAV Development Environment
The call is ambiguous between the following methods:'Execute(IRestRequest request)'and'Execute(IRestRequest request)'
OK
Thanks in advance.
Manish Sinha
Answers
Cross verify the Constructor that you are calling.
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/
fully explained here:
https://www.j3ns.de/d365-business-central/calling-graphql-queries-in-dynamics-nav-using-restsharp/