Updated on 2025-11-13 GMT+08:00

Pushing an Instagram Message

Scenario

This interface is invoked to push a social media message.

Method

POST

URI

https://Domain name/apiaccess/api/instagram/message/{chanId} (For example, the domain name is service.besclouds.com.)

In the URI, {chanId} indicates the channel ID, which is optional.

Request Description

Table 1 Request body parameters

No.

Parameter

Type

Mandatory or Not

Description

1

requestBody

Object

Yes

Request body in JSON format

1.1

Object

String

No

Social media name, for example, instagram or viber

1.2

entry

Array [Object]

No

Event array

1.2.1

id

String

No

Account or page ID

1.2.2

time

Number

No

Update time

1.2.3

messaging

Array [Object]

No

Message details

1.2.3.1

sender

Object

No

Message sender information

1.2.3.1.1

id

String

No

Message sender ID

1.2.3.2

recipient

Object

No

Message recipient information

1.2.3.2.1

id

String

No

Recipient ID

1.2.3.3

timestamp

Number

No

Message creation time

1.2.3.4

message

Object

No

Message content

1.2.3.4.1

mid

String

No

Message ID

1.2.3.4.2

text

String

No

Message text

1.2.3.4.3

attachments

Array [Object]

No

Attachment array

1.2.3.4.3.1

type

String

No

Attachment type. The options are audio, image, file, and video.

1.2.3.4.3.2

payload

Object

No

Attachment load information

1.2.3.4.3.2.1

url

String

No

Attachment URL

1.2.3.4.4

is_deleted

Boolean

No

Whether the message is deleted

1.2.3.4.5

is_echo

Boolean

No

Whether the message is sent by an agent

  • true: The message is sent by an agent.
  • False: The message is sent by a customer.

1.2.3.4.6

is_unsupported

Boolean

No

Whether the message sent by a customer contains unsupported media

1.2.3.4.7

quick_reply

Object

No

Quick reply object

1.2.3.4.7.1

payload

String

No

Quick reply load

1.2.3.4.8

referral

Object

No

Included when a customer clicks an Instagram Shop product

1.2.3.4.8.1

product

Object

No

Product object

1.2.3.4.8.1.1

id

String

No

Product ID

1.2.3.4.9

reply_to

Object

No

Reply message load

1.2.3.4.9.1

story

Object

No

Reply message object

1.2.3.4.9.1.1

url

String

No

Media URL

1.2.3.4.9.1.2

id

String

No

Reply text message ID

1.2.3.4.9.2

mid

String

No

Reply message object ID

Response Description

  • Status code: 200
  • Status code: 400

    Incorrect request. Check the request path and parameters.

  • Status code: 401

    Unauthorized operation. 1. Check whether you have purchased related services. 2. Contact customer service to check the status of your account.

  • Status code: 404

    The requested content is not found. Check the request path.

  • Status code: 500

    Business failure. Check the values of parameters in the request.

Error Codes

None

Example

Request parameters:

{
  "object": "instagram",
  "entry": [
    {
      "id": "IGID",
      "time": 1569262486134,
      "messaging": [
        {
          "sender": {
            "id": "IGSID"
          },
          "recipient": {
            "id": "IGID"
          },
          "timestamp": 1569262485349,
          "message": {
            "mid": "MESSAGE-ID",
            "text": "MESSAGE-TEXT",
            "attachments": [
              {
                "type": "image",
                "payload": {
                  "url": "LINK"
                }
              }
            ],
            "is_deleted": true,
            "is_echo": true,
            "is_unsupported": true,
            "quick_reply": {
              "payload": "CUSTOMER-RESPONSE-PAYLOAD"
            },
            "referral": {
              "product": {
                "id": "PRODUCT-ID"
              }
            },
            "reply_to": {
              "mid": "MESSAGE-ID"
            },
            "reply_to": {
              "story": {
                "url": "CDN-URL",
                "id": "STORY-ID"
              }
            }
          }
        }
      ]
    }
  ]
}
Response parameters:
{"resultMsg": "200"}