This is a method I wrote with c# that uses the post request to create a new document on CS :
public async Task<string> CreateDocumentAsync(string fileName)
{
var values = new Dictionary<string, string>
{
{ "type", "144" },
{ "parent_id", "2000" },
{ "name", fileName },
{ "file", @"C:\Users\blabla\Documents\New Text Document.txt"},
};
client.DefaultRequestHeaders.Add("otcsticket", _ticket);
var content = new FormUrlEncodedContent(values);
var response = await client.PostAsync("http://opentext-test.blabla.co.il/otcs/cs.exe/api/v1/nodes", content);
var responseString = await response.Content.ReadAsStringAsync();
return responseString;
}
Whenever I run the code I always get bad request (400). Whenever I use this post request postman it works fine.
I'm not sure that on what value does the "file" key suppose to get?