Gavin Edge Posted July 8, 2022 Share Posted July 8, 2022 I can connect and get data from https://api.accounting.sage.com/v3.1/ using Postman OK. In Postman I can set the call back URL to the same as my App at developerselfservice.sageone.com . However, I need to create a program in Visual Studio to read data from WooCommerce orders and add them as Invoices to Sage. I've looked at the C# sample app on github and cannot get this to work as it is. I'm using VS 2022 and targeting Net6.0, and the app builds OK. I keep hitting the https://central.uk.sageone.com/errors/oauth-failed page and the problem seems to be that it's not getting a valid (same as my app) callback url. In the github sample app code the callback url is read from the json file to a string named 'config_calback_url' which is then never used in the code - so is pointless. Instructions say to make sure the 'client_application.json' has the correct callback url saved - but this is never used in the code. I've tried changing the 'CallbackPath' to be the correct callback url, but cannot as the Path can only begin with a / so a full url cannot be used. I've tried all combinations of localhost and also tried setting the application.json iissettings to be my registered app callback (the one that works in Postman), but nothing works. I've even tried to add extra callback urls to the app settings on developerselfservice.sageone.com , but I cannot enter anymore Callback URLs as shown above. When I do and then click 'Save', nothing is saved!! As can be seen below, I can connect OK with Postman, but your recommended sample app won't work. Is there something I'm missing?? Do you have an updated example of connecting to the API with C#? Thanks Link to comment Share on other sites More sharing options...
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now