question

marcaz avatar image
marcaz asked

Api Authentication resulting in 401

I have tested the login web service using postman and I was able to acquire the token.

I have tried authenticating with the api using a C# console application but it always results in 401 unauthorized with the error code : {invalid_credentials}


Below is the code sample:

var client = new RestClient(loginRequestIntegrationDTO.BaseUrl);


var request = new RestRequest(loginRequestIntegrationDTO.EndPoint, Method.POST);

request.RequestFormat = DataFormat.Json;


request.AddParameter("Username", loginRequestIntegrationDTO.Username, ParameterType.RequestBody);

request.AddParameter("Password", loginRequestIntegrationDTO.Password, ParameterType.RequestBody);


var apiResponse = client.Execute(request);

Any reason why i cannot connect through the application ?

api dc system
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

1 Answer
mvader (Victron Energy) avatar image
mvader (Victron Energy) answered ·

Hi Marc, as dicussed via email, you solved this already; right?

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Related Resources

Additional resources still need to be added for this topic