How can I capture Direct Message via Instagram API?

I searched apari instagram if there is any method for returning direct messages and did not find anything. Can you tell if there is something, or if it is not possible? Instagram does not offer? Or can I do it programmatically? I need to capture a direct message, maybe?

+4
source share
3 answers

There are no Instagram APIs for direct messages, and since almost 4 years have passed, I think they will not be. You can use Instagram node.js Private API or Instagram Library PHP Private API .

I must warn you, however, that I tried to use the PHP library and Instagram did not allow sending direct messages, no matter how many hackers I tried to get it to work. But maybe it was just me ...

If you can use node.js, it seems that Thread.configureText can be used to send direct messages to the node.js library.

+4
source

Use the private Instagram API. Thanks to this, you can send a direct message. I did it in C # and it worked perfectly. (Direct message and message to send as well.)

0
source
string status_DM = string.Empty;
string Url_DirectMessage = "https://i.instagram.com/api/v1/direct_v2/threads/broadcast/text/";
string guid = obj_InstaUser.guid;
string userID = string.Empty;  // put user id to whom you want to send message

string responce = obj_new.getHtmlfromUrl(new Uri("https://www.instagram.com/" + username));

if(string.IsNullOrEmpty(userID))
{
    userID = Utils.getBetween(responce, "profilePage_", "}").Replace(" ","").Replace("\"","");
}
try
{
    string postData = "recipient_users=%5B%5B%22" + userID + "%22%5D%5D&client_context=%22" + guid + "%22&text=" + text + "&thread_ids=%5B%220%22%5D";
    try
    {
        string  Finalresult = obj_InstaUser.globusHttpHelperMobile.postFormDataMobileLogin_Directmessage(new Uri(Url_DirectMessage), postData);

        status_DM = "Success";
    }
    catch (Exception ex)
    {

        status_DM = "Fail";
    }
}
catch(Exception ex)
{

}
0
source

All Articles