I am using InstaSharp to try and get a user's latest media posts. I am getting error:
{"Exception has been thrown by the target of an invocation."}
Here is my code:
public async Task<string> GetUserRecentMedia(string userId)
{
string response = string.Empty;
try
{
InstagramConfig config = new InstagramConfig(ClientId, ClientSecret, RedirectUri, string.Empty);
Users usersEndpoints = new Users(config);
response = ConvertToJson(usersEndpoints.Recent(userId));
}
catch (Exception ex) { }
return response;
}