When I use the Docebo API explorer to test the creation of a branch using:
{"code":"TEST001",
"id_parent":1}
the response I get (which I expect) is “Bad Request” and message “Branch code already exists”
But when I call the endpoint from my application with this code (modified to not expose our endpoint):
values = new Dictionary<string, string>();
values.Add("code", "TEST001");
values.Add("id_parent", "1");
content = new FormUrlEncodedContent(values);
response = await client.PostAsync("https://endpoint/manage/v1/orgchart", content);
if (response.StatusCode != HttpStatusCode.OK)
{
Console.WriteLine("ERROR: returned " + response.ReasonPhrase + "\n");
}
I get StatusCode: “Bad Requst” and ReasonPhrase “Bad Request”.
I have made lots of calls (including POST) to other Docebo API endpoints, but I have not been able to get anything sensible out of my POSTs to manage/v1/orgchart. What am I doing wrong?
Thanks for your help!