Migrated from Redmine #385 | Author: Roy Drenker
Status: New | Priority: Normal | Created: 2019-05-19
I’m using a C# client for JSON RPC.
Attempting to access some of the “admin” APIs is resulting in an “access denied” exception;
Sample code:
var loginClient = new JsonRpcHttpClient(new Uri(“https://user-api.simplybook.me/login”));
var adminToken = await loginClient.Invoke(“getUserToken”, new {companyName, “user”, “password”});
var adminHttpClient = new HttpClient();
.DefaultRequestHeaders.Add(“X-Company-Login”, companyName);
.DefaultRequestHeaders.Add(“X-Token”, adminToken);
adminClient = new JsonRpcHttpClient(new Uri(“https://user-api.simplybook.me/admin”), adminHttpClient);
bookings = await adminClient.Invoke(“getStatuses”);
////
I am able to get an token back from the getUserToken call, but when attempting to access “Admin APIs” using that token, everything comes back with “access denied”.
Any assistance would be appreciated.