Instagram-private-api: IgActionSpamError when send DM

Created on 16 Feb 2020  路  4Comments  路  Source: dilame/instagram-private-api

Hi all.

Form

Question

I have this error when try to send DM.

IgActionSpamError: POST /api/v1/direct_v2/threads/broadcast/text/ - 400 Bad Request; feedback_required at Request.handleResponseError (/Users/sergey/RubymineProjects/node/instagenius-instagram-scraper/node_modules/instagram-private-api/dist/core/request.js:98:20) at Request.send (/Users/sergey/RubymineProjects/node/instagenius-instagram-scraper/node_modules/instagram-private-api/dist/core/request.js:52:28) at async DirectThreadRepository.broadcast (/Users/sergey/RubymineProjects/node/instagenius-instagram-scraper/node_modules/instagram-private-api/dist/repositories/direct-thread.repository.js:176:26) at async DirectThreadEntity.broadcast (/Users/sergey/RubymineProjects/node/instagenius-instagram-scraper/node_modules/instagram-private-api/dist/entities/direct-thread.entity.js:180:26) at async DirectThreadEntity.broadcastText (/Users/sergey/RubymineProjects/node/instagenius-instagram-scraper/node_modules/instagram-private-api/dist/entities/direct-thread.entity.js:25:16) at async Device.sendMessage (/Users/sergey/RubymineProjects/node/instagenius-instagram-scraper/services/device.js:115:7) at async SendMessages._sendMessage (/Users/sergey/RubymineProjects/node/instagenius-instagram-scraper/services/instagram/send-messages.js:88:22) at async SendMessages.call (/Users/sergey/RubymineProjects/node/instagenius-instagram-scraper/services/instagram/send-messages.js:79:5) at async /Users/sergey/RubymineProjects/node/instagenius-instagram-scraper/services/jobs.init.js:32:7

Looks like it is API block.
I try to send 4 DM per hour.
Maybe someone know how to resolve this block?

Here my code maybe I did something wrong?

async sendMessage(user) {
    try {
      await this.ig.entity.directThread([user.id.toString()]).broadcastText(`Hi ${user.username}!  test text`)
      console.log('message was sent to', user.id, user.username  )
    } catch (e) {
      console.error('Device#sendMessage Error', e.message)
      throw e
    }
  }
API Block question

Most helpful comment

I can send one direct message. But when I try send next message to another user I get this error.

All 4 comments

You're probably doing other things with the account. The error is just showing up once you send a message.

I can send one direct message. But when I try send next message to another user I get this error.

@serg2801 Hi I am going to code a script to send out multiple direct messages per day. Can I see your code? Would same me so much time as I will end up coding the same thing!

Hi @alexrmacleod

async sendMessage(user) {
    try {
      await this.ig.entity.directThread([user.id.toString()]).broadcastText(`Hi ${user.username}! I\'m really sorry but i need to spam you!!! Don\'t block me!!! :)`)
      console.log('send message to', user.id, user.username)
    } catch (e) {
      console.error('Device#sendMessage Error', e.name, e.message)
      if (e instanceof IgLoginRequiredError) {
        await this.login()
        return this.sendMessage(user)
      }
      if (e instanceof IgCheckpointError) {
        sentryHelper.sendNotification(e, this.username)
      }
      if (e instanceof IgNotFoundError) return null
      throw e
    }
  }

It is my method for send DM. But my accounts were blocked after I sent few messages. and we took a break from this work for now. if you have progress in this let me know please.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sagardalal21 picture sagardalal21  路  39Comments

350d picture 350d  路  53Comments

iMrDJAi picture iMrDJAi  路  34Comments

delmotte picture delmotte  路  61Comments

DenisKrsk picture DenisKrsk  路  33Comments