softwerkab / fortnox-csharp-api-sdk

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

Profile connector #220

Closed andersjerenvik closed 2 years ago

andersjerenvik commented 2 years ago

Hi,

Could you please add the Profile connector?

https://api.fortnox.se/3/me

Merry christmas!!

Anders

richardrandak commented 2 years ago

Hi! Is there some documentation for this endpoint?

andersjerenvik commented 2 years ago

Hi,

Not yet it’s part of the new oauth. Can you the me endpoint anyway?

The scope Profile is in the dokumentation though.

Best regards,

Anders

andersjerenvik commented 2 years ago

This is the responsebody

{ "Me": { "Id": "9e76c2a0abfb90537d8b8e190daf", "Name": "admin", "Email": "support@se", "SysAdmin": true, "Locale": "sv_SE" } }

richardrandak commented 2 years ago

Hi! I have added the Profile connector and published a pre-release NuGet - https://www.nuget.org/packages/Fortnox.NET.SDK/4.2.8-rc

var connector = fortnoxClient.ProfileConnector;
var profile = await connector.GetAsync();

It seems it requires "profile" scope, so it can only work with the new auth workflow. I have added the scope to the Scope enum if needed.

Let me know if you find any issues or more info about the endpoint.