Closed Giacomino70 closed 2 years ago
Buonasera e scusa per intrusione. Ma se posso chiedere quale versione VB.Net usi ?
Chiudo questa issue. Le issue devono essere usate solamente per segnalare bug sull'API, e non per continuare discussioni.
Grazie Mauro
Good morning @emajo @valmoz
I also have an authorization problem, let me explain: We have a desktop VB.NET application connected to the api (v1) of Fatture in Cloud, I migrated to the api (v2) using the SDK (the SDK is for C# but knowing both languages I "brought" the code in VB.NET). I used manual authorization, successfully registered our application and obtained the token.
The problem is setting the token for the Configuration object, here is the code:
Public Function FIC_GetCompanies() As ListUserCompaniesResponse
Dim config As New Configuration()
config.BasePath = basePath
config.ApiKeyPrefix("Authorization") = apiKeyPrefix 'Bearer
config.ApiKey("Authorization") = apiKey 'token generated for the application by the Fatture in Cloud web app
Dim userApi As New UserApi(config)
Try
Dim listUserCompaniesResponse = userApi.ListUserCompanies()
Return listUserCompaniesResponse
Catch ex As ApiException
Return Nothing
End Try
End Function
This request always goes in 401 Unauthorized while if I try the same request in Postman (Authorization Type: Bearer Token, Token: token generated on Fatture in Cloud) everything works correctly. I suspect I am setting the wrong variables/methods in VB.NET to set the token.
Any help would be much appreciated. Thanks Regards
Originally posted by @diegonogaretti in https://github.com/fattureincloud/api/discussions/19#discussioncomment-3178916