Reputation: 121
I'm trying to upload a photo from my pc to my instagram page but it keeps giving me a "ProcessingFailedError".
Heres all the code I'm using to try and upload. Its meant to be a small program. Heres the Github for the API: https://github.com/ramtinak/InstagramApiSharp
using InstagramApiSharp;
using InstagramApiSharp.API;
using InstagramApiSharp.Classes;
using InstagramApiSharp.API.Builder;
using InstagramApiSharp.Logger;
using InstagramApiSharp.Classes.Models;
namespace HH_to_Insta
{
class Program
{
public static UserSessionData userSession = new UserSessionData
{
UserName = "USERNAME",
Password = "PASSWORD"
};
public static IInstaApi api = InstaApiBuilder.CreateBuilder()
.SetUser(userSession)
.UseLogger(new DebugLogger(LogLevel.All))
.Build();
static void Main(string[] args)
{
if (!Login().Result)
{
return;
}
var mediaImage = new InstaImageUpload
{
// leave zero, if you don't know how height and width is it.
Height = 0,
Width = 0,
Uri = @"C:\Users\email\Desktop\Hardware Hub\logo data\instagram_profile_image.png"
};
api.MediaProcessor.UploadPhotoAsync(mediaImage, "Test Success!").Wait();
}
public static async Task<bool> Login()
{
if (!api.IsUserAuthenticated)
{
// login
Console.WriteLine($"Logging in as {userSession.UserName}");
var logInResult = await api.LoginAsync();
if (!logInResult.Succeeded)
{
Console.WriteLine($"Unable to login: {logInResult.Info.Message}");
return false;
}
}
return true;
}
The Exact Error:
1/17/2021 12:28:11 AM: Response: POST https://i.instagram.com/rupload_igphoto/1610864891188_0_227063345 [BadRequest]
1/17/2021 12:28:11 AM: Content:
1/17/2021 12:28:11 AM: {"debug_info":{"retriable":false,"type":"ProcessingFailedError","message":"Request processing failed"}}
Upvotes: 1
Views: 1849
Reputation: 346
I don't know if you're still looking for an answer to this question, but I had the same problem and the solution was:
The Instagram account you're publishing has to be an Instagram Business Account (which is pretty easy to switch your account to)
You can only upload .jpeg files. Any other filetype will give a "Request processing failed" error.
Upvotes: 5