Receiving 403 Forbidden When Using REST API In C#
I was referred to the following C# example of using REST APIs Sample code: OrionSDK/Program.cs at master · solarwinds/OrionSDK · GitHub
This looked very promising and I have attempted to implement it for my process. However, all requests are failing with a 403 Forbidden error.
I have verified if I used invalid credentials I get a 401 unauthorized error so it appears to be authenticating my request, but I can't get results for a simple query operation.
I am basically using the code from the example but I am only calling the query action with the following simple query string and no arguments:
conststring query = @"SELECT nodeid, caption FROM Orion.Nodes";
I have output the JSON string created before it is passed to the request and it looks like this:
{"parameters":null,"query":"SELECT nodeid, caption FROM Orion.Nodes"}
Is there something wrong with the JSON or my query request?