Do I need to change aunthentication in new Infusionsoft API

I cant access Infusionsoft API via custom script. It was working ok until 2 weeks ago and I can see infusionsoft changed location of the api. Do I need to create a new app to access Infusionsoft API?

You don’t need to make a new app, but you do need to make an account on Apigee using the same email you had for Mashery. This will associate your existing data with your new credentials.

Instructions can be found here: Apigee Portal Guide - Keap Developer Portal

I am still getting an error when trying to access tokens.

    • System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)

    • System.Net.WebRequest+<>c.b__68_2(IAsyncResult iar)

    • System.Threading.Tasks.TaskFactory.FromAsyncCoreLogic(IAsyncResult iar, Func<IAsyncResult, TResult> endFunction, Action endAction, Task promise, bool requiresSynchronization)

    • TGBS.API.Helpers.ApiHelper.PostWebRequestAsync(string url, string requestContent, string authKey) in ApiHandler.cs

496. using (Stream reqStream = await request.GetRequestStreamAsync())
497. {
498. reqStream.Write(dataBytes, 0, dataBytes.Length);
499. }
500. string resultJSON = string.Empty;
502. using (WebResponse response = await request.GetResponseAsync())
503. {
504. var sr = new StreamReader(response.GetResponseStream());
505. resultJSON = sr.ReadToEnd();
506. sr.Close();
507. }
  • TGBS.API.Helpers.ApiHelper.Callback(string code) in ApiHandler.cs

45. System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
46. if (!string.IsNullOrEmpty(code))
47. {
48. // Hard coded "grant_type=authorization_code" since it is the only supported option
49. string tokenDataFormat = "code={0}&client_id={1}&client_secret={2}&redirect_uri={3}&grant_type=authorization_code";
50. string dataString = string.Format(tokenDataFormat, code, CLIENT_ID, CLIENT_SECRET, WebUtility.UrlEncode(CALLBACK_URL));
51. TokenData tokenData = await PostWebRequestAsync<TokenData>("https://api.infusionsoft.com/token", dataString);
52. return tokenData.Access_Token;
53. }
54. return "";
55. }
56. public static async Task RefreshToken(string refreshToken)
  • TGBS.API.Controllers.AuthController.Callback(string code) in AuthController.cs

95. return ApiHelper.Authorize();
96. }
97. [HttpGet("callback")]
98. public async System.Threading.Tasks.Task<string> Callback(string code)
99. {
101. return await ApiHelper.Callback(code);
102. }
103. [HttpGet("syncinfusionsoft")]
104. public async System.Threading.Tasks.Task SyncInfusionSoft(string token)
105. {
106. await ApiHelper.SyncInfusionsoft(token, _infusionsoftRepository);
  • lambda_method(Closure , object )

  • Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable+Awaiter.GetResult()

  • Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor+AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, object controller, object arguments)

  • System.Threading.Tasks.ValueTask.get_Result()

  • Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()

  • Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()

  • Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)

  • Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)

  • Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()

  • Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()

  • Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)

  • Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)

  • Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()

  • Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()

  • Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)

  • Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)

  • Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)