Skip to content

Commit 07028ac

Browse files
sbhat222meta-codesync[bot]
authored andcommitted
Add Send message with Human agent tag
Summary: **Summary** * Add API with HUMAN_AGENT tag Differential Revision: D87749832 fbshipit-source-id: 119ddd7ad182638e1a5322cc3a132db1232ce36d
1 parent 73b0ec8 commit 07028ac

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

postman/instagram-platform-api.postman_collection.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,6 +1326,38 @@
13261326
"description": "# Send Message with a published post\n\nTo send a message that contains an app user's Instagram post, send a `POST` request to the `//messages` endpoint with the `recipient` parameter containing the Instagram-scoped ID () and the `message` parameter containing an `attachment` object with the `type` set to `MEDIA_SHARE` and `payload` containing the Meta ID for the post.\n\nThe app user must own the post to be used in the message. Learn how to \n\n[Learn how to fetch the media owned by the business.](https://developers.facebook.com/docs/instagram/platform/instagram-api/get-started#get-the-instagram-professional-account-s-media-objects)\n\n## HTTP Method\n\n`POST`\n\n## Endpoint\n\n`https://graph.instagram.com/{{api_version}}/{{ig_user_id}}/messages`\n\n## Request Parameters\n\n### Body\n\nThe request body must be in JSON format and includes the following parameters:\n\n- **recipient** (object): This object specifies the recipient of the message.\n \n - **id** (string): The unique identifier of the recipient (Instagram user) to whom the message will be sent. This should be the `{{ig_scoped_id}}`.\n \n- **message** (object): This object contains the message details.\n \n - **attachment** (object): This object specifies the type of attachment included in the message.\n \n - **type** (string): The type of the attachment. For this request, it should be set to `\"MEDIA_SHARE\"`.\n \n - **payload** (object): This object contains the details of the attachment.\n \n - **id** (string): The unique identifier of the media post being shared. This should be the `{{post_id}}`.\n \n\n### Example Request Body\n\n``` json\n{\n \"recipient\": {\n \"id\": \"{{ig_scoped_id}}\"\n },\n \"message\": {\n \"attachment\": {\n \"type\": \"MEDIA_SHARE\",\n \"payload\": {\n \"id\": \"{{post_id}}\"\n }\n }\n }\n}\n\n ```\n\n## Expected Response\n\nUpon a successful request, the API will return a response with the following structure:\n\n- **recipient_id** (string): The ID of the recipient to whom the message was sent.\n \n- **message_id** (string): The ID of the sent message.\n \n\n### Example Response\n\n``` json\n{\n \"recipient_id\": \"{{ig_scoped_id}}\",\n \"message_id\": \"\"\n}\n\n ```\n\n## Notes\n\n- Ensure that the `{{api_version}}`, `{{ig_user_id}}`, `{{ig_scoped_id}}`, and `{{post_id}}` placeholders are replaced with valid values before making the request.\n \n- A successful response will have a status code of `200`.\n \n- If the request fails, appropriate error messages will be returned based on the issue encountered.\n \n\nThis API is useful for developers looking to integrate messaging capabilities within their applications, allowing for seamless communication with Instagram users."
13271327
},
13281328
"response": []
1329+
},
1330+
{
1331+
"name": "Send a message with HUMAN_AGENT tag",
1332+
"request": {
1333+
"method": "POST",
1334+
"header": [],
1335+
"body": {
1336+
"mode": "raw",
1337+
"raw": "{\n \"recipient\": {\n \"id\": \"{{ig_scoped_id}}\"\n },\n \"message\": {\n \"text\": \"Your doctor visit is scheduled\"\n },\n \"tag\": \"HUMAN_AGENT\"\n}",
1338+
"options": {
1339+
"raw": {
1340+
"language": "json"
1341+
}
1342+
}
1343+
},
1344+
"url": {
1345+
"raw": "https://graph.instagram.com/{{api_version}}/{{ig_user_id}}/messages",
1346+
"protocol": "https",
1347+
"host": [
1348+
"graph",
1349+
"instagram",
1350+
"com"
1351+
],
1352+
"path": [
1353+
"{{api_version}}",
1354+
"{{ig_user_id}}",
1355+
"messages"
1356+
]
1357+
},
1358+
"description": "`HUMAN_AGENT` – When this tag is added to a message being sent to a person, it allows a human agent to respond to the person's message. Messages can be sent within 7 days of the person's message. Human agent support is for issues that cannot be resolved within the standard messaging window.\n\n- Apps will need to apply for the `Human Agent` permission via the Developer App dashboard. Navigate to App dashboard -> App review -> Permissions & Features -> Human Agent. Apps that were previously approved for beta access to the Human Agent permission do not need to re-apply for access.\n \n\n#### Allowed Usages\n\n- Human agent support for issues that cannot be resolved within the 24 hour standard messaging window, such as resolving issues outside normal business hours or issues requiring more than 24 hours to resolve\n \n\n#### Disallowed Usages (non-exhaustive)\n\n- Automated messages\n \n- Content unrelated to user inquiry"
1359+
},
1360+
"response": []
13291361
}
13301362
],
13311363
"description": "The Send API enables your app users to send and receive messages between their Instagram professional account and their customers, potential customers, and followers.\n\n#### An Instagram user sends a message\n\nConversations only begin when an Instagram user sends a message to your app user through your app user's Instagram Feed, posts, story mentions, and other channels.\n\n#### Instagram Inbox\n\nAn Instagram professional account has a messaging inbox that allows the user to organize messages and control message notifications however when using the API the behavior will be a little different.\n\n- **General** – Only after your app user to respond to a message, using your app, is the conversation moved to the General folder, regardless of the inbox settings.\n \n- **Primary** – All new conversations from followers will initially appear in the Primary folder.\n \n- **Requests** – All new conversations from Instagram users who aren't followers of your app user will appear in the Requests folder.\n \n\n[Learn more about the Instagram Inbox.](https://www.facebook.com/business/help/1264898753662278)\n\n### Before You Start\n\nYou will need:\n\n- An access token requested by the IG professional account who can send message to a user on the platform\n \n- The `instagram_business_manage_messages` permission\n \n- The message recipient user must have sent a message to your IG professional account\n \n\n## Environment\n\nThis collection has a corresponding **Instagram Platform API** Postman [environment](https://learning.postman.com/docs/sending-requests/managing-environments/) which you must select when using the collection. Set **current values** for the variables defined in this environment if you wish to perform the queries in the collection.\n\n### Access tokens\n\nThe API supports both user and system user access tokens. You can get access tokens 3 different ways:\n\n- [Facebook login](https://developers.facebook.com/docs/facebook-login/overview) for your app\n \n- [App Dashboard](https://developers.facebook.com/apps)\n \n- [Graph API Explorer](https://developers.facebook.com/tools/explorer/)\n \n\n### Limitations\n\n- Your app user must own any media or posts to be used in the message.\n \n- Group messaging is not supported. An Instagram professional account can only converse with one customer per conversation.\n \n- Messages in the Requests folder that have not been active for 30 days will not be returned in API calls.\n \n- Only the URL for the shared media or post is included in the webhooks notification when a customer sends a message with a share.\n \n- Your app testers must have a role on your app, grant your app access to all the required permissions, and have a role on the Instagram professional account that owns the app."

0 commit comments

Comments
 (0)