I use the following code to post photos directly to Instagram But it gives error challenge_required. Where do you think the problem is?
private async void btn_i_s_Click(object sender, EventArgs e)
{
var inbox = await ctx.api.MessagingProcessor.GetDirectInboxAsync(PaginationParameters.MaxPagesToLoad(1));
var threadId = inbox.Value.Inbox.Threads.FirstOrDefault(i => i.Title == txt_u_p.Text).ThreadId;
OpenFileDialog op = new OpenFileDialog();
op.ShowDialog();
var imageUp = new InstaImage()
{
Uri = op.FileName
};
var image = await ctx.api.MessagingProcessor.SendDirectPhotoAsync(imageUp, threadId);
if (image.Succeeded)
{
MessageBox.Show("Sended ...");
}
else
{
MessageBox.Show(image.Info.Message);
}
}