UploadAsync
tried to upload file using uploadasync we are getting an error grant_type is unatuthorzed to this client_id. may i know what we are missing.
var config = new BoxConfigBuilder("mm9idicrsyd6qmsdfdsfsdsdfwemk2", "dsfdsfsdfrewewrwe").Build();
var session = new OAuthSession("kljkjsdfdsfsdfsdfsdfsfs", "NOT_NEEDED", 3600, "bearer");
var client = new BoxClient(config, session);
//var x = client.FoldersManager.GetFolderItemsAsync("0", 500).Result;
using (FileStream stream = new FileStream(@"d:\pdfchkfile2.pdf", FileMode.Open))
{
BoxFileRequest req = new BoxFileRequest()
{
Name = "example.pdf",
Parent = new BoxRequestEntity() { Id = "0" }
};
var newFile = client.FilesManager.UploadAsync(req, stream).Result;
}
-
I noticed that this error 'The grant type is unauthorized for this client_id' appears when you change some settings in Dev Console, save changes, but still use the old access token. Each settings change requires generating and using new developer token. Let me know if this was this your case - generate new developer token, try to use it and let me know if it helped.
投稿コメントは受け付けていません。
コメント
9件のコメント