softwerkab / fortnox-csharp-api-sdk

.NET SDK for Fortnox API.
MIT License
52 stars 64 forks source link

Getting Print templates gives an error #161

Closed xpagedeveloper closed 3 years ago

xpagedeveloper commented 3 years ago

When I try to retrieve print templates using the new oauth flow using 4.2.0 Beta

Getting this error message back {"ErrorInformation":{"error":1,"message":"System exception","code":1000087}}

If I try the same with an old auth flow it works fine except that filtering doesn't work it shows all print templates

xpagedeveloper commented 3 years ago

Perhaps update the beta branch with the 4.2.0 beta code.

richardrandak commented 3 years ago

Hello! Thank you for reporting the issue. 1) The error does not provide much information :) Have you tried the calling the request in Postman or cURL? 2) What filter does not work for you? It seems to work for me, at least for orders and offers. Invoice filter gives me all, but that's may be correct. You can try with Postman too, e.g. https://api.fortnox.se/3/printtemplates?type=order (Note that FilterBy is actually named "type" in the url parameter)

Unfortunately, I am not able to test the SDK with the new OAuth workflow since I don't have any published app. I updated the beta branch with the code for 4.2.0-beta NuGet, so you can debug it yourself. Please let me know if you find something.

xpagedeveloper commented 3 years ago

It’s with invoices the filter doesn’t work, will check that too. I haven’t had the time to test with postman will do that too. if you register as a developer in the new environment you will also have the possibility to setup test environments for free. That is how I’m doing tests.

richardrandak commented 3 years ago

Yes, I have the developer account and several unpublished apps, but the OAuth2 workflow does not work with the unpublished app, last time I checked.. does any request works for you with the new OAuth2 workflow? Because, the your error can be pretty much the same which I had problem with, and support told me the OAuth will work only for published ones.

EDIT: Well, actually I think I did not even manage to get the access token, so yours is a different issue :) ..Sorry for confusion. May be I should try it then.. so your app is not published, or is it?

xpagedeveloper commented 3 years ago

The new oauth way works fine against demo installations. I developing our new integration app and have done authorization, articles, currencies, and some more functions.

xpagedeveloper commented 3 years ago

Same problem with postman so this is not an SDK matter it's an API problem. Will investigate the filtering part separately and open a new ticket with findings