# 99 Digital Facebook API — complete documentation Generated: 2026-11-29T20:03:58.741Z Canonical documentation: https://docs.99digital.co.il/facebook-api Documentation index: https://docs.99digital.co.il/facebook-api/llms.txt > This file is generated from every public page of the Facebook API documentation during the production build. Do not edit it manually. --- # Facebook API Source: https://docs.99digital.co.il/facebook-api Markdown: https://docs.99digital.co.il/markdown/facebook-api.md Section: Facebook API Publish and manage posts and comments on your Facebook Pages and Instagram accounts. ## Base URL ```text https://api.99digital.co.il ``` Facebook Page endpoints are under `/facebook/page/` and Instagram endpoints under `/instagram/page/`. ## Authentication Every request is a `POST` with a JSON body. Send your API key in the `apiKey` header, and the ID of your connection in `from`: ```http apiKey: Content-Type: application/json ``` ## Where to start - Facebook Pages: [Create Post](https://docs.99digital.co.il/facebook-api/facebook-pages/create-post), [All Posts](https://docs.99digital.co.il/facebook-api/facebook-pages/all-posts) and [All Comments](https://docs.99digital.co.il/facebook-api/facebook-pages/all-comments). - Instagram: [Create Post](https://docs.99digital.co.il/facebook-api/instagram-pages/create-post), [All Posts](https://docs.99digital.co.il/facebook-api/instagram-pages/all-posts) and [All Comments](https://docs.99digital.co.il/facebook-api/instagram-pages/all-comments). - Try every endpoint in Postman: [Postman Collection](https://docs.99digital.co.il/facebook-api/postman-collection). --- # Postman Collection Source: https://docs.99digital.co.il/facebook-api/postman-collection Markdown: https://docs.99digital.co.il/markdown/facebook-api/postman-collection.md Section: Facebook API [Download the Postman collection for the Facebook API](https://api.99digital.co.il/facebook-postman). The Postman collection is always updated with every change to the API, so make sure you always download the latest version. To use it, select **Import** in Postman and choose the downloaded file. Then, in the collection's **Variables** tab, fill in `apiKey` and the connection IDs you received — `from_fb_page` for Facebook Pages and `from_ig_page` for Instagram — and replace the sample media links with your own public `https` links. --- # All Posts Source: https://docs.99digital.co.il/facebook-api/facebook-pages/all-posts Markdown: https://docs.99digital.co.il/markdown/facebook-api/facebook-pages/all-posts.md Section: Facebook API › Facebook Pages `POST https://api.99digital.co.il/facebook/page/getPosts` This endpoint allows you to see all the posts in your page (posts that were created by the API or directly on Facebook). **Settings**: | Setting | Value | | --- | --- | | URL | `https://api.99digital.co.il/facebook/page/getPosts` | | Method | JSON via POST | | Header | Your API key for the service (the `apiKey` header) | **Body**: | Parameter | Description / Example | Mandatory | Example | | --- | --- | --- | --- | | from | The ID you received for the connection | yes | 463745743546345 | | limit | How many posts to get (limit pagination), between 1 and 100. Default if not provided: 25 | no | 25 | | after | If you are using limit paging, you can provide the "after" value from the previous response to load the next batch | no | U56WDF34FA4TER3DA..... | **Response**: ```json { "status": "OK", "from": "463745743546345", "count": 25, "posts": [{ "id": "119324881085321_122093459712345", "message": "Hello fans!", "created_time": 1783596120, "updated_time": 1783596120, "permalink_url": "https://www.facebook.com/...", "full_picture": "https://scontent...", "is_published": true, "shares": 3, "total_comments": 3, "total_reactions": 5, "attachments": { "data": [ { "media_type": "photo", "url": "..." } ] } }], "paging": { "after": "QVFIU...", "hasNext": true }, "reason": 1 } ``` **Response-Explain**: | Parameter | Description | | --- | --- | | status | OK or FAIL | | count | Total posts in this batch | | from | Your ID for the service | **posts** and **paging**: | Value | Information | | --- | --- | | id | This is the postId | | message | The body of the post | | created_time | Post create time. UNIX UTC timestamp (int seconds) | | updated_time | If the post was edited, this is the time. More exactly, it is the last time the post was updated: when it was created, edited or commented on. UNIX UTC timestamp (int seconds) | | permalink_url | Link directly to the post | | full_picture | Image that you provided for the post, if any | | is_published | true - the post is live in the page. false - this is a scheduled future post and not published yet | | scheduled_publish_time | Will only appear if "is_published" = false. This will show the future UNIX timestamp for when the post will be published | | shares | The total amount of shares this post has (int) | | total_comments | The total amount of comments this post has (int). For getting the actual comments, use the [All Comments](https://docs.99digital.co.il/facebook-api/facebook-pages/all-comments) (getComments) API endpoint | | total_reactions | The total reactions (like) for the post | | attachments | An array of objects that contains media_type and url, to provide all the media that was uploaded for the post (photos/videos) | | paging | Key that contains two values: "after", which represents the parameter to send if you wish to get the next batch, and "hasNext", which is true if you have more data to load, or false if this is the last data | **reason**: | Value | Information | | --- | --- | | 1 | Not FAIL. The status is OK | | 2 | Your "from" account does not exist (or is missing), or JSON syntax error | | 3 | Wrong apiKey (the apiKey header is missing or wrong) | | 6 | Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Facebook posts endpoint) | | 7 | Onboarding is still in progress (the connection is not active) | | 10 | You must do the onboarding again, the connection has expired | | 12 | Rate limit error. Too many requests. Please wait a few minutes and try again | | 13 | The postId is invalid or wrong: the Page or post was not found, or you have no access to it | | 15 | The content you posted was rejected by Meta, or bad media / format / size, or an invalid parameter. It could also indicate a policy violation inside the content | | 18 | General error, try again | **Remarks**: - The list also holds the posts you scheduled that are not published yet (`is_published` is `false`). The scheduled posts come first, in the first batch only, on top of `limit`. - Posts that visitors write on your Page are not part of the list. ## Authentication `apiKey` in the header — Your API key for the service. ## Request body Content type: `application/json` (required) | Field | Type | Required | Description | | --- | --- | --- | --- | | `from` | string | Yes | The ID you received for the connection. Example: `463745743546345`. | | `limit` | integer | No | How many posts to get (limit pagination), between 1 and 100. Default if not provided: 25. Default: `25`. Minimum: 1. Maximum: 100. Example: `25`. | | `after` | string | No | If you are using limit paging, you can provide the `after` value from the previous response (`paging.after`) to load the next batch. Example: `QVFIUmRfZA2xYzRkNmJmWjNh`. | ### Example: First batch The latest 25 posts of your Page. ```json { "from": "463745743546345", "limit": 25 } ``` ### Example: Next batch The next 25 posts — `after` is `paging.after` from the previous response. ```json { "from": "463745743546345", "limit": 25, "after": "QVFIUmRfZA2xYzRkNmJmWjNh" } ``` ## Responses ### 200 — The request was processed. Both a successful and a failed request answer with HTTP 200 — check `status`, and `reason` when it is FAIL. Content type: `application/json` | Field | Type | Description | | --- | --- | --- | | `status` | string | (one of: OK) OK or FAIL. `OK` — the request succeeded, and the posts of this batch are in `posts`. Always `OK`. | | `from` | string | (one of: OK) Your ID for the service. Example: `463745743546345`. | | `count` | integer | (one of: OK) Total posts in this batch. Example: `25`. | | `posts` | array of object | (one of: OK) The posts of this batch. Empty when there are none. | | `posts[].id` | string | (one of: OK) This is the `postId`, for [Edit Post](https://docs.99digital.co.il/facebook-api/facebook-pages/edit-post), [Delete Post](https://docs.99digital.co.il/facebook-api/facebook-pages/delete-post), [All Comments](https://docs.99digital.co.il/facebook-api/facebook-pages/all-comments) and [Create Comment](https://docs.99digital.co.il/facebook-api/facebook-pages/create-comment). Example: `119324881085321_122093459712345`. | | `posts[].message` | string | (one of: OK) The body of the post. Empty when the post has no text. Example: `Hello fans!`. | | `posts[].created_time` | integer | (one of: OK) Post create time. UNIX UTC timestamp (int seconds). Example: `1783596120`. | | `posts[].updated_time` | integer | (one of: OK) If the post was edited, this is the time. More exactly, it is the last time the post was updated: when it was created, edited or commented on. UNIX UTC timestamp (int seconds). Example: `1783596120`. | | `posts[].permalink_url` | string | (one of: OK) Link directly to the post. | | `posts[].full_picture` | string | (one of: OK) Image that you provided for the post, if any (empty otherwise). | | `posts[].is_published` | boolean | (one of: OK) `true` — the post is live in the page. `false` — this is a scheduled future post and not published yet. | | `posts[].scheduled_publish_time` | integer | (one of: OK) Will only appear if `is_published` is `false`. This will show the future UNIX timestamp for when the post will be published. Example: `1786000000`. | | `posts[].shares` | integer | (one of: OK) The total amount of shares this post has (int). Example: `3`. | | `posts[].total_comments` | integer | (one of: OK) The total amount of comments this post has (int). For getting the actual comments, use the [All Comments](https://docs.99digital.co.il/facebook-api/facebook-pages/all-comments) (getComments) API endpoint. Example: `3`. | | `posts[].total_reactions` | integer | (one of: OK) The total reactions (like, and all other reactions) for the post. Example: `5`. | | `posts[].attachments` | object | (one of: OK) An array of objects that contains `media_type` and `url`, to provide all the media that was uploaded for the post (photos/videos), in `data`. Appears only when the post has media. | | `posts[].attachments.data` | array of object | (one of: OK) The media items, each with its `media_type` and `url`. | | `posts[].attachments.data[].media_type` | string | (one of: OK) The kind of media, for example `photo` or `video`. | | `posts[].attachments.data[].url` | string | (one of: OK) Link to the media. | | `paging` | object | (one of: OK) Key that contains two values: `after`, which represents the parameter to send if you wish to get the next batch, and `hasNext`, which is true if you have more data to load, or false if this is the last data. | | `paging.after` | string | (one of: OK) The parameter to send (as `after`) if you wish to get the next batch. Example: `QVFIUmRfZA2xYzRkNmJmWjNh`. | | `paging.hasNext` | boolean | (one of: OK) `true` if you have more data to load, or `false` if this is the last data. | | `reason` | integer | (one of: OK) 1 — not FAIL, the status is OK. Always `1`. | | `status` | string | (one of: FAIL) FAIL — the request was not carried out. `reason` says why. Always `FAIL`. | | `reason` | integer | (one of: FAIL) The status explanation in case of FAIL. One of: `2` — Your "from" account does not exist (or is missing), or JSON syntax error; `3` — Wrong apiKey (the apiKey header is missing or wrong); `6` — Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Facebook posts endpoint); `7` — Onboarding is still in progress (the connection is not active); `10` — You must do the onboarding again, the connection has expired; `12` — Rate limit error. Too many requests. Please wait a few minutes and try again; `13` — The postId is invalid or wrong: the Page or post was not found, or you have no access to it; `15` — The content you posted was rejected by Meta, or bad media / format / size, or an invalid parameter. It could also indicate a policy violation inside the content; `18` — General error, try again. | | `from` | string | (one of: FAIL) Your ID for the service. Returned when Meta rejected the request (reason 10 and above). Example: `463745743546345`. | #### Example: OK A scheduled post (always listed first) and a published post with a photo. ```json { "status": "OK", "from": "463745743546345", "count": 2, "posts": [ { "id": "119324881085321_122093459799999", "message": "Our summer sale starts next week!", "created_time": 1783600000, "updated_time": 1783600000, "permalink_url": "https://www.facebook.com/119324881085321/posts/122093459799999", "full_picture": "", "is_published": false, "scheduled_publish_time": 1786000000, "shares": 0, "total_comments": 0, "total_reactions": 0 }, { "id": "119324881085321_122093459712345", "message": "Hello fans!", "created_time": 1783596120, "updated_time": 1783603417, "permalink_url": "https://www.facebook.com/119324881085321/posts/122093459712345", "full_picture": "https://scontent.xx.fbcdn.net/v/t39.30808-6/photo.jpg", "is_published": true, "shares": 3, "total_comments": 3, "total_reactions": 5, "attachments": { "data": [ { "media_type": "photo", "url": "https://www.facebook.com/photo.php?fbid=122093459712345" } ] } } ], "paging": { "after": "QVFIUmRfZA2xYzRkNmJmWjNh", "hasNext": true }, "reason": 1 } ``` #### Example: Reason 3 Wrong apiKey. ```json { "status": "FAIL", "reason": 3 } ``` #### Example: Reason 6 Wrong connection type — this is not a Facebook Pages connection. ```json { "status": "FAIL", "reason": 6 } ``` #### Example: Reason 10 The connection has expired — do the onboarding again. ```json { "status": "FAIL", "reason": 10, "from": "463745743546345" } ``` --- # Create Post Source: https://docs.99digital.co.il/facebook-api/facebook-pages/create-post Markdown: https://docs.99digital.co.il/markdown/facebook-api/facebook-pages/create-post.md Section: Facebook API › Facebook Pages `POST https://api.99digital.co.il/facebook/page/createPost` This endpoint allows you to create a post on your Facebook page. **Settings**: | Setting | Value | | --- | --- | | URL | `https://api.99digital.co.il/facebook/page/createPost` | | Method | JSON via POST | | Header | Your API key for the service (the `apiKey` header) | **Body**: | Parameter | Description / Example | Mandatory | Example | | --- | --- | --- | --- | | from | The ID you received for the connection | yes | 463745743546345 | | type | Can be any of the following: **text** - for creating a post with only text. **video** - if you wish to have a video type post. **photo** - if you wish to have a photo type post. If you leave it out, it is set by "links": no links make a text post, a single link to a video file (.mp4, .mov, .webm, .avi, .3gp or .mkv) a video post, and any other links a photo post | no | text | | body | The body of the post, based on the 'type' value. It can have plain text only (no Markdown or HTML) and `\n` for a line break. If type is 'text', here you put all your post text. If type is 'video', here you put the video description. If type is 'photo', here you put the photo caption. Maximum 63,206 characters | only for 'text' | Welcome to my first Post! | | links | Array of public HTTPS links. Only use if "type" is video or photo. If type is 'video' you must provide 1 link only. If type is 'photo' you can choose if you wish 1 image in the post or an album of up to 10 images | only for 'video' / 'photo' | `["https://example.com/image.jpg","https://example.com/image2.jpg"]` | | title | If 'type' = video, you can provide the video title | no | Here is my video title | | scheduleTime | You can schedule the post to be in a future time. If omitted, the post will publish immediately. UNIX time in seconds. Must be between 11 minutes and 30 days from now | no | 1786000000 | **Response**: ```json { "status": "OK", "postId": "15234562345623_952362434423178", "body": "your message", "timestamp": 1600115719, "from": "463745743546345", "type": "text", "reason": 1 } ``` **Response-Explain**: | Parameter | Description | | --- | --- | | status | OK or FAIL | | postId | The post ID that was created. You can use it for future webhooks / comments / post changes ([Edit Post](https://docs.99digital.co.il/facebook-api/facebook-pages/edit-post), [Delete Post](https://docs.99digital.co.il/facebook-api/facebook-pages/delete-post), [Create Comment](https://docs.99digital.co.il/facebook-api/facebook-pages/create-comment), [All Comments](https://docs.99digital.co.il/facebook-api/facebook-pages/all-comments)) | | body | The text you sent | | timestamp | Time stamp of the message | | from | Your ID for the service | | type | The type of the post that was created: text, photo or video | | photos | Only relevant if photos were used. This will return the amount of photos you provided (int) | | scheduleTime | The future time that you provided, if provided | **reason**: | Value | Information | | --- | --- | | 1 | Not FAIL. The status is OK | | 2 | Your "from" account does not exist (or is missing), or JSON syntax error | | 3 | Wrong apiKey (the apiKey header is missing or wrong) | | 5 | Missing or invalid content: the 'body' (for a text post) or the 'links' (for a photo or video post), or a link that is not https:// | | 6 | Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Facebook posts endpoint) | | 7 | Onboarding is still in progress (the connection is not active) | | 8 | Invalid "type" or "links": a wrong "type", more than 1 link for a video or more than 10 for photos. Also a "body" longer than 63,206 characters, or a "scheduleTime" that is not 11 minutes to 30 days from now | | 10 | You must do the onboarding again, the connection has expired | | 12 | Rate limit error. Too many requests. Please wait a few minutes and try again | | 15 | The content you posted was rejected by Meta, or bad media / format / size, or an invalid parameter. It could also indicate a policy violation inside the content | | 18 | General error / wrong information / unknown error. Please check all the payload again and try again | **Remarks**: - If one photo of an album fails, the photos already uploaded are deleted: nothing is published, and you get the failure's reason. - A scheduled post returns its `postId` right away and goes live at `scheduleTime`. ## Authentication `apiKey` in the header — Your API key for the service. ## Request body Content type: `application/json` (required) | Field | Type | Required | Description | | --- | --- | --- | --- | | `from` | string | Yes | The ID you received for the connection. Example: `463745743546345`. | | `type` | string | No | The kind of post. Can be any of the following: `text`, `video` or `photo`. If you leave it out, it is set by `links`: no links make a text post, a single link to a video file (`.mp4`, `.mov`, `.webm`, `.avi`, `.3gp` or `.mkv`) a video post, and any other links a photo post. One of: `text` — For creating a post with only text; `photo` — If you wish to have a photo type post — one photo, or an album of up to 10 photos; `video` — If you wish to have a video type post — one video. Example: `text`. | | `body` | string | No | The body of the post, based on the `type` value. It can have plain text only (no Markdown or HTML) and `\n` for a line break. If `type` is `text`, here you put all your post text (required). If `type` is `video`, here you put the video description; if `type` is `photo`, here you put the photo caption (optional for both). Maximum 63,206 characters. Max length: 63206. Example: `Welcome to my first Post!`. | | `links` | array of string (uri) | No | Array of public HTTPS links. Only use if `type` is `video` or `photo` (and required for them). If `type` is `video`, you must provide 1 link only. If `type` is `photo`, you can choose if you wish 1 image in the post or an album of up to 10 images. Max items: 10. | | `title` | string | No | If `type` is `video`, you can provide the video title. Example: `Here is my video title`. | | `scheduleTime` | integer | No | You can schedule the post to be in a future time. If omitted, the post will publish immediately. UNIX time in seconds. Must be between 11 minutes and 30 days from now. Example: `1786000000`. | ### Example: Text post A post with only text. ```json { "from": "463745743546345", "type": "text", "body": "Welcome to my first Post!" } ``` ### Example: Photo post A post with one photo; `body` is the caption. ```json { "from": "463745743546345", "type": "photo", "body": "Our new collection is here!", "links": [ "https://example.com/image.jpg" ] } ``` ### Example: Photo album A post with an album of up to 10 photos. ```json { "from": "463745743546345", "type": "photo", "body": "Photos from our launch event", "links": [ "https://example.com/image.jpg", "https://example.com/image2.jpg", "https://example.com/image3.jpg" ] } ``` ### Example: Video post A post with one video; `body` is the description, `title` the video title. ```json { "from": "463745743546345", "type": "video", "body": "A quick tour of our new store.", "title": "Here is my video title", "links": [ "https://example.com/video.mp4" ] } ``` ### Example: Scheduled post A text post that goes live at `scheduleTime` (11 minutes to 30 days from now). ```json { "from": "463745743546345", "type": "text", "body": "Our summer sale starts today!", "scheduleTime": 1786000000 } ``` ## Responses ### 200 — The request was processed. Both a successful and a failed request answer with HTTP 200 — check `status`, and `reason` when it is FAIL. Content type: `application/json` | Field | Type | Description | | --- | --- | --- | | `status` | string | (one of: OK) OK or FAIL. `OK` — the post was created on your Page (or scheduled). Always `OK`. | | `postId` | string | (one of: OK) The post ID that was created. You can use it for future webhooks / comments / post changes. Example: `15234562345623_952362434423178`. | | `type` | string | (one of: OK) The kind of post that was created. One of: `text` — A post with only text; `photo` — A post with one photo or an album; `video` — A post with one video. | | `body` | string | (one of: OK) The text you sent. Left out when you sent no `body`. Example: `Welcome to my first Post!`. | | `photos` | integer | (one of: OK) Only relevant if photos were used. This will return the amount of photos you provided (int). Example: `3`. | | `scheduleTime` | integer | (one of: OK) The future time that you provided, if provided. Example: `1786000000`. | | `timestamp` | integer | (one of: OK) Time stamp of the message (Unix time, in seconds). Example: `1785500000`. | | `from` | string | (one of: OK) Your ID for the service. Example: `463745743546345`. | | `reason` | integer | (one of: OK) 1 — not FAIL, the status is OK. Always `1`. | | `status` | string | (one of: FAIL) FAIL — the request was not carried out. `reason` says why. Always `FAIL`. | | `reason` | integer | (one of: FAIL) The status explanation in case of FAIL. One of: `2` — Your "from" account does not exist (or is missing), or JSON syntax error; `3` — Wrong apiKey (the apiKey header is missing or wrong); `5` — Missing or invalid content: the "body" (for a text post) or the "links" (for a photo or video post), or a link that is not https://; `6` — Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Facebook posts endpoint); `7` — Onboarding is still in progress (the connection is not active); `8` — Invalid "type" or "links": a wrong "type", more than 1 link for a video or more than 10 for photos. Also a "body" longer than 63,206 characters, or a "scheduleTime" that is not 11 minutes to 30 days from now; `10` — You must do the onboarding again, the connection has expired; `12` — Rate limit error. Too many requests. Please wait a few minutes and try again; `15` — The content you posted was rejected by Meta, or bad media / format / size, or an invalid parameter. It could also indicate a policy violation inside the content; `18` — General error / wrong information / unknown error. Please check all the payload again and try again. | | `from` | string | (one of: FAIL) Your ID for the service. Returned when Meta rejected the request (reason 10 and above). Example: `463745743546345`. | #### Example: OK A text post was created. ```json { "status": "OK", "postId": "15234562345623_952362434423178", "type": "text", "body": "Welcome to my first Post!", "timestamp": 1785500000, "from": "463745743546345", "reason": 1 } ``` #### Example: OK — photo album An album post with 3 photos; `photos` is the amount of photos. ```json { "status": "OK", "postId": "15234562345623_952362434423179", "type": "photo", "body": "Photos from our launch event", "photos": 3, "timestamp": 1785500000, "from": "463745743546345", "reason": 1 } ``` #### Example: OK — scheduled A scheduled post; `scheduleTime` is the time it goes live. ```json { "status": "OK", "postId": "15234562345623_952362434423180", "type": "text", "body": "Our summer sale starts today!", "scheduleTime": 1786000000, "timestamp": 1785500000, "from": "463745743546345", "reason": 1 } ``` #### Example: Reason 5 Missing content — no `body` for a text post, or no `links` for a photo or video post. ```json { "status": "FAIL", "reason": 5 } ``` #### Example: Reason 8 Invalid value — for example, two links for a video post, or a `scheduleTime` less than 11 minutes from now. ```json { "status": "FAIL", "reason": 8 } ``` #### Example: Reason 6 Wrong connection type — this is not a Facebook Pages connection. ```json { "status": "FAIL", "reason": 6 } ``` #### Example: Reason 15 Meta rejected the content — bad media, format or size, or a policy violation. ```json { "status": "FAIL", "reason": 15, "from": "463745743546345" } ``` --- # Edit Post Source: https://docs.99digital.co.il/facebook-api/facebook-pages/edit-post Markdown: https://docs.99digital.co.il/markdown/facebook-api/facebook-pages/edit-post.md Section: Facebook API › Facebook Pages `POST https://api.99digital.co.il/facebook/page/editPost` This endpoint allows you to edit a post you previously created (using our API or directly on Facebook). You can't change the media after publish, this endpoint only allows changing the body text. To change the media, delete the post and create a new one. **Settings**: | Setting | Value | | --- | --- | | URL | `https://api.99digital.co.il/facebook/page/editPost` | | Method | JSON via POST | | Header | Your API key for the service (the `apiKey` header) | **Body**: | Parameter | Description / Example | Mandatory | Example | | --- | --- | --- | --- | | from | The ID you received for the connection | yes | 463745743546345 | | postId | The post ID you wish to edit (from [Create Post](https://docs.99digital.co.il/facebook-api/facebook-pages/create-post) or [All Posts](https://docs.99digital.co.il/facebook-api/facebook-pages/all-posts)) | yes | 15625364215_56994166514 | | body | The new body of the post. It replaces the old body. It can have plain text only (no Markdown or HTML) and `\n` for a line break. Maximum 63,206 characters | yes | Welcome to my edited Post! | **Response**: ```json { "status": "OK", "postId": "15234562345623_952362434423178", "timestamp": 1600115719, "from": "463745743546345", "reason": 1 } ``` **Response-Explain**: | Parameter | Description | | --- | --- | | status | OK or FAIL | | postId | The post ID that you changed | | timestamp | Time stamp of the message | | from | Your ID for the service | **reason**: | Value | Information | | --- | --- | | 1 | Not FAIL. The status is OK | | 2 | Your "from" account does not exist (or is missing), or JSON syntax error | | 3 | Wrong apiKey (the apiKey header is missing or wrong) | | 5 | Missing or invalid content: the 'body' is missing or empty | | 6 | Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Facebook posts endpoint) | | 7 | Onboarding is still in progress (the connection is not active) | | 10 | You must do the onboarding again, the connection has expired | | 12 | Rate limit error. Too many requests. Please wait a few minutes and try again | | 13 | The postId is invalid or wrong: the post was not found (for example, it was deleted), or you have no access to it | | 15 | The content you posted was rejected by Meta, or bad media / format / size, or an invalid parameter. It could also indicate a policy violation inside the content | | 18 | General error, try again | ## Authentication `apiKey` in the header — Your API key for the service. ## Request body Content type: `application/json` (required) | Field | Type | Required | Description | | --- | --- | --- | --- | | `from` | string | Yes | The ID you received for the connection. Example: `463745743546345`. | | `postId` | string | Yes | The post ID you wish to edit (from [Create Post](https://docs.99digital.co.il/facebook-api/facebook-pages/create-post) or [All Posts](https://docs.99digital.co.il/facebook-api/facebook-pages/all-posts)). Example: `15625364215_56994166514`. | | `body` | string | Yes | The new body of the post. It replaces the old body. It can have plain text only (no Markdown or HTML) and `\n` for a line break. Maximum 63,206 characters. Max length: 63206. Example: `Welcome to my edited Post!`. | ### Example (generated from the schema) ```json { "from": "463745743546345", "postId": "15625364215_56994166514", "body": "Welcome to my edited Post!" } ``` ## Responses ### 200 — The request was processed. Both a successful and a failed request answer with HTTP 200 — check `status`, and `reason` when it is FAIL. Content type: `application/json` | Field | Type | Description | | --- | --- | --- | | `status` | string | (one of: OK) OK or FAIL. `OK` — the post was changed. Always `OK`. | | `postId` | string | (one of: OK) The post ID that you changed. Example: `15625364215_56994166514`. | | `timestamp` | integer | (one of: OK) Time stamp of the message (Unix time, in seconds). Example: `1785500000`. | | `from` | string | (one of: OK) Your ID for the service. Example: `463745743546345`. | | `reason` | integer | (one of: OK) 1 — not FAIL, the status is OK. Always `1`. | | `status` | string | (one of: FAIL) FAIL — the request was not carried out. `reason` says why. Always `FAIL`. | | `reason` | integer | (one of: FAIL) The status explanation in case of FAIL. One of: `2` — Your "from" account does not exist (or is missing), or JSON syntax error; `3` — Wrong apiKey (the apiKey header is missing or wrong); `5` — Missing or invalid content — the "body" is missing or empty; `6` — Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Facebook posts endpoint); `7` — Onboarding is still in progress (the connection is not active); `10` — You must do the onboarding again, the connection has expired; `12` — Rate limit error. Too many requests. Please wait a few minutes and try again; `13` — The `postId` is invalid or wrong: the post was not found (for example, it was deleted), or you have no access to it; `15` — The content you posted was rejected by Meta, or bad media / format / size, or an invalid parameter. It could also indicate a policy violation inside the content; `18` — General error, try again. | | `from` | string | (one of: FAIL) Your ID for the service. Returned when Meta rejected the request (reason 10 and above). Example: `463745743546345`. | #### Example: OK The post text was changed. ```json { "status": "OK", "postId": "15625364215_56994166514", "timestamp": 1785500000, "from": "463745743546345", "reason": 1 } ``` #### Example: Reason 5 The `body` is empty. ```json { "status": "FAIL", "reason": 5 } ``` #### Example: Reason 13 The post was not found, or you have no access to it. ```json { "status": "FAIL", "reason": 13, "from": "463745743546345" } ``` --- # Delete Post Source: https://docs.99digital.co.il/facebook-api/facebook-pages/delete-post Markdown: https://docs.99digital.co.il/markdown/facebook-api/facebook-pages/delete-post.md Section: Facebook API › Facebook Pages `POST https://api.99digital.co.il/facebook/page/deletePost` This endpoint allows you to delete a post you previously created (using our API or directly on Facebook). :::warning This is a permanent action and can't be undone. ::: **Settings**: | Setting | Value | | --- | --- | | URL | `https://api.99digital.co.il/facebook/page/deletePost` | | Method | JSON via POST | | Header | Your API key for the service (the `apiKey` header) | **Body**: | Parameter | Description / Example | Mandatory | Example | | --- | --- | --- | --- | | from | The ID you received for the connection | yes | 463745743546345 | | postId | The post ID you wish to delete (from [Create Post](https://docs.99digital.co.il/facebook-api/facebook-pages/create-post) or [All Posts](https://docs.99digital.co.il/facebook-api/facebook-pages/all-posts)) | yes | 15625364215_56994166514 | **Response**: ```json { "status": "OK", "postId": "15234562345623_952362434423178", "timestamp": 1600115719, "from": "463745743546345", "reason": 1, "deleted": true } ``` **Response-Explain**: | Parameter | Description | | --- | --- | | status | OK or FAIL | | postId | The post ID that you deleted | | timestamp | Time stamp of the message | | from | Your ID for the service | | deleted | true if the delete was successful. A delete that fails answers with status FAIL and a reason instead, so in an OK response it is always true | **reason**: | Value | Information | | --- | --- | | 1 | Not FAIL. The status is OK | | 2 | Your "from" account does not exist (or is missing), or JSON syntax error | | 3 | Wrong apiKey (the apiKey header is missing or wrong) | | 6 | Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Facebook posts endpoint) | | 7 | Onboarding is still in progress (the connection is not active) | | 10 | You must do the onboarding again, the connection has expired | | 12 | Rate limit error. Too many requests. Please wait a few minutes and try again | | 13 | The postId you provided is invalid or wrong: the post was not found (for example, it was already deleted), or you have no access to it | | 18 | General error, try again | ## Authentication `apiKey` in the header — Your API key for the service. ## Request body Content type: `application/json` (required) | Field | Type | Required | Description | | --- | --- | --- | --- | | `from` | string | Yes | The ID you received for the connection. Example: `463745743546345`. | | `postId` | string | Yes | The post ID you wish to delete (from [Create Post](https://docs.99digital.co.il/facebook-api/facebook-pages/create-post) or [All Posts](https://docs.99digital.co.il/facebook-api/facebook-pages/all-posts)). Example: `15625364215_56994166514`. | ### Example (generated from the schema) ```json { "from": "463745743546345", "postId": "15625364215_56994166514" } ``` ## Responses ### 200 — The request was processed. Both a successful and a failed request answer with HTTP 200 — check `status`, and `reason` when it is FAIL. Content type: `application/json` | Field | Type | Description | | --- | --- | --- | | `status` | string | (one of: OK) OK or FAIL. `OK` — the post was deleted. Always `OK`. | | `postId` | string | (one of: OK) The post ID that you deleted. Example: `15625364215_56994166514`. | | `timestamp` | integer | (one of: OK) Time stamp of the message (Unix time, in seconds). Example: `1785500000`. | | `from` | string | (one of: OK) Your ID for the service. Example: `463745743546345`. | | `reason` | integer | (one of: OK) 1 — not FAIL, the status is OK. Always `1`. | | `deleted` | boolean | (one of: OK) `true` if the delete was successful. A delete that fails answers with status FAIL and a reason instead, so in an OK response it is always `true`. Always `true`. | | `status` | string | (one of: FAIL) FAIL — the request was not carried out. `reason` says why. Always `FAIL`. | | `reason` | integer | (one of: FAIL) The status explanation in case of FAIL. One of: `2` — Your "from" account does not exist (or is missing), or JSON syntax error; `3` — Wrong apiKey (the apiKey header is missing or wrong); `6` — Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Facebook posts endpoint); `7` — Onboarding is still in progress (the connection is not active); `10` — You must do the onboarding again, the connection has expired; `12` — Rate limit error. Too many requests. Please wait a few minutes and try again; `13` — The `postId` you provided is invalid or wrong: the post was not found (for example, it was already deleted), or you have no access to it; `18` — General error, try again. | | `from` | string | (one of: FAIL) Your ID for the service. Returned when Meta rejected the request (reason 10 and above). Example: `463745743546345`. | #### Example: OK The post was deleted. ```json { "status": "OK", "postId": "15625364215_56994166514", "timestamp": 1785500000, "from": "463745743546345", "reason": 1, "deleted": true } ``` #### Example: Reason 13 The post was not found, or you have no access to it. ```json { "status": "FAIL", "reason": 13, "from": "463745743546345" } ``` #### Example: Reason 3 Wrong apiKey. ```json { "status": "FAIL", "reason": 3 } ``` --- # All Comments Source: https://docs.99digital.co.il/facebook-api/facebook-pages/all-comments Markdown: https://docs.99digital.co.il/markdown/facebook-api/facebook-pages/all-comments.md Section: Facebook API › Facebook Pages `POST https://api.99digital.co.il/facebook/page/getComments` This endpoint allows you to see all the comments of a post or a comment in your page (comments that were created by the API or directly on Facebook). **Settings**: | Setting | Value | | --- | --- | | URL | `https://api.99digital.co.il/facebook/page/getComments` | | Method | JSON via POST | | Header | Your API key for the service (the `apiKey` header) | **Body**: | Parameter | Description / Example | Mandatory | Example | | --- | --- | --- | --- | | from | The ID you received for the connection | yes | 463745743546345 | | postId | The post ID you want to get the comments from | no\* | 15625364215_56994166514 | | commentId | The comment ID you wish to get all the comments inside it (its replies) | no\* | 634645636423_5675674565 | | filter | "toplevel" if you wish only top level comments. "stream" if you wish to get everything (the comments and their replies, in one list). Default is "toplevel" | no | toplevel | | order | Options: "chronological" (oldest first), "reverse_chronological" (newest first). Default is "chronological" | no | chronological | | limit | How many comments to get (limit pagination), between 1 and 100. Default if not provided: 25 | no | 25 | | after | If you are using limit paging, you can provide the "after" value from the previous response to load the next batch | no | U56WDF34FA4TER3DA..... | \* Either postId or commentId is required, not both. If you send both, the commentId is used. **Response**: ```json { "status": "OK", "from": "463745743546345", "target": "15625364215_56994166514", "count": 25, "comments": [{ "id": "119324881085321_122093459712345", "message": "Hello fans!", "from": { "id": "1234567890", "name": "Israel Israeli", "picture": { "data": { "url": "..." } } }, "created_time": 1783596120, "permalink_url": "https://www.facebook.com/...", "is_hidden": false, "like_count": 3, "comment_count": 3 }], "paging": { "after": "QVFIU...", "hasNext": true }, "reason": 1 } ``` **Response-Explain**: | Parameter | Description | | --- | --- | | status | OK or FAIL | | count | Total comments in this batch | | target | The commentId or postId you provided | | from | Your ID for the service | **comments** and **paging**: | Value | Information | | --- | --- | | id | This is the commentId | | message | The body of the comment | | created_time | Comment create time. UNIX UTC timestamp (int seconds) | | from | id, name and profile picture of the comment creator | | permalink_url | Link directly to the comment | | like_count | The total likes this comment has | | is_hidden | true - the comment is hidden in the page. false - this comment is live on Facebook | | comment_count | The total comment replies this comment has | | paging | Key that contains two values: "after", which represents the parameter to send if you wish to get the next batch, and "hasNext", which is true if you have more data to load, or false if this is the last data | **reason**: | Value | Information | | --- | --- | | 1 | Not FAIL. The status is OK | | 2 | Your "from" account does not exist (or is missing), or JSON syntax error | | 3 | Wrong apiKey (the apiKey header is missing or wrong) | | 6 | Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Facebook posts endpoint) | | 7 | Onboarding is still in progress (the connection is not active) | | 10 | You must do the onboarding again, the connection has expired | | 12 | Rate limit error. Too many requests. Please wait a few minutes and try again | | 13 | The postId or commentId is invalid or wrong: the post or comment was not found (for example, it was deleted), or you have no access to it | | 15 | The content you provided was rejected by Meta, or bad media / format / size, or an invalid parameter. It could also indicate a policy violation inside the content | | 18 | General error, try again | **Remarks**: - Each comment's `id` is the `commentId` for [Create Comment](https://docs.99digital.co.il/facebook-api/facebook-pages/create-comment), [Hide Comment](https://docs.99digital.co.il/facebook-api/facebook-pages/hide-comment), [Delete Comment](https://docs.99digital.co.il/facebook-api/facebook-pages/delete-comment), [Like Comment](https://docs.99digital.co.il/facebook-api/facebook-pages/like-comment) and [Private Reply](https://docs.99digital.co.il/facebook-api/facebook-pages/private-reply). ## Authentication `apiKey` in the header — Your API key for the service. ## Request body Content type: `application/json` (required) | Field | Type | Required | Description | | --- | --- | --- | --- | | `from` | string | Yes | The ID you received for the connection. Example: `463745743546345`. | | `postId` | string | No | The post ID you want to get the comments from. Either `postId` or `commentId` is required, not both. Example: `15625364215_56994166514`. | | `commentId` | string | No | The comment ID you wish to get all the comments inside it (its replies). Either `postId` or `commentId` is required, not both; if you send both, the `commentId` is used. Example: `634645636423_5675674565`. | | `filter` | string | No | Which comments to get. Default is `toplevel`. One of: `toplevel` — If you wish only top level comments; `stream` — If you wish to get everything — the comments and their replies, in one list. Default: `toplevel`. Example: `toplevel`. | | `order` | string | No | The order of the comments. Default is `chronological`. One of: `chronological` — Chronological order — oldest first; `reverse_chronological` — Reverse chronological order — newest first. Default: `chronological`. Example: `chronological`. | | `limit` | integer | No | How many comments to get (limit pagination), between 1 and 100. Default if not provided: 25. Default: `25`. Minimum: 1. Maximum: 100. Example: `25`. | | `after` | string | No | If you are using limit paging, you can provide the `after` value from the previous response (`paging.after`) to load the next batch. Example: `QVFIUmRfZA2xYzRkNmJmWjNh`. | ### Example: Comments of a post The top level comments of a post, oldest first. ```json { "from": "463745743546345", "postId": "15625364215_56994166514" } ``` ### Example: Replies to a comment The replies to one comment. ```json { "from": "463745743546345", "commentId": "634645636423_5675674565" } ``` ### Example: Everything, newest first All the comments of a post with their replies, newest first. ```json { "from": "463745743546345", "postId": "15625364215_56994166514", "filter": "stream", "order": "reverse_chronological" } ``` ### Example: Next batch The next 25 comments — `after` is `paging.after` from the previous response. ```json { "from": "463745743546345", "postId": "15625364215_56994166514", "limit": 25, "after": "QVFIUmRfZA2xYzRkNmJmWjNh" } ``` ## Responses ### 200 — The request was processed. Both a successful and a failed request answer with HTTP 200 — check `status`, and `reason` when it is FAIL. Content type: `application/json` | Field | Type | Description | | --- | --- | --- | | `status` | string | (one of: OK) OK or FAIL. `OK` — the request succeeded, and the comments of this batch are in `comments`. Always `OK`. | | `from` | string | (one of: OK) Your ID for the service. Example: `463745743546345`. | | `target` | string | (one of: OK) The `commentId` or `postId` you provided. Example: `15625364215_56994166514`. | | `count` | integer | (one of: OK) Total comments in this batch. Example: `25`. | | `comments` | array of object | (one of: OK) The comments of this batch. Empty when there are none. | | `comments[].id` | string | (one of: OK) This is the `commentId`. Example: `56994166514_122093459712345`. | | `comments[].message` | string | (one of: OK) The body (text) of the comment. Example: `Great post!`. | | `comments[].from` | object | (one of: OK) The id, name and profile picture of the comment creator. | | `comments[].from.id` | string | (one of: OK) The ID of the comment creator. | | `comments[].from.name` | string | (one of: OK) The name of the comment creator. | | `comments[].from.picture` | object | (one of: OK) The profile picture of the comment creator. | | `comments[].from.picture.data` | object | (one of: OK) The picture's details. | | `comments[].from.picture.data.url` | string | (one of: OK) Link to the profile picture. | | `comments[].created_time` | integer | (one of: OK) Comment create time. UNIX UTC timestamp (int seconds). Example: `1783596120`. | | `comments[].permalink_url` | string | (one of: OK) Link directly to the comment. | | `comments[].like_count` | integer | (one of: OK) The total likes this comment has. Example: `3`. | | `comments[].is_hidden` | boolean | (one of: OK) `true` — the comment is hidden in the page. `false` — this comment is live on Facebook. | | `comments[].comment_count` | integer | (one of: OK) The total comment replies this comment has. Example: `1`. | | `paging` | object | (one of: OK) Key that contains two values: `after`, which represents the parameter to send if you wish to get the next batch, and `hasNext`, which is true if you have more data to load, or false if this is the last data. | | `paging.after` | string | (one of: OK) The parameter to send (as `after`) if you wish to get the next batch. Example: `QVFIUmRfZA2xYzRkNmJmWjNh`. | | `paging.hasNext` | boolean | (one of: OK) `true` if you have more data to load, or `false` if this is the last data. | | `reason` | integer | (one of: OK) 1 — not FAIL, the status is OK. Always `1`. | | `status` | string | (one of: FAIL) FAIL — the request was not carried out. `reason` says why. Always `FAIL`. | | `reason` | integer | (one of: FAIL) The status explanation in case of FAIL. One of: `2` — Your "from" account does not exist (or is missing), or JSON syntax error; `3` — Wrong apiKey (the apiKey header is missing or wrong); `6` — Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Facebook posts endpoint); `7` — Onboarding is still in progress (the connection is not active); `10` — You must do the onboarding again, the connection has expired; `12` — Rate limit error. Too many requests. Please wait a few minutes and try again; `13` — The `postId` or `commentId` is invalid or wrong: the post or comment was not found (for example, it was deleted), or you have no access to it; `15` — The content you provided was rejected by Meta, or bad media / format / size, or an invalid parameter. It could also indicate a policy violation inside the content; `18` — General error, try again. | | `from` | string | (one of: FAIL) Your ID for the service. Returned when Meta rejected the request (reason 10 and above). Example: `463745743546345`. | #### Example: OK Two comments of a post, and more to load. ```json { "status": "OK", "from": "463745743546345", "target": "15625364215_56994166514", "count": 2, "comments": [ { "id": "56994166514_122093459712345", "message": "Great post!", "from": { "id": "1234567890", "name": "Israel Israeli", "picture": { "data": { "url": "https://platform-lookaside.fbsbx.com/platform/profilepic/?psid=1234567890" } } }, "created_time": 1783596120, "permalink_url": "https://www.facebook.com/15625364215/posts/56994166514?comment_id=122093459712345", "like_count": 3, "is_hidden": false, "comment_count": 1 }, { "id": "56994166514_122093459754321", "message": "When does the sale start?", "from": { "id": "9876543210", "name": "Dana Cohen", "picture": { "data": { "url": "https://platform-lookaside.fbsbx.com/platform/profilepic/?psid=9876543210" } } }, "created_time": 1783599720, "permalink_url": "https://www.facebook.com/15625364215/posts/56994166514?comment_id=122093459754321", "like_count": 0, "is_hidden": false, "comment_count": 0 } ], "paging": { "after": "QVFIUmRfZA2xYzRkNmJmWjNh", "hasNext": true }, "reason": 1 } ``` #### Example: No comments The post has no comments. ```json { "status": "OK", "from": "463745743546345", "target": "15625364215_56994166514", "count": 0, "comments": [], "paging": { "after": "", "hasNext": false }, "reason": 1 } ``` #### Example: Reason 13 The post or comment was not found, or you have no access to it. ```json { "status": "FAIL", "reason": 13, "from": "463745743546345" } ``` #### Example: Reason 3 Wrong apiKey. ```json { "status": "FAIL", "reason": 3 } ``` --- # Create Comment Source: https://docs.99digital.co.il/facebook-api/facebook-pages/create-comment Markdown: https://docs.99digital.co.il/markdown/facebook-api/facebook-pages/create-comment.md Section: Facebook API › Facebook Pages `POST https://api.99digital.co.il/facebook/page/createComment` This endpoint allows you to create a comment on an existing post. You can either comment on the post itself (it is called "top level comment") or comment on a comment (it is called "reply comment"). **Settings**: | Setting | Value | | --- | --- | | URL | `https://api.99digital.co.il/facebook/page/createComment` | | Method | JSON via POST | | Header | Your API key for the service (the `apiKey` header) | **Body**: | Parameter | Description / Example | Mandatory | Example | | --- | --- | --- | --- | | from | The ID you received for the connection | yes | 463745743546345 | | postId | The post ID you wish to comment on (if top level comment), from [Create Post](https://docs.99digital.co.il/facebook-api/facebook-pages/create-post) or [All Posts](https://docs.99digital.co.il/facebook-api/facebook-pages/all-posts) | no\* | 15625364215_56994166514 | | commentId | The comment ID you wish to comment on (if reply comment), from [All Comments](https://docs.99digital.co.il/facebook-api/facebook-pages/all-comments) | no\* | 652346734563_3463234623 | | body | The body of the comment. It can have plain text only (no Markdown or HTML) and `\n` for a line break. Maximum 8,000 characters | yes, unless you provide a "url" | Thank you for the comment! | | url | You can provide an image with the comment. Here you can provide the URL (HTTPS only, public) | no | https://example.com/image.jpg | \* You need to provide either the postId or the commentId, not both. If both are provided, the system will use the commentId (reply comment). **Response**: ```json { "status": "OK", "commentId": "15234562345623_952362434423178", "target": "15234562345623_425235245346", "body": "Thank you for the comment!", "timestamp": 1600115719, "from": "463745743546345", "reason": 1 } ``` **Response-Explain**: | Parameter | Description | | --- | --- | | status | OK or FAIL | | target | The original postId or commentId provided in the request | | commentId | The new commentId created. You can use it to reply to the comment | | timestamp | Time stamp of the message | | from | Your ID for the service | | body | The comment you wrote (empty for an image-only comment) | **reason**: | Value | Information | | --- | --- | | 1 | Not FAIL. The status is OK | | 2 | Your "from" account does not exist (or is missing), or JSON syntax error | | 3 | Wrong apiKey (the apiKey header is missing or wrong) | | 4 | commentId or postId is missing (or is not a valid ID) | | 5 | Missing or invalid content: the 'body' or "url" is missing, invalid or wrong (no "body" and no "url", or a "url" that is not https://) | | 6 | Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Facebook posts endpoint) | | 7 | Onboarding is still in progress (the connection is not active) | | 8 | The "body" is more than 8,000 characters long | | 10 | You must do the onboarding again, the connection has expired | | 12 | Rate limit error. Too many requests. Please wait a few minutes and try again | | 13 | The postId or commentId is invalid or wrong: the post or comment was not found (for example, it was deleted), or you have no access to it | | 15 | The content you posted was rejected by Meta, or bad media / format / size, or an invalid parameter. It could also indicate a policy violation inside the content | | 18 | General error, try again | ## Authentication `apiKey` in the header — Your API key for the service. ## Request body Content type: `application/json` (required) | Field | Type | Required | Description | | --- | --- | --- | --- | | `from` | string | Yes | The ID you received for the connection. Example: `463745743546345`. | | `postId` | string | No | The post ID you wish to comment on (if top level comment). You need to provide either the `postId` or the `commentId`, not both. Example: `15625364215_56994166514`. | | `commentId` | string | No | The comment ID you wish to comment on (if reply comment). You need to provide either the `postId` or the `commentId`, not both; if both are provided, the system uses the `commentId`. Example: `652346734563_3463234623`. | | `body` | string | No | The body of the comment. It can have plain text only (no Markdown or HTML) and `\n` for a line break. Maximum 8,000 characters. Required, unless you provide an image in `url`. Max length: 8000. Example: `Thank you for the comment!`. | | `url` | string (uri) | No | You can provide an image with the comment. Here you can provide the URL (HTTPS only, public). Example: `https://example.com/image.jpg`. | ### Example: Top level comment A comment on the post itself. ```json { "from": "463745743546345", "postId": "15625364215_56994166514", "body": "Thank you all for the great response!" } ``` ### Example: Reply comment A reply to a comment on your post. ```json { "from": "463745743546345", "commentId": "652346734563_3463234623", "body": "Thank you for the comment!" } ``` ### Example: Comment with image A comment with an image, from the link in `url`. ```json { "from": "463745743546345", "postId": "15625364215_56994166514", "body": "Here is the full menu.", "url": "https://example.com/image.jpg" } ``` ## Responses ### 200 — The request was processed. Both a successful and a failed request answer with HTTP 200 — check `status`, and `reason` when it is FAIL. Content type: `application/json` | Field | Type | Description | | --- | --- | --- | | `status` | string | (one of: OK) OK or FAIL. `OK` — the comment was created. Always `OK`. | | `commentId` | string | (one of: OK) The new commentId created. You can use it to reply to the comment. Example: `652346734563_952362434423178`. | | `target` | string | (one of: OK) The original `postId` or `commentId` provided in the request. Example: `652346734563_3463234623`. | | `body` | string | (one of: OK) The comment you wrote (empty for an image-only comment). Example: `Thank you for the comment!`. | | `timestamp` | integer | (one of: OK) Time stamp of the message (Unix time, in seconds). Example: `1785500000`. | | `from` | string | (one of: OK) Your ID for the service. Example: `463745743546345`. | | `reason` | integer | (one of: OK) 1 — not FAIL, the status is OK. Always `1`. | | `status` | string | (one of: FAIL) FAIL — the request was not carried out. `reason` says why. Always `FAIL`. | | `reason` | integer | (one of: FAIL) The status explanation in case of FAIL. One of: `2` — Your "from" account does not exist (or is missing), or JSON syntax error; `3` — Wrong apiKey (the apiKey header is missing or wrong); `4` — The "commentId" or "postId" is missing (or is not a valid ID); `5` — Missing or invalid content: the "body" or "url" is missing, invalid or wrong (no "body" and no "url", or a "url" that is not https://); `6` — Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Facebook posts endpoint); `7` — Onboarding is still in progress (the connection is not active); `8` — The "body" is more than 8,000 characters long; `10` — You must do the onboarding again, the connection has expired; `12` — Rate limit error. Too many requests. Please wait a few minutes and try again; `13` — The `postId` or `commentId` is invalid or wrong: the post or comment was not found (for example, it was deleted), or you have no access to it; `15` — The content you posted was rejected by Meta, or bad media / format / size, or an invalid parameter. It could also indicate a policy violation inside the content; `18` — General error, try again. | | `from` | string | (one of: FAIL) Your ID for the service. Returned when Meta rejected the request (reason 10 and above). Example: `463745743546345`. | #### Example: OK The reply comment was created. ```json { "status": "OK", "commentId": "652346734563_952362434423178", "target": "652346734563_3463234623", "body": "Thank you for the comment!", "timestamp": 1785500000, "from": "463745743546345", "reason": 1 } ``` #### Example: Reason 4 No `postId` and no `commentId`, or an ID that is not valid. ```json { "status": "FAIL", "reason": 4 } ``` #### Example: Reason 5 No `body` and no `url`. ```json { "status": "FAIL", "reason": 5 } ``` #### Example: Reason 13 The post or comment was not found, or you have no access to it. ```json { "status": "FAIL", "reason": 13, "from": "463745743546345" } ``` --- # Hide Comment Source: https://docs.99digital.co.il/facebook-api/facebook-pages/hide-comment Markdown: https://docs.99digital.co.il/markdown/facebook-api/facebook-pages/hide-comment.md Section: Facebook API › Facebook Pages `POST https://api.99digital.co.il/facebook/page/hideComment` Hide a comment allows you to make a comment hidden (or back to visible) from the public, so it stays visible only to the writer of the comment, their friends and the admin of the page. **Settings**: | Setting | Value | | --- | --- | | URL | `https://api.99digital.co.il/facebook/page/hideComment` | | Method | JSON via POST | | Header | Your API key for the service (the `apiKey` header) | **Body**: | Parameter | Description / Example | Mandatory | Example | | --- | --- | --- | --- | | from | The ID you received for the connection | yes | 463745743546345 | | commentId | The comment ID you wish to do the action on (from [All Comments](https://docs.99digital.co.il/facebook-api/facebook-pages/all-comments)) | yes | 652346734563_3463234623 | | hide | 1 - hide. 0 - unhide. If you leave it out, the comment is hidden. true / false work too, as a number or a string; any other value returns reason 8 | no (default 1) | 1 | **Response**: ```json { "status": "OK", "commentId": "15234562345623_952362434423178", "from": "463745743546345", "timestamp": 1600115719, "hidden": true, "reason": 1 } ``` **Response-Explain**: | Parameter | Description | | --- | --- | | status | OK or FAIL | | commentId | The comment ID you did the action on | | from | Your ID for the service | | timestamp | Time stamp of the message | | hidden | true if the comment was hidden. false if the comment is not hidden | **reason**: | Value | Information | | --- | --- | | 1 | Not FAIL. The status is OK | | 2 | Your "from" account does not exist (or is missing), or JSON syntax error | | 3 | Wrong apiKey (the apiKey header is missing or wrong) | | 4 | commentId is invalid or wrong (missing, or not a valid comment ID) | | 6 | Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Facebook posts endpoint) | | 7 | Onboarding is still in progress (the connection is not active) | | 8 | 'hide' is not 1 or 0 (or true / false) | | 10 | You must do the onboarding again, the connection has expired | | 12 | Rate limit error. Too many requests. Please wait a few minutes and try again | | 18 | General error, try again | **Remarks**: - To remove a comment for good, use [Delete Comment](https://docs.99digital.co.il/facebook-api/facebook-pages/delete-comment) instead. ## Authentication `apiKey` in the header — Your API key for the service. ## Request body Content type: `application/json` (required) | Field | Type | Required | Description | | --- | --- | --- | --- | | `from` | string | Yes | The ID you received for the connection. Example: `463745743546345`. | | `commentId` | string | Yes | The comment ID you wish to do the action on (from [All Comments](https://docs.99digital.co.il/facebook-api/facebook-pages/all-comments)). Example: `652346734563_3463234623`. | | `hide` | integer | No | 1 - hide, 0 - unhide. If you leave it out, the comment is hidden. `true` / `false` work too, as a number or a string; any other value returns reason 8. One of: `1` — Hide — the comment stays visible only to its writer, their friends and the admin of the page; `0` — Unhide — the comment is visible to the public again. Default: `1`. Example: `1`. | ### Example: Hide Hide the comment from the public. ```json { "from": "463745743546345", "commentId": "652346734563_3463234623", "hide": 1 } ``` ### Example: Unhide Make a hidden comment visible again. ```json { "from": "463745743546345", "commentId": "652346734563_3463234623", "hide": 0 } ``` ## Responses ### 200 — The request was processed. Both a successful and a failed request answer with HTTP 200 — check `status`, and `reason` when it is FAIL. Content type: `application/json` | Field | Type | Description | | --- | --- | --- | | `status` | string | (one of: OK) OK or FAIL. `OK` — the action was done. Always `OK`. | | `commentId` | string | (one of: OK) The comment ID you did the action on. Example: `652346734563_3463234623`. | | `hidden` | boolean | (one of: OK) `true` if the comment was hidden. `false` if the comment is not hidden (you unhid it). | | `timestamp` | integer | (one of: OK) Time stamp of the message (Unix time, in seconds). Example: `1785500000`. | | `from` | string | (one of: OK) Your ID for the service. Example: `463745743546345`. | | `reason` | integer | (one of: OK) 1 — not FAIL, the status is OK. Always `1`. | | `status` | string | (one of: FAIL) FAIL — the request was not carried out. `reason` says why. Always `FAIL`. | | `reason` | integer | (one of: FAIL) The status explanation in case of FAIL. One of: `2` — Your "from" account does not exist (or is missing), or JSON syntax error; `3` — Wrong apiKey (the apiKey header is missing or wrong); `4` — The "commentId" is invalid or wrong (missing, or not a valid comment ID); `6` — Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Facebook posts endpoint); `7` — Onboarding is still in progress (the connection is not active); `8` — 'hide' is not 1 or 0 (or true / false); `10` — You must do the onboarding again, the connection has expired; `12` — Rate limit error. Too many requests. Please wait a few minutes and try again; `18` — General error, try again. | | `from` | string | (one of: FAIL) Your ID for the service. Returned when Meta rejected the request (reason 10 and above). Example: `463745743546345`. | #### Example: OK The comment is hidden. ```json { "status": "OK", "commentId": "652346734563_3463234623", "hidden": true, "timestamp": 1785500000, "from": "463745743546345", "reason": 1 } ``` #### Example: OK — unhide The comment is visible again. ```json { "status": "OK", "commentId": "652346734563_3463234623", "hidden": false, "timestamp": 1785500000, "from": "463745743546345", "reason": 1 } ``` #### Example: Reason 4 The `commentId` is missing or not a valid ID. ```json { "status": "FAIL", "reason": 4 } ``` #### Example: Reason 3 Wrong apiKey. ```json { "status": "FAIL", "reason": 3 } ``` --- # Delete Comment Source: https://docs.99digital.co.il/facebook-api/facebook-pages/delete-comment Markdown: https://docs.99digital.co.il/markdown/facebook-api/facebook-pages/delete-comment.md Section: Facebook API › Facebook Pages `POST https://api.99digital.co.il/facebook/page/deleteComment` This endpoint allows you to delete a comment, either written by you or by anyone else. :::warning This is a permanent action and can't be undone. To only hide a comment from the public, use [Hide Comment](https://docs.99digital.co.il/facebook-api/facebook-pages/hide-comment) instead. ::: **Settings**: | Setting | Value | | --- | --- | | URL | `https://api.99digital.co.il/facebook/page/deleteComment` | | Method | JSON via POST | | Header | Your API key for the service (the `apiKey` header) | **Body**: | Parameter | Description / Example | Mandatory | Example | | --- | --- | --- | --- | | from | The ID you received for the connection | yes | 463745743546345 | | commentId | The comment ID you wish to delete (from [All Comments](https://docs.99digital.co.il/facebook-api/facebook-pages/all-comments)) | yes | 15625364215_56994166514 | **Response**: ```json { "status": "OK", "commentId": "15234562345623_952362434423178", "timestamp": 1600115719, "from": "463745743546345", "reason": 1, "deleted": true } ``` **Response-Explain**: | Parameter | Description | | --- | --- | | status | OK or FAIL | | commentId | The comment ID that you deleted | | timestamp | Time stamp of the message | | from | Your ID for the service | | deleted | true if the delete was successful. A delete that fails answers with status FAIL and a reason instead, so in an OK response it is always true | **reason**: | Value | Information | | --- | --- | | 1 | Not FAIL. The status is OK | | 2 | Your "from" account does not exist (or is missing), or JSON syntax error | | 3 | Wrong apiKey (the apiKey header is missing or wrong) | | 6 | Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Facebook posts endpoint) | | 7 | Onboarding is still in progress (the connection is not active) | | 10 | You must do the onboarding again, the connection has expired | | 12 | Rate limit error. Too many requests. Please wait a few minutes and try again | | 13 | The commentId you provided is invalid or wrong: the comment was not found (for example, it was already deleted), or you have no access to it | | 18 | General error, try again | ## Authentication `apiKey` in the header — Your API key for the service. ## Request body Content type: `application/json` (required) | Field | Type | Required | Description | | --- | --- | --- | --- | | `from` | string | Yes | The ID you received for the connection. Example: `463745743546345`. | | `commentId` | string | Yes | The comment ID you wish to delete (from [All Comments](https://docs.99digital.co.il/facebook-api/facebook-pages/all-comments)). It can be a comment written by you or by anyone else. Example: `652346734563_3463234623`. | ### Example (generated from the schema) ```json { "from": "463745743546345", "commentId": "652346734563_3463234623" } ``` ## Responses ### 200 — The request was processed. Both a successful and a failed request answer with HTTP 200 — check `status`, and `reason` when it is FAIL. Content type: `application/json` | Field | Type | Description | | --- | --- | --- | | `status` | string | (one of: OK) OK or FAIL. `OK` — the comment was deleted. Always `OK`. | | `commentId` | string | (one of: OK) The comment ID that you deleted. Example: `652346734563_3463234623`. | | `timestamp` | integer | (one of: OK) Time stamp of the message (Unix time, in seconds). Example: `1785500000`. | | `from` | string | (one of: OK) Your ID for the service. Example: `463745743546345`. | | `reason` | integer | (one of: OK) 1 — not FAIL, the status is OK. Always `1`. | | `deleted` | boolean | (one of: OK) `true` if the delete was successful. A delete that fails answers with status FAIL and a reason instead, so in an OK response it is always `true`. Always `true`. | | `status` | string | (one of: FAIL) FAIL — the request was not carried out. `reason` says why. Always `FAIL`. | | `reason` | integer | (one of: FAIL) The status explanation in case of FAIL. One of: `2` — Your "from" account does not exist (or is missing), or JSON syntax error; `3` — Wrong apiKey (the apiKey header is missing or wrong); `6` — Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Facebook posts endpoint); `7` — Onboarding is still in progress (the connection is not active); `10` — You must do the onboarding again, the connection has expired; `12` — Rate limit error. Too many requests. Please wait a few minutes and try again; `13` — The `commentId` you provided is invalid or wrong: the comment was not found (for example, it was already deleted), or you have no access to it; `18` — General error, try again. | | `from` | string | (one of: FAIL) Your ID for the service. Returned when Meta rejected the request (reason 10 and above). Example: `463745743546345`. | #### Example: OK The comment was deleted. ```json { "status": "OK", "commentId": "652346734563_3463234623", "timestamp": 1785500000, "from": "463745743546345", "reason": 1, "deleted": true } ``` #### Example: Reason 13 The comment was not found, or you have no access to it. ```json { "status": "FAIL", "reason": 13, "from": "463745743546345" } ``` #### Example: Reason 3 Wrong apiKey. ```json { "status": "FAIL", "reason": 3 } ``` --- # Like Comment Source: https://docs.99digital.co.il/facebook-api/facebook-pages/like-comment Markdown: https://docs.99digital.co.il/markdown/facebook-api/facebook-pages/like-comment.md Section: Facebook API › Facebook Pages `POST https://api.99digital.co.il/facebook/page/likeComment` This endpoint allows you to like or unlike a comment in a post. **Settings**: | Setting | Value | | --- | --- | | URL | `https://api.99digital.co.il/facebook/page/likeComment` | | Method | JSON via POST | | Header | Your API key for the service (the `apiKey` header) | **Body**: | Parameter | Description / Example | Mandatory | Example | | --- | --- | --- | --- | | from | The ID you received for the connection | yes | 463745743546345 | | commentId | The comment ID you wish to like (from [All Comments](https://docs.99digital.co.il/facebook-api/facebook-pages/all-comments)) | yes | 15625364215_56994166514 | | like | 1 for like. 0 for unlike. If you leave it out, the comment is liked. true / false work too, as a number or a string; any other value returns reason 8 | no (default 1) | 1 | **Response**: ```json { "status": "OK", "commentId": "15234562345623_952362434423178", "timestamp": 1700115719, "from": "463745743546345", "reason": 1, "like": true } ``` **Response-Explain**: | Parameter | Description | | --- | --- | | status | OK or FAIL | | commentId | The comment ID that you liked or unliked | | timestamp | Time stamp of the message | | from | Your ID for the service | | like | true if you liked the comment. false if you unliked it. When the action fails, the response is FAIL with a reason instead | **reason**: | Value | Information | | --- | --- | | 1 | Not FAIL. The status is OK | | 2 | Your "from" account does not exist (or is missing), or JSON syntax error | | 3 | Wrong apiKey (the apiKey header is missing or wrong) | | 6 | Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Facebook posts endpoint) | | 7 | Onboarding is still in progress (the connection is not active) | | 8 | 'like' is not 1 or 0 (or true / false) | | 10 | You must do the onboarding again, the connection has expired | | 12 | Rate limit error. Too many requests. Please wait a few minutes and try again | | 13 | The commentId you provided is invalid or wrong: the comment was not found (for example, it was deleted), or you have no access to it | | 18 | General error / wrong information or bad payload. Please check the payload again and try again | ## Authentication `apiKey` in the header — Your API key for the service. ## Request body Content type: `application/json` (required) | Field | Type | Required | Description | | --- | --- | --- | --- | | `from` | string | Yes | The ID you received for the connection. Example: `463745743546345`. | | `commentId` | string | Yes | The comment ID you wish to like or unlike (from [All Comments](https://docs.99digital.co.il/facebook-api/facebook-pages/all-comments)). Example: `652346734563_3463234623`. | | `like` | integer | No | 1 for like, 0 for unlike. If you leave it out, the comment is liked. `true` / `false` work too, as a number or a string; any other value returns reason 8. One of: `1` — Like the comment, as your Page; `0` — Unlike — remove your Page's like from the comment. Default: `1`. Example: `1`. | ### Example: Like Like the comment as your Page. ```json { "from": "463745743546345", "commentId": "652346734563_3463234623", "like": 1 } ``` ### Example: Unlike Remove your Page's like from the comment. ```json { "from": "463745743546345", "commentId": "652346734563_3463234623", "like": 0 } ``` ## Responses ### 200 — The request was processed. Both a successful and a failed request answer with HTTP 200 — check `status`, and `reason` when it is FAIL. Content type: `application/json` | Field | Type | Description | | --- | --- | --- | | `status` | string | (one of: OK) OK or FAIL. `OK` — the action was done. Always `OK`. | | `commentId` | string | (one of: OK) The comment ID that you liked or unliked. Example: `652346734563_3463234623`. | | `timestamp` | integer | (one of: OK) Time stamp of the message (Unix time, in seconds). Example: `1785500000`. | | `from` | string | (one of: OK) Your ID for the service. Example: `463745743546345`. | | `reason` | integer | (one of: OK) 1 — not FAIL, the status is OK. Always `1`. | | `like` | boolean | (one of: OK) `true` if you liked the comment. `false` if you unliked it. When the action fails, the response is FAIL with a reason instead. | | `status` | string | (one of: FAIL) FAIL — the request was not carried out. `reason` says why. Always `FAIL`. | | `reason` | integer | (one of: FAIL) The status explanation in case of FAIL. One of: `2` — Your "from" account does not exist (or is missing), or JSON syntax error; `3` — Wrong apiKey (the apiKey header is missing or wrong); `6` — Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Facebook posts endpoint); `7` — Onboarding is still in progress (the connection is not active); `8` — 'like' is not 1 or 0 (or true / false); `10` — You must do the onboarding again, the connection has expired; `12` — Rate limit error. Too many requests. Please wait a few minutes and try again; `13` — The `commentId` you provided is invalid or wrong: the comment was not found (for example, it was deleted), or you have no access to it; `18` — General error / wrong information or bad payload. Please check the payload again and try again. | | `from` | string | (one of: FAIL) Your ID for the service. Returned when Meta rejected the request (reason 10 and above). Example: `463745743546345`. | #### Example: OK The comment is liked. ```json { "status": "OK", "commentId": "652346734563_3463234623", "timestamp": 1785500000, "from": "463745743546345", "reason": 1, "like": true } ``` #### Example: OK — unlike The like was removed. ```json { "status": "OK", "commentId": "652346734563_3463234623", "timestamp": 1785500000, "from": "463745743546345", "reason": 1, "like": false } ``` #### Example: Reason 13 The comment was not found, or you have no access to it. ```json { "status": "FAIL", "reason": 13, "from": "463745743546345" } ``` #### Example: Reason 18 General or unknown error — check the request and try again. ```json { "status": "FAIL", "reason": 18, "from": "463745743546345" } ``` --- # Private Reply Source: https://docs.99digital.co.il/facebook-api/facebook-pages/private-reply Markdown: https://docs.99digital.co.il/markdown/facebook-api/facebook-pages/private-reply.md Section: Facebook API › Facebook Pages `POST https://api.99digital.co.il/facebook/page/privateReply` This endpoint allows you to send a Messenger private reply to a user that left a comment on your post. You are allowed to send a one-time private reply to a person who wrote a public comment: you can only send one private reply per comment, within 7 days of when it was written. If the user answers, you can keep chatting with them (if you connected the Facebook Messenger API too). This private reply does not need a Facebook Messenger connection to work. **Settings**: | Setting | Value | | --- | --- | | URL | `https://api.99digital.co.il/facebook/page/privateReply` | | Method | JSON via POST | | Header | Your API key for the service (the `apiKey` header) | **Body**: | Parameter | Description / Example | Mandatory | Example | | --- | --- | --- | --- | | from | The ID you received for the connection | yes | 463745743546345 | | commentId | The comment ID that was posted on your post, of which you wish to send the private reply to the visitor | yes\* | 652346734563_3463234623 | | postId | If someone wrote a post on your page and you wish to private reply to them, you need to provide the postId instead of the commentId | no\* | 634634634_7447345 | | body | The private message (DM) you want to send to the visitor that wrote the comment (or the post). 2,000 characters maximum | yes | Thank you for the comment! Here are our special deals | \* Provide either the commentId or the postId. If you send both, the commentId is used. **Response**: ```json { "status": "OK", "target": "15234562345623_425235245346", "from": "463745743546345", "messageId": "m_Hk2aZ5q8RkWm1vYb3pXo7Q", "body": "Thank you for the comment! Here are our special deals", "timestamp": 1600115719, "reason": 1 } ``` **Response-Explain**: | Parameter | Description | | --- | --- | | status | OK or FAIL | | target | The original postId or commentId provided in the request | | messageId | The DM message ID (the ID of the private message that was sent) | | timestamp | Time stamp of the message | | from | Your ID for the service | | body | The private message you wrote | **reason**: | Value | Information | | --- | --- | | 1 | Not FAIL. The status is OK | | 2 | Your "from" account does not exist (or is missing), or JSON syntax error | | 3 | Wrong apiKey (the apiKey header is missing or wrong) | | 4 | commentId or postId is missing (or is not a valid ID) | | 5 | Missing or invalid content: the 'body' is missing or empty | | 6 | Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Facebook posts endpoint) | | 7 | Onboarding is still in progress (the connection is not active) | | 8 | The "body" is more than 2,000 characters long | | 10 | You must do the onboarding again, the connection has expired | | 12 | Rate limit error. Too many requests. Please wait a few minutes and try again | | 13 | The postId or commentId is invalid or wrong: the post or comment was not found (for example, it was deleted), or you have no access to it | | 14 | You already sent a private reply to this comment or post, or it is more than 7 days old. Meta allows one private reply, within 7 days | | 15 | The content you posted was rejected by Meta, or bad media / format / size, or an invalid parameter. It could also indicate a policy violation inside the content | | 18 | General error, try again | ## Authentication `apiKey` in the header — Your API key for the service. ## Request body Content type: `application/json` (required) | Field | Type | Required | Description | | --- | --- | --- | --- | | `from` | string | Yes | The ID you received for the connection. Example: `463745743546345`. | | `commentId` | string | No | The comment ID that was posted on your post, of which you wish to send the private reply to the visitor. Either `commentId` or `postId` is required; if you send both, the `commentId` is used. Example: `652346734563_3463234623`. | | `postId` | string | No | If someone wrote a post on your page and you wish to private reply to them, you need to provide the `postId` (of their post) instead of the `commentId`. Example: `634634634_7447345`. | | `body` | string | Yes | The private message (DM) you want to send to the visitor that wrote the comment or the post. 2,000 characters maximum. Max length: 2000. Example: `Thank you for the comment! Here are our special deals.`. | ### Example: Reply to a comment A private message to the writer of a comment on your post. ```json { "from": "463745743546345", "commentId": "652346734563_3463234623", "body": "Thank you for the comment! Here are our special deals." } ``` ### Example: Reply to a visitor post A private message to a visitor who wrote a post on your page. ```json { "from": "463745743546345", "postId": "634634634_7447345", "body": "Thanks for your post! We sent you the details here." } ``` ## Responses ### 200 — The request was processed. Both a successful and a failed request answer with HTTP 200 — check `status`, and `reason` when it is FAIL. Content type: `application/json` | Field | Type | Description | | --- | --- | --- | | `status` | string | (one of: OK) OK or FAIL. `OK` — the private reply was sent. Always `OK`. | | `target` | string | (one of: OK) The original `postId` or `commentId` provided in the request. Example: `652346734563_3463234623`. | | `messageId` | string | (one of: OK) The DM message ID (the ID of the private message that was sent). Example: `m_Hk2aZ5q8RkWm1vYb3pXo7Q`. | | `body` | string | (one of: OK) The private message you wrote. Example: `Thank you for the comment! Here are our special deals.`. | | `timestamp` | integer | (one of: OK) Time stamp of the message (Unix time, in seconds). Example: `1785500000`. | | `from` | string | (one of: OK) Your ID for the service. Example: `463745743546345`. | | `reason` | integer | (one of: OK) 1 — not FAIL, the status is OK. Always `1`. | | `status` | string | (one of: FAIL) FAIL — the request was not carried out. `reason` says why. Always `FAIL`. | | `reason` | integer | (one of: FAIL) The status explanation in case of FAIL. One of: `2` — Your "from" account does not exist (or is missing), or JSON syntax error; `3` — Wrong apiKey (the apiKey header is missing or wrong); `4` — The "commentId" or "postId" is missing (or is not a valid ID); `5` — Missing or invalid content — the "body" is missing or empty; `6` — Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Facebook posts endpoint); `7` — Onboarding is still in progress (the connection is not active); `8` — The "body" is more than 2,000 characters long; `10` — You must do the onboarding again, the connection has expired; `12` — Rate limit error. Too many requests. Please wait a few minutes and try again; `13` — The `postId` or `commentId` is invalid or wrong: the post or comment was not found (for example, it was deleted), or you have no access to it; `14` — You already sent a private reply to this comment or post, or it is more than 7 days old — Meta allows one private reply, within 7 days; `15` — The content you posted was rejected by Meta, or bad media / format / size, or an invalid parameter. It could also indicate a policy violation inside the content; `18` — General error, try again. | | `from` | string | (one of: FAIL) Your ID for the service. Returned when Meta rejected the request (reason 10 and above). Example: `463745743546345`. | #### Example: OK The private reply was sent. ```json { "status": "OK", "target": "652346734563_3463234623", "messageId": "m_Hk2aZ5q8RkWm1vYb3pXo7Q", "body": "Thank you for the comment! Here are our special deals.", "timestamp": 1785500000, "from": "463745743546345", "reason": 1 } ``` #### Example: Reason 4 No `commentId` and no `postId`, or an ID that is not valid. ```json { "status": "FAIL", "reason": 4 } ``` #### Example: Reason 8 The `body` is more than 2,000 characters long. ```json { "status": "FAIL", "reason": 8 } ``` #### Example: Reason 13 The comment or post was not found, or you have no access to it. ```json { "status": "FAIL", "reason": 13, "from": "463745743546345" } ``` --- # All Posts Source: https://docs.99digital.co.il/facebook-api/instagram-pages/all-posts Markdown: https://docs.99digital.co.il/markdown/facebook-api/instagram-pages/all-posts.md Section: Facebook API › Instagram Pages `POST https://api.99digital.co.il/instagram/page/getPosts` This endpoint allows you to see all the posts in your Instagram page (posts that were created by the API or directly on Instagram). **Settings**: | Setting | Value | | --- | --- | | URL | `https://api.99digital.co.il/instagram/page/getPosts` | | Method | JSON via POST | | Header | Your API key for the service (the `apiKey` header) | **Body**: | Parameter | Description / Example | Mandatory | Example | | --- | --- | --- | --- | | from | The ID you received for the connection | yes | 463745743546345 | | limit | How many posts to get (limit pagination), between 1 and 100. Default if not provided: 25 | no | 25 | | type | Two options: **media** - all posts, reels, videos, carousels. **stories** - live stories. Default if not provided: media | no | media | | mediaId | If you prefer to get information on one post and not all of them, here is where you put the mediaId. The response then holds that one post in "post" (not a "posts" list, and without "type", "count" and "paging"), and "type", "limit" and "after" are ignored | no | 5634634_634634563 | | after | If you are using limit paging, you can provide the "after" value from the previous response to load the next batch | no | U56WDF34FA4TER3DA..... | **Response**: ```json { "status": "OK", "from": "463745743546345", "type": "media", "count": 25, "posts": [{ "id": "119324881085321_122093459712345", "caption": "Hello fans!", "media_type": "CAROUSEL_ALBUM", "media_product_type": "FEED", "media_url": "https://www.scontent.com/...", "permalink": "https://instagram.com/p/...", "created_time": 1783596120, "children": { "data": [ { "id": "17998877665544332", "media_type": "IMAGE", "media_url": "https://www.scontent.com/..." }, { "id": "17998877665544333", "media_type": "VIDEO", "media_url": "https://www.scontent.com/...", "thumbnail_url": "https://www.scontent.com/..." } ] }, "like_count": 10, "comments_count": 3, "is_comment_enabled": true }], "paging": { "after": "QVFIU...", "hasNext": true }, "reason": 1 } ``` **Response-Explain**: | Parameter | Description | | --- | --- | | status | OK or FAIL | | type | The type you asked for: media or stories | | count | Total posts in this batch | | from | Your ID for the service | **posts** and **paging**: | Value | Information | | --- | --- | | id | This is the postId (the mediaId of the post) | | caption | The body of the post | | media_type | IMAGE / VIDEO / CAROUSEL_ALBUM | | media_product_type | FEED / REELS / STORY | | media_url | Link to the media | | permalink | Link directly to the post | | thumbnail_url | Thumbnail image link (only for videos) | | created_time | The post create time. UNIX UTC timestamp (int seconds) | | like_count | The total likes of the post | | comments_count | The total amount of comments this post has (int). For getting the actual comments, use the [All Comments](https://docs.99digital.co.il/facebook-api/instagram-pages/all-comments) (getComments) API endpoint | | is_comment_enabled | true or false: whether comments are enabled on the post | | children | List of media URLs for carousel items (media_type = CAROUSEL_ALBUM): each item in "data" has its id, media_type, media_url, and thumbnail_url for a video | | paging | Key that contains two values: "after", which represents the parameter to send if you wish to get the next batch, and "hasNext", which is true if you have more data to load, or false if this is the last data | **reason**: | Value | Information | | --- | --- | | 1 | Not FAIL. The status is OK | | 2 | Your "from" account does not exist (or is missing), or JSON syntax error | | 3 | Wrong apiKey (the apiKey header is missing or wrong) | | 6 | Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Instagram endpoint) | | 7 | Onboarding is still in progress, or the connection was disabled (the connection is not active) | | 10 | You must do the onboarding again, the connection has expired | | 12 | Rate limit error. Too many requests. Please wait a few minutes and try again | | 13 | The postId (mediaId) is invalid or wrong: the post was not found, or it is not accessible | | 15 | The content you posted was rejected by Meta, or bad media / format / size, or an invalid parameter. It could also indicate a policy violation inside the content | | 18 | General error, try again | ## Stories For the "stories" type from the table above, only those will return in the response: `id`, `media_type`, `media_url`, `permalink` and `created_time`. **Remarks**: - A field without a value is left out of the post: for example `caption` on a post without a caption, `thumbnail_url` on anything but a video, and `children` on anything but a carousel. ## Authentication `apiKey` in the header — Your API key for the service. ## Request body Content type: `application/json` (required) | Field | Type | Required | Description | | --- | --- | --- | --- | | `from` | string | Yes | The ID you received for the connection. Example: `463745743546345`. | | `type` | string | No | What to list. Two options: `media` or `stories`. Default if not provided: `media`. Ignored when you send `mediaId`. One of: `media` — All posts, reels, videos and carousels; `stories` — Live stories — the stories that are live right now. Default: `media`. | | `limit` | integer | No | How many posts to get (limit pagination), between 1 and 100. Default if not provided: 25. Default: `25`. Minimum: 1. Maximum: 100. Example: `25`. | | `after` | string | No | If you are using limit paging, you can provide the `after` value from the previous response (`paging.after`) to load the next batch. Example: `QVFIUmF4YWJjZGVmZ2hpams`. | | `mediaId` | string | No | If you prefer to get information on one post and not all of them, here is where you put the mediaId. The response then holds that one post in `post` (not a `posts` list, and without `type`, `count` and `paging`), and `type`, `limit` and `after` are ignored. Example: `17895695668004550`. | ### Example: All posts The last 25 posts — images, reels, videos and carousels. ```json { "from": "463745743546345", "type": "media", "limit": 25 } ``` ### Example: Next batch The next 25 posts, with the `paging.after` value of the previous response. ```json { "from": "463745743546345", "type": "media", "limit": 25, "after": "QVFIUmF4YWJjZGVmZ2hpams" } ``` ### Example: Stories The stories that are live right now. ```json { "from": "463745743546345", "type": "stories" } ``` ### Example: One post The details of one post, by its `mediaId`. ```json { "from": "463745743546345", "mediaId": "17895695668004550" } ``` ## Responses ### 200 — The request was processed. Both a successful and a failed request answer with HTTP 200 — check `status`, and `reason` when it is FAIL. Content type: `application/json` | Field | Type | Description | | --- | --- | --- | | `status` | string | (one of: OK) OK or FAIL. `OK` — the request succeeded, and the posts of this batch are in `posts`. One of: `OK`. | | `from` | string | (one of: OK) Your ID for the service. Example: `463745743546345`. | | `type` | string | (one of: OK) The type you asked for — `media` or `stories`. One of: `media` — All posts, reels, videos and carousels; `stories` — Live stories. | | `count` | integer | (one of: OK) Total posts in this batch. Example: `25`. | | `posts` | array of object | (one of: OK) The posts of this batch. Empty when there are none. | | `posts[].id` | string | (one of: OK) This is the postId (the mediaId of the post). Use it with [All Comments](https://docs.99digital.co.il/facebook-api/instagram-pages/all-comments), [Create Comment](https://docs.99digital.co.il/facebook-api/instagram-pages/create-comment), [Toggle Comments](https://docs.99digital.co.il/facebook-api/instagram-pages/toggle-comments) and [Delete Post](https://docs.99digital.co.il/facebook-api/instagram-pages/delete-post). Example: `17895695668004550`. | | `posts[].caption` | string | (one of: OK) The body of the post. | | `posts[].media_type` | string | (one of: OK) The kind of media — IMAGE / VIDEO / CAROUSEL_ALBUM. One of: `IMAGE` — An image; `VIDEO` — A video (a reel, or a video story); `CAROUSEL_ALBUM` — A carousel — its items are in `children`. | | `posts[].media_product_type` | string | (one of: OK) Where the post appears — FEED / REELS / STORY. One of: `FEED` — A regular post in the feed; `REELS` — A reel; `STORY` — A story. | | `posts[].media_url` | string | (one of: OK) Link to the media. | | `posts[].permalink` | string | (one of: OK) Link directly to the post. | | `posts[].thumbnail_url` | string | (one of: OK) Thumbnail image link (only for videos). | | `posts[].created_time` | integer | (one of: OK) The post create time. UNIX UTC timestamp (int seconds). Example: `1783596120`. | | `posts[].like_count` | integer | (one of: OK) The total likes of the post. | | `posts[].comments_count` | integer | (one of: OK) The total amount of comments this post has (int). For getting the actual comments, use the [All Comments](https://docs.99digital.co.il/facebook-api/instagram-pages/all-comments) (getComments) API endpoint. | | `posts[].is_comment_enabled` | boolean | (one of: OK) `true` or `false`: whether comments are enabled on the post. | | `posts[].children` | object | (one of: OK) List of media URLs for carousel items (`media_type` = CAROUSEL_ALBUM): each item in `data` has its own `id`, `media_type`, `media_url`, and `thumbnail_url` for a video. | | `posts[].children.data` | array of object | (one of: OK) The carousel items, in their order in the carousel. | | `posts[].children.data[].id` | string | (one of: OK) The media ID of the carousel item. | | `posts[].children.data[].media_type` | string | (one of: OK) The kind of the carousel item. One of: `IMAGE` — The item is an image; `VIDEO` — The item is a video (with its `thumbnail_url`). | | `posts[].children.data[].media_url` | string | (one of: OK) Link to the media of the carousel item. | | `posts[].children.data[].thumbnail_url` | string | (one of: OK) Thumbnail image link (only for videos). | | `paging` | object | (one of: OK) Key that contains two values: `after`, which represents the parameter to send if you wish to get the next batch, and `hasNext`, which is true if you have more data to load, or false if this is the last data. | | `paging.after` | string | (one of: OK) The parameter to send (as `after`) if you wish to get the next batch. Empty when there is nothing after this batch. | | `paging.hasNext` | boolean | (one of: OK) `true` if you have more data to load, or `false` if this is the last data. | | `reason` | integer | (one of: OK) 1 — not FAIL, the status is OK. One of: `1`. | | `status` | string | (one of: OK — one post) OK or FAIL. `OK` — the request succeeded, and the post is in `post`. One of: `OK`. | | `from` | string | (one of: OK — one post) Your ID for the service. Example: `463745743546345`. | | `post` | object | (one of: OK — one post) The post, with the same fields as an item of `posts`. | | `post.id` | string | (one of: OK — one post) This is the postId (the mediaId of the post). Example: `17895695668004550`. | | `post.caption` | string | (one of: OK — one post) The body of the post. | | `post.media_type` | string | (one of: OK — one post) The kind of media — IMAGE / VIDEO / CAROUSEL_ALBUM. One of: `IMAGE` — An image; `VIDEO` — A video (a reel, or a video story); `CAROUSEL_ALBUM` — A carousel — its items are in `children`. | | `post.media_product_type` | string | (one of: OK — one post) Where the post appears — FEED / REELS / STORY. One of: `FEED` — A regular post in the feed; `REELS` — A reel; `STORY` — A story. | | `post.media_url` | string | (one of: OK — one post) Link to the media. | | `post.permalink` | string | (one of: OK — one post) Link directly to the post. | | `post.thumbnail_url` | string | (one of: OK — one post) Thumbnail image link (only for videos). | | `post.created_time` | integer | (one of: OK — one post) The post create time. UNIX UTC timestamp (int seconds). Example: `1783596120`. | | `post.like_count` | integer | (one of: OK — one post) The total likes of the post. | | `post.comments_count` | integer | (one of: OK — one post) The total amount of comments this post has (int). | | `post.is_comment_enabled` | boolean | (one of: OK — one post) `true` or `false`: whether comments are enabled on the post. | | `post.children` | object | (one of: OK — one post) List of media URLs for carousel items (`media_type` = CAROUSEL_ALBUM): each item in `data` has its own `id`, `media_type`, `media_url`, and `thumbnail_url` for a video. | | `post.children.data` | array of object | (one of: OK — one post) The carousel items, in their order in the carousel. | | `post.children.data[].id` | string | (one of: OK — one post) The media ID of the carousel item. | | `post.children.data[].media_type` | string | (one of: OK — one post) The kind of the carousel item. One of: `IMAGE` — The item is an image; `VIDEO` — The item is a video (with its `thumbnail_url`). | | `post.children.data[].media_url` | string | (one of: OK — one post) Link to the media of the carousel item. | | `post.children.data[].thumbnail_url` | string | (one of: OK — one post) Thumbnail image link (only for videos). | | `reason` | integer | (one of: OK — one post) 1 — not FAIL, the status is OK. One of: `1`. | | `status` | string | (one of: FAIL) FAIL — the request was not carried out. `reason` says why. Always `FAIL`. | | `reason` | integer | (one of: FAIL) The status explanation in case of FAIL. One of: `2` — Your "from" account does not exist (or is missing), or JSON syntax error; `3` — Wrong apiKey (the apiKey header is missing or wrong); `6` — Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Instagram endpoint); `7` — Onboarding is still in progress, or the connection was disabled (the connection is not active); `10` — You must do the onboarding again, the connection has expired; `12` — Rate limit error. Too many requests. Please wait a few minutes and try again; `13` — The postId (`mediaId`) is invalid or wrong: the post was not found, or it is not accessible; `15` — The content you posted was rejected by Meta, or bad media / format / size, or an invalid parameter. It could also indicate a policy violation inside the content; `18` — General error, try again. | | `from` | string | (one of: FAIL) Your ID for the service. Included only when Meta rejected the request (reasons 10 and up). Example: `463745743546345`. | #### Example: OK A batch of posts — an image and a carousel — with more to load. ```json { "status": "OK", "from": "463745743546345", "type": "media", "count": 2, "posts": [ { "id": "17895695668004550", "caption": "Hello fans!", "media_type": "IMAGE", "media_product_type": "FEED", "media_url": "https://scontent.cdninstagram.com/v/example-image.jpg", "permalink": "https://www.instagram.com/p/C8xYz12AbCd/", "like_count": 10, "comments_count": 3, "is_comment_enabled": true, "created_time": 1783596120 }, { "id": "17912345678904321", "caption": "Swipe to see both colors", "media_type": "CAROUSEL_ALBUM", "media_product_type": "FEED", "media_url": "https://scontent.cdninstagram.com/v/example-first-item.jpg", "permalink": "https://www.instagram.com/p/C8wXy34BcDe/", "like_count": 42, "comments_count": 7, "is_comment_enabled": true, "children": { "data": [ { "id": "17998877665544332", "media_type": "IMAGE", "media_url": "https://scontent.cdninstagram.com/v/example-first-item.jpg" }, { "id": "17998877665544333", "media_type": "VIDEO", "media_url": "https://scontent.cdninstagram.com/v/example-second-item.mp4", "thumbnail_url": "https://scontent.cdninstagram.com/v/example-second-item-thumb.jpg" } ] }, "created_time": 1783509720 } ], "paging": { "after": "QVFIUmF4YWJjZGVmZ2hpams", "hasNext": true }, "reason": 1 } ``` #### Example: Stories The stories that are live right now — a smaller set of fields. ```json { "status": "OK", "from": "463745743546345", "type": "stories", "count": 1, "posts": [ { "id": "17923456789012345", "media_type": "IMAGE", "media_url": "https://scontent.cdninstagram.com/v/example-story.jpg", "permalink": "https://www.instagram.com/stories/example_shop/3412345678901234567/", "created_time": 1783599720 } ], "paging": { "after": "QVFIUnN0b3JpZXNhYmNkZWY", "hasNext": false }, "reason": 1 } ``` #### Example: One post With `mediaId`, the post comes back in `post`. ```json { "status": "OK", "from": "463745743546345", "post": { "id": "17895695668004550", "caption": "Hello fans!", "media_type": "VIDEO", "media_product_type": "REELS", "media_url": "https://scontent.cdninstagram.com/v/example-reel.mp4", "permalink": "https://www.instagram.com/reel/C8xYz12AbCd/", "thumbnail_url": "https://scontent.cdninstagram.com/v/example-reel-thumb.jpg", "like_count": 10, "comments_count": 3, "is_comment_enabled": true, "created_time": 1783596120 }, "reason": 1 } ``` #### Example: Reason 3 Wrong apiKey. ```json { "status": "FAIL", "reason": 3 } ``` #### Example: Reason 13 The post was not found, or it is not accessible. ```json { "status": "FAIL", "reason": 13, "from": "463745743546345" } ``` --- # Create Post Source: https://docs.99digital.co.il/facebook-api/instagram-pages/create-post Markdown: https://docs.99digital.co.il/markdown/facebook-api/instagram-pages/create-post.md Section: Facebook API › Instagram Pages `POST https://api.99digital.co.il/instagram/page/createPost` This endpoint allows you to create a post on your Instagram page. - Here you have one endpoint for all media types. - All media must be public HTTPS URLs (Meta will try to download them), JPEG images only, maximum of 8 MB. **Settings**: | Setting | Value | | --- | --- | | URL | `https://api.99digital.co.il/instagram/page/createPost` | | Method | JSON via POST | | Header | Your API key for the service (the `apiKey` header) | **Body**: | Parameter | Description / Example | Mandatory | Example | | --- | --- | --- | --- | | from | The ID you received for the connection | yes | 463745743546345 | | mediaType | Can be any of the following: **image** - for creating a post with only an image. **reel** - for creating a reel. **video** - for creating a video (Instagram publishes every single video as a reel, so it is the same as reel, and the response's mediaType is reel). **story** - for creating a story. **carousel** - for creating carousel images/videos. If you leave it out, it is taken from "links": two links or more make a carousel, one video link (mp4/mov/webm/avi) a reel, and any other link an image. A story is created only when you set mediaType to story | no | image | | links | Array of public HTTPS links, depending on the "mediaType" you provided. **image** - provide 1 link only (JPEG). **reel** - provide 1 video link only (mp4/mov/webm/avi), up to 90 seconds. **video** - provide 1 video link only (mp4/mov/webm/avi). **story** - 1 link of either an image or a video (a story lives 24 hours). **carousel** - minimum 2 links, maximum 10. An image and video combination is possible | yes | `["https://example.com/image.jpg","https://example.com/image2.jpg"]` | | caption | A string text that comes with the image/reel/video/carousel. Up to 2,200 characters, up to 30 #hashtags, up to 20 @mentions. No Markdown, no HTML. Does not work for the 'story' mediaType | no | Here is my video title | | shareToFeed | int. Relevant for reels only. 1 - show in the main feed grid. 0 - show in the Reels tab only | no | 1 | **Response**: ```json { "status": "OK", "mediaType": "image", "caption": "your message", "timestamp": 1600115719, "from": "463745743546345", "mediaId": "52342352345", "url": "https://example.com/image.jpg", "reason": 1 } ``` **Response-Explain**: | Parameter | Description | | --- | --- | | status | OK or FAIL | | mediaType | The mediaType you chose (or the one taken from "links"; video comes back as reel) | | caption | The caption text you provided (left out when you sent none, and for a story) | | timestamp | Time stamp of the message | | from | Your ID for the service | | url | For a single URL mediaType, this will show the URL provided | | items | Total items provided (relevant for the carousel mediaType, instead of url) | | mediaId | The published media ID. This is relevant for [Toggle Comments](https://docs.99digital.co.il/facebook-api/instagram-pages/toggle-comments) (toggleComments), [Delete Post](https://docs.99digital.co.il/facebook-api/instagram-pages/delete-post) (deletePost), [Create Comment](https://docs.99digital.co.il/facebook-api/instagram-pages/create-comment) (createComment), sendMediaShare and [All Comments](https://docs.99digital.co.il/facebook-api/instagram-pages/all-comments) (getComments) | **reason**: | Value | Information | | --- | --- | | 1 | Not FAIL. The status is OK | | 2 | Your "from" account does not exist (or is missing), or JSON syntax error | | 3 | Wrong apiKey (the apiKey header is missing or wrong) | | 5 | Missing or invalid content: 'links' is missing or empty, or one of the links is not https:// | | 6 | Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Instagram endpoint) | | 7 | Onboarding is still in progress, or the connection was disabled (the connection is not active) | | 8 | Wrong mediaType, the wrong number of links for the mediaType, or a caption longer than 2,200 characters | | 10 | You must do the onboarding again, the connection has expired | | 12 | Rate limit error. Too many requests. Please wait a few minutes and try again | | 15 | The content you posted was rejected by Meta, or bad media / format / size (for example, an image that is not JPEG, or a video Meta could not process). It could also indicate a policy violation inside the content. Don't retry the same file | | 16 | You reached Instagram's daily publishing limit (100 posts in 24 hours). Try again later | | 17 | Meta is still processing the video. Nothing was published: send the same request again in a minute | | 18 | General error / wrong information / unknown error. Please check all the payload again and try again | **Remarks**: - In a story or a carousel, a link that ends with `.mp4`, `.mov`, `.webm` or `.avi` is published as a video, and any other link as an image. - The response comes once the post is published. A video is processed by Meta first, so a reel, a video story or a carousel with videos can take a minute or more: set your HTTP timeout accordingly. If Meta is still processing the video after about 90 seconds, you get reason 17: nothing was published, so send the same request again in a minute. ## Authentication `apiKey` in the header — Your API key for the service. ## Request body Content type: `application/json` (required) | Field | Type | Required | Description | | --- | --- | --- | --- | | `from` | string | Yes | The ID you received for the connection. Example: `463745743546345`. | | `mediaType` | string | No | The kind of post. Can be any of the following: `image`, `reel`, `video`, `story` or `carousel`. If you leave it out, it is taken from `links`: two links or more make a carousel, one video link (mp4/mov/webm/avi) a reel, and any other link an image. A story is created only when you set `mediaType` to `story`. One of: `image` — For creating a post with only an image; `reel` — For creating a reel; `video` — For creating a video — Instagram publishes every single video as a reel, so it is the same as `reel`, and the response's `mediaType` is `reel`; `story` — For creating a story (a story lives 24 hours); `carousel` — For creating carousel images/videos (2 to 10 items). Example: `image`. | | `links` | array of string | Yes | Array of public HTTPS links (Meta will try to download them), depending on the `mediaType` you provided: - `image` — 1 link only (JPEG). - `reel` — 1 video link only (mp4/mov/webm/avi), up to 90 seconds. - `video` — 1 video link only (mp4/mov/webm/avi). - `story` — 1 link of either an image or a video (a story lives 24 hours). - `carousel` — minimum 2 links, maximum 10. An image and video combination is possible. Images must be JPEG, maximum of 8 MB. Min items: 1. Max items: 10. | | `caption` | string | No | A string text that comes with the image / reel / video / carousel. Up to 2,200 characters, up to 30 #hashtags and up to 20 @mentions. No Markdown, no HTML. Does not work for the `story` mediaType. Max length: 2200. Example: `Here is my video title`. | | `shareToFeed` | integer | No | Int. Relevant for reels only. One of: `0` — Show in the Reels tab only; `1` — Show in the main feed grid (as well as in the Reels tab). Example: `1`. | ### Example: Image A post with one JPEG image and a caption. ```json { "from": "463745743546345", "mediaType": "image", "links": [ "https://example.com/image.jpg" ], "caption": "Our new collection is here" } ``` ### Example: Reel A reel from one video link, shown in the main feed grid as well. ```json { "from": "463745743546345", "mediaType": "reel", "links": [ "https://example.com/video.mp4" ], "caption": "Here is my video title", "shareToFeed": 1 } ``` ### Example: Video A video — Instagram publishes it as a reel, exactly like `reel`. ```json { "from": "463745743546345", "mediaType": "video", "links": [ "https://example.com/video.mp4" ], "caption": "Here is my video title" } ``` ### Example: Story A story from one image or video link. It lives 24 hours, without a caption. ```json { "from": "463745743546345", "mediaType": "story", "links": [ "https://example.com/story.jpg" ] } ``` ### Example: Carousel A carousel of 2 to 10 links — here two images and a video. ```json { "from": "463745743546345", "mediaType": "carousel", "links": [ "https://example.com/image.jpg", "https://example.com/image2.jpg", "https://example.com/video.mp4" ], "caption": "Swipe to see the whole collection" } ``` ## Responses ### 200 — The request was processed. Both a successful and a failed request answer with HTTP 200 — check `status`, and `reason` when it is FAIL. Content type: `application/json` | Field | Type | Description | | --- | --- | --- | | `status` | string | (one of: OK) OK or FAIL. `OK` — the post was published. Always `OK`. | | `from` | string | (one of: OK) Your ID for the service. Example: `463745743546345`. | | `timestamp` | integer | (one of: OK) Time stamp of the message (Unix time, in seconds). Example: `1600115719`. | | `mediaType` | string | (one of: OK) The mediaType you chose, or the one taken from `links`. `video` comes back as `reel`. One of: `image` — A post with only an image; `reel` — A reel (also for `video`); `story` — A story; `carousel` — A carousel of images/videos. | | `url` | string | (one of: OK) For a single URL mediaType (`image`, `reel`, `video`, `story`), this will show the URL provided. Not in a carousel's response. Example: `https://example.com/image.jpg`. | | `items` | integer | (one of: OK) Total items provided (relevant for the `carousel` mediaType) — in a carousel's response only, instead of `url`. Example: `3`. | | `caption` | string | (one of: OK) The caption text you provided. Left out when you sent none, and for a story (stories publish no caption). | | `mediaId` | string | (one of: OK) The published media ID. This is relevant for toggleComments, deletePost, createComment, sendMediaShare and getComments. Example: `17895695668004550`. | | `reason` | integer | (one of: OK) 1 — not FAIL, the status is OK. Always `1`. | | `status` | string | (one of: FAIL) FAIL — the request was not carried out. `reason` says why. Always `FAIL`. | | `reason` | integer | (one of: FAIL) The status explanation in case of FAIL. One of: `2` — Your "from" account does not exist (or is missing), or JSON syntax error; `3` — Wrong apiKey (the apiKey header is missing or wrong); `5` — Missing or invalid content: 'links' is missing or empty, or one of the links is not https://; `6` — Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Instagram endpoint); `7` — Onboarding is still in progress, or the connection was disabled (the connection is not active); `8` — Wrong mediaType, the wrong number of links for the mediaType, or a caption longer than 2,200 characters; `10` — You must do the onboarding again, the connection has expired; `12` — Rate limit error. Too many requests. Please wait a few minutes and try again; `15` — The content you posted was rejected by Meta, or bad media / format / size (for example, an image that is not JPEG, or a video Meta could not process). It could also indicate a policy violation inside the content. Don't retry the same file; `16` — You reached Instagram's daily publishing limit (100 posts in 24 hours). Try again later; `17` — Meta is still processing the video. Nothing was published — send the same request again in a minute; `18` — General error / wrong information / unknown error. Please check all the payload again and try again. | | `from` | string | (one of: FAIL) Your ID for the service. Included only when Meta rejected the request (reasons 10 and up). Example: `463745743546345`. | #### Example: OK The image was published. ```json { "status": "OK", "from": "463745743546345", "timestamp": 1600115719, "reason": 1, "mediaType": "image", "url": "https://example.com/image.jpg", "mediaId": "17895695668004550", "caption": "Our new collection is here" } ``` #### Example: OK — carousel A carousel's response has `items` (the number of links) instead of `url`. ```json { "status": "OK", "from": "463745743546345", "timestamp": 1600115719, "reason": 1, "mediaType": "carousel", "items": 3, "mediaId": "17895695668004551", "caption": "Swipe to see the whole collection" } ``` #### Example: Reason 5 'links' is missing or empty, or a link is not https://. ```json { "status": "FAIL", "reason": 5 } ``` #### Example: Reason 8 Wrong mediaType, the wrong number of links, or a caption that is too long. ```json { "status": "FAIL", "reason": 8 } ``` #### Example: Reason 15 Meta rejected the media — for example, an image that is not JPEG. ```json { "status": "FAIL", "reason": 15, "from": "463745743546345" } ``` #### Example: Reason 16 The daily publishing limit (100 posts in 24 hours) is reached. ```json { "status": "FAIL", "reason": 16, "from": "463745743546345" } ``` #### Example: Reason 17 The video is still processing at Meta. Nothing was published; send the request again in a minute. ```json { "status": "FAIL", "reason": 17, "from": "463745743546345" } ``` --- # Delete Post Source: https://docs.99digital.co.il/facebook-api/instagram-pages/delete-post Markdown: https://docs.99digital.co.il/markdown/facebook-api/instagram-pages/delete-post.md Section: Facebook API › Instagram Pages `POST https://api.99digital.co.il/instagram/page/deletePost` This endpoint allows you to delete a post you previously created (using our API or directly on Instagram). :::warning This is a permanent action and can't be undone. ::: **Settings**: | Setting | Value | | --- | --- | | URL | `https://api.99digital.co.il/instagram/page/deletePost` | | Method | JSON via POST | | Header | Your API key for the service (the `apiKey` header) | **Body**: | Parameter | Description / Example | Mandatory | Example | | --- | --- | --- | --- | | from | The ID you received for the connection | yes | 463745743546345 | | mediaId | The media ID you wish to delete: the mediaId you received from [Create Post](https://docs.99digital.co.il/facebook-api/instagram-pages/create-post), or the post's id in [All Posts](https://docs.99digital.co.il/facebook-api/instagram-pages/all-posts) | yes | 15625364215_56994166514 | **Response**: ```json { "status": "OK", "mediaId": "15234562345623_952362434423178", "timestamp": 1600115719, "from": "463745743546345", "reason": 1, "deleted": true } ``` **Response-Explain**: | Parameter | Description | | --- | --- | | status | OK or FAIL | | mediaId | The media ID of the post that you deleted | | timestamp | Time stamp of the message | | from | Your ID for the service | | deleted | true if the delete was successful. A delete that fails answers with status FAIL and a reason instead, so in an OK response it is always true | **reason**: | Value | Information | | --- | --- | | 1 | Not FAIL. The status is OK | | 2 | Your "from" account does not exist (or is missing), or JSON syntax error | | 3 | Wrong apiKey (the apiKey header is missing or wrong) | | 6 | Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Instagram endpoint) | | 7 | Onboarding is still in progress, or the connection was disabled (the connection is not active) | | 10 | You must do the onboarding again, the connection has expired | | 12 | Rate limit error. Too many requests. Please wait a few minutes and try again | | 13 | The mediaId you provided is invalid or wrong: the post was not found, or it is not accessible | | 18 | General error, try again | ## Authentication `apiKey` in the header — Your API key for the service. ## Request body Content type: `application/json` (required) | Field | Type | Required | Description | | --- | --- | --- | --- | | `from` | string | Yes | The ID you received for the connection. Example: `463745743546345`. | | `mediaId` | string | Yes | The media ID you wish to delete: the `mediaId` you received from [Create Post](https://docs.99digital.co.il/facebook-api/instagram-pages/create-post), or the post's `id` in [All Posts](https://docs.99digital.co.il/facebook-api/instagram-pages/all-posts). Example: `17895695668004550`. | ### Example (generated from the schema) ```json { "from": "463745743546345", "mediaId": "17895695668004550" } ``` ## Responses ### 200 — The request was processed. Both a successful and a failed request answer with HTTP 200 — check `status`, and `reason` when it is FAIL. Content type: `application/json` | Field | Type | Description | | --- | --- | --- | | `status` | string | (one of: OK) OK or FAIL. `OK` — the post was deleted. Always `OK`. | | `from` | string | (one of: OK) Your ID for the service. Example: `463745743546345`. | | `timestamp` | integer | (one of: OK) Time stamp of the message (Unix time, in seconds). Example: `1600115719`. | | `mediaId` | string | (one of: OK) The media ID of the post that you deleted. Example: `17895695668004550`. | | `deleted` | boolean | (one of: OK) `true` if the delete was successful. A delete that fails answers with status FAIL and a reason instead, so in an OK response it is always `true`. Always `true`. | | `reason` | integer | (one of: OK) 1 — not FAIL, the status is OK. Always `1`. | | `status` | string | (one of: FAIL) FAIL — the request was not carried out. `reason` says why. Always `FAIL`. | | `reason` | integer | (one of: FAIL) The status explanation in case of FAIL. One of: `2` — Your "from" account does not exist (or is missing), or JSON syntax error; `3` — Wrong apiKey (the apiKey header is missing or wrong); `6` — Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Instagram endpoint); `7` — Onboarding is still in progress, or the connection was disabled (the connection is not active); `10` — You must do the onboarding again, the connection has expired; `12` — Rate limit error. Too many requests. Please wait a few minutes and try again; `13` — The `mediaId` you provided is invalid or wrong: the post was not found, or it is not accessible; `18` — General error, try again. | | `from` | string | (one of: FAIL) Your ID for the service. Included only when Meta rejected the request (reasons 10 and up). Example: `463745743546345`. | #### Example: OK The post was deleted. ```json { "status": "OK", "from": "463745743546345", "timestamp": 1600115719, "reason": 1, "mediaId": "17895695668004550", "deleted": true } ``` #### Example: Reason 3 Wrong apiKey. ```json { "status": "FAIL", "reason": 3 } ``` #### Example: Reason 13 The post was not found, or it is not accessible. ```json { "status": "FAIL", "reason": 13, "from": "463745743546345" } ``` --- # All Comments Source: https://docs.99digital.co.il/facebook-api/instagram-pages/all-comments Markdown: https://docs.99digital.co.il/markdown/facebook-api/instagram-pages/all-comments.md Section: Facebook API › Instagram Pages `POST https://api.99digital.co.il/instagram/page/getComments` This endpoint allows you to see all the comments of a post or a comment in your page (comments that were created by the API or directly on Instagram). **Settings**: | Setting | Value | | --- | --- | | URL | `https://api.99digital.co.il/instagram/page/getComments` | | Method | JSON via POST | | Header | Your API key for the service (the `apiKey` header) | **Body**: | Parameter | Description / Example | Mandatory | Example | | --- | --- | --- | --- | | from | The ID you received for the connection | yes | 463745743546345 | | mediaId | The post ID (media ID) you want to get the comments from | no\* | 15625364215_56994166514 | | commentId | The comment ID you wish to get all the comments inside it (its replies) | no\* | 634645636423_5675674565 | | limit | How many comments to get (limit pagination), between 1 and 100. Default if not provided: 25 | no | 25 | | after | If you are using limit paging, you can provide the "after" value from the previous response to load the next batch | no | U56WDF34FA4TER3DA..... | \* Either mediaId or commentId is required, not both. If you send both, the commentId is used. **Response**: ```json { "status": "OK", "from": "463745743546345", "target": "15625364215_56994166514", "count": 25, "comments": [{ "id": "119324881085321_122093459712345", "text": "Hello fans!", "username": "some_user", "from": { "id": "1234567890", "username": "some_user" }, "created_time": 1783596120, "like_count": 3, "hidden": false, "parent_id": "634532636346" }], "paging": { "after": "QVFIU...", "hasNext": true }, "reason": 1 } ``` **Response-Explain**: | Parameter | Description | | --- | --- | | status | OK or FAIL | | count | Total comments in this batch | | target | The mediaId or commentId you provided (the commentId, if you sent both) | | from | Your ID for the service | **comments** and **paging**: | Value | Information | | --- | --- | | id | This is the commentId | | text | The body of the comment | | username | The username of the person that wrote the comment | | from | id, username of the comment creator | | created_time | Comment create time. UNIX UTC timestamp (int seconds) | | like_count | The total likes this comment has | | hidden | true - the comment is hidden in the page. false - this comment is live on Instagram | | parent_id | The parent comment id (in case this is a comment to a comment). It is part of a reply only (when you send commentId) | | paging | Key that contains two values: "after", which represents the parameter to send if you wish to get the next batch, and "hasNext", which is true if you have more data to load, or false if this is the last data | **reason**: | Value | Information | | --- | --- | | 1 | Not FAIL. The status is OK | | 2 | Your "from" account does not exist (or is missing), or JSON syntax error | | 3 | Wrong apiKey (the apiKey header is missing or wrong) | | 6 | Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Instagram endpoint) | | 7 | Onboarding is still in progress, or the connection was disabled (the connection is not active) | | 10 | You must do the onboarding again, the connection has expired | | 12 | Rate limit error. Too many requests. Please wait a few minutes and try again | | 13 | The mediaId or commentId is invalid or wrong: the post or comment was not found, or it is not accessible | | 18 | General error, try again | **Remarks**: - Each comment's `id` is the `commentId` for [Create Comment](https://docs.99digital.co.il/facebook-api/instagram-pages/create-comment), [Hide Comment](https://docs.99digital.co.il/facebook-api/instagram-pages/hide-comment), [Delete Comment](https://docs.99digital.co.il/facebook-api/instagram-pages/delete-comment) and [Private Reply](https://docs.99digital.co.il/facebook-api/instagram-pages/private-reply). ## Authentication `apiKey` in the header — Your API key for the service. ## Request body Content type: `application/json` (required) | Field | Type | Required | Description | | --- | --- | --- | --- | | `from` | string | Yes | The ID you received for the connection. Example: `463745743546345`. | | `mediaId` | string | No | The post ID (media ID) you want to get the comments from. Either `mediaId` or `commentId` is required, not both. Example: `17895695668004550`. | | `commentId` | string | No | The comment ID you wish to get all the comments inside it (its replies). Either `mediaId` or `commentId` is required, not both; if you send both, `commentId` is used. Example: `17870913679156914`. | | `limit` | integer | No | How many comments to get (limit pagination), between 1 and 100. Default if not provided: 25. Default: `25`. Minimum: 1. Maximum: 100. Example: `25`. | | `after` | string | No | If you are using limit paging, you can provide the `after` value from the previous response (`paging.after`) to load the next batch. Example: `QVFIUmF4YWJjZGVmZ2hpams`. | ### Example: Comments of a post The comments of a post, by its `mediaId`. ```json { "from": "463745743546345", "mediaId": "17895695668004550" } ``` ### Example: Replies to a comment The comments inside a comment (its replies), by its `commentId`. ```json { "from": "463745743546345", "commentId": "17870913679156914" } ``` ### Example: Next batch The next 25 comments, with the `paging.after` value of the previous response. ```json { "from": "463745743546345", "mediaId": "17895695668004550", "limit": 25, "after": "QVFIUmF4YWJjZGVmZ2hpams" } ``` ## Responses ### 200 — The request was processed. Both a successful and a failed request answer with HTTP 200 — check `status`, and `reason` when it is FAIL. Content type: `application/json` | Field | Type | Description | | --- | --- | --- | | `status` | string | (one of: OK) OK or FAIL. `OK` — the request succeeded, and the comments of this batch are in `comments`. Always `OK`. | | `from` | string | (one of: OK) Your ID for the service. Example: `463745743546345`. | | `target` | string | (one of: OK) The mediaId or commentId you provided (the commentId, if you sent both). Example: `17895695668004550`. | | `count` | integer | (one of: OK) Total comments in this batch. Example: `25`. | | `comments` | array of object | (one of: OK) The comments of this batch. Empty when there are none. | | `comments[].id` | string | (one of: OK) This is the commentId. Use it with [Create Comment](https://docs.99digital.co.il/facebook-api/instagram-pages/create-comment), [Hide Comment](https://docs.99digital.co.il/facebook-api/instagram-pages/hide-comment), [Delete Comment](https://docs.99digital.co.il/facebook-api/instagram-pages/delete-comment) and [Private Reply](https://docs.99digital.co.il/facebook-api/instagram-pages/private-reply). Example: `17870913679156914`. | | `comments[].text` | string | (one of: OK) The body (text) of the comment. | | `comments[].username` | string | (one of: OK) The username of the person that wrote the comment. | | `comments[].from` | object | (one of: OK) The id and username of the comment creator. | | `comments[].from.id` | string | (one of: OK) The ID of the comment creator. | | `comments[].from.username` | string | (one of: OK) The username of the comment creator. | | `comments[].created_time` | integer | (one of: OK) Comment create time. UNIX UTC timestamp (int seconds). Example: `1783596120`. | | `comments[].like_count` | integer | (one of: OK) The total likes this comment has. | | `comments[].hidden` | boolean | (one of: OK) `true` — the comment is hidden in the page. `false` — this comment is live on Instagram. | | `comments[].parent_id` | string | (one of: OK) The parent comment id (in case this is a comment to a comment). It is part of a reply only (when you send `commentId`). | | `paging` | object | (one of: OK) Key that contains two values: `after`, which represents the parameter to send if you wish to get the next batch, and `hasNext`, which is true if you have more data to load, or false if this is the last data. | | `paging.after` | string | (one of: OK) The parameter to send (as `after`) if you wish to get the next batch. Empty when there is nothing after this batch. | | `paging.hasNext` | boolean | (one of: OK) `true` if you have more data to load, or `false` if this is the last data. | | `reason` | integer | (one of: OK) 1 — not FAIL, the status is OK. Always `1`. | | `status` | string | (one of: FAIL) FAIL — the request was not carried out. `reason` says why. Always `FAIL`. | | `reason` | integer | (one of: FAIL) The status explanation in case of FAIL. One of: `2` — Your "from" account does not exist (or is missing), or JSON syntax error; `3` — Wrong apiKey (the apiKey header is missing or wrong); `6` — Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Instagram endpoint); `7` — Onboarding is still in progress, or the connection was disabled (the connection is not active); `10` — You must do the onboarding again, the connection has expired; `12` — Rate limit error. Too many requests. Please wait a few minutes and try again; `13` — The `mediaId` or `commentId` is invalid or wrong: the post or comment was not found, or it is not accessible; `18` — General error, try again. | | `from` | string | (one of: FAIL) Your ID for the service. Included only when Meta rejected the request (reasons 10 and up). Example: `463745743546345`. | #### Example: OK The comments of a post, with more to load. ```json { "status": "OK", "from": "463745743546345", "target": "17895695668004550", "count": 2, "comments": [ { "id": "17870913679156914", "text": "Hello fans!", "username": "some_user", "from": { "id": "1234567890", "username": "some_user" }, "like_count": 3, "hidden": false, "created_time": 1783596120 }, { "id": "17870913679156999", "text": "Is this available in blue?", "username": "another_user", "from": { "id": "1234567891", "username": "another_user" }, "like_count": 0, "hidden": false, "created_time": 1783592520 } ], "paging": { "after": "QVFIUmF4YWJjZGVmZ2hpams", "hasNext": true }, "reason": 1 } ``` #### Example: Replies The replies to a comment — each with its `parent_id`. ```json { "status": "OK", "from": "463745743546345", "target": "17870913679156914", "count": 1, "comments": [ { "id": "17870913679157777", "text": "Thank you for the comment!", "username": "my_business", "from": { "id": "17841400000000000", "username": "my_business" }, "like_count": 1, "hidden": false, "parent_id": "17870913679156914", "created_time": 1783599720 } ], "paging": { "after": "QVFIUmVwbGllc2FiY2RlZg", "hasNext": false }, "reason": 1 } ``` #### Example: No comments Nothing to show. ```json { "status": "OK", "from": "463745743546345", "target": "17895695668004550", "count": 0, "comments": [], "paging": { "after": "", "hasNext": false }, "reason": 1 } ``` #### Example: Reason 13 The post or comment was not found, or it is not accessible. ```json { "status": "FAIL", "reason": 13, "from": "463745743546345" } ``` --- # Create Comment Source: https://docs.99digital.co.il/facebook-api/instagram-pages/create-comment Markdown: https://docs.99digital.co.il/markdown/facebook-api/instagram-pages/create-comment.md Section: Facebook API › Instagram Pages `POST https://api.99digital.co.il/instagram/page/createComment` This endpoint allows you to create a comment on an existing post. You can either comment on the post itself (it is called "top level comment") or comment on a comment (it is called "reply comment"). **Settings**: | Setting | Value | | --- | --- | | URL | `https://api.99digital.co.il/instagram/page/createComment` | | Method | JSON via POST | | Header | Your API key for the service (the `apiKey` header) | **Body**: | Parameter | Description / Example | Mandatory | Example | | --- | --- | --- | --- | | from | The ID you received for the connection | yes | 463745743546345 | | mediaId | The media ID you wish to comment on (if top level comment) | no\* | 15625364215_56994166514 | | commentId | The comment ID you wish to comment on (if reply comment) | no\* | 652346734563_3463234623 | | body | The body of the comment. It can have plain text only and `\n` for a line break. Maximum 2,200 characters | yes | Thank you for the comment! | \* You need to provide either the mediaId or the commentId, not both. If both are provided, the system will use the commentId (reply comment). **Response**: ```json { "status": "OK", "commentId": "15234562345623_952362434423178", "target": "15234562345623_425235245346", "body": "Thank you for the comment!", "timestamp": 1600115719, "from": "463745743546345", "reason": 1 } ``` **Response-Explain**: | Parameter | Description | | --- | --- | | status | OK or FAIL | | target | The original mediaId or commentId provided in the request (the commentId, if you sent both) | | commentId | The new commentId created. You can use it to reply to the comment | | timestamp | Time stamp of the message | | from | Your ID for the service | | body | The comment you wrote | **reason**: | Value | Information | | --- | --- | | 1 | Not FAIL. The status is OK | | 2 | Your "from" account does not exist (or is missing), or JSON syntax error | | 3 | Wrong apiKey (the apiKey header is missing or wrong) | | 4 | mediaId or commentId is missing (or is not a valid ID) | | 5 | Missing or invalid content: the 'body' is missing or empty | | 6 | Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Instagram endpoint) | | 7 | Onboarding is still in progress, or the connection was disabled (the connection is not active) | | 8 | The "body" is more than 2,200 characters long | | 10 | You must do the onboarding again, the connection has expired | | 12 | Rate limit error. Too many requests. Please wait a few minutes and try again | | 13 | The mediaId or commentId is invalid or wrong: the post or comment was not found, or it is not accessible | | 15 | The content you posted was rejected by Meta, or bad media / format / size, or an invalid parameter. It could also indicate a policy violation inside the content | | 18 | General error, try again | ## Authentication `apiKey` in the header — Your API key for the service. ## Request body Content type: `application/json` (required) | Field | Type | Required | Description | | --- | --- | --- | --- | | `from` | string | Yes | The ID you received for the connection. Example: `463745743546345`. | | `mediaId` | string | No | The media ID you wish to comment on (if top level comment). You need to provide either the `mediaId` or the `commentId`, not both. Example: `17895695668004550`. | | `commentId` | string | No | The comment ID you wish to comment on (if reply comment). You need to provide either the `mediaId` or the `commentId`, not both; if both are provided, the system uses the `commentId`. Example: `17870913679156914`. | | `body` | string | Yes | The body of the comment. It can have plain text only and `\n` for a line break. Maximum 2,200 characters. Max length: 2200. Example: `Thank you for the comment!`. | ### Example: Top level comment A comment on the post itself, by its `mediaId`. ```json { "from": "463745743546345", "mediaId": "17895695668004550", "body": "Thank you for the comment!" } ``` ### Example: Reply comment A comment on a comment, by its `commentId`. ```json { "from": "463745743546345", "commentId": "17870913679156914", "body": "Thank you for the comment!\nWe will send you the details soon." } ``` ## Responses ### 200 — The request was processed. Both a successful and a failed request answer with HTTP 200 — check `status`, and `reason` when it is FAIL. Content type: `application/json` | Field | Type | Description | | --- | --- | --- | | `status` | string | (one of: OK) OK or FAIL. `OK` — the comment was created. Always `OK`. | | `from` | string | (one of: OK) Your ID for the service. Example: `463745743546345`. | | `timestamp` | integer | (one of: OK) Time stamp of the message (Unix time, in seconds). Example: `1600115719`. | | `target` | string | (one of: OK) The original mediaId or commentId provided in the request (the commentId, if you sent both). Example: `17895695668004550`. | | `commentId` | string | (one of: OK) The new commentId created. You can use it to reply to the comment. Example: `17870913679157777`. | | `body` | string | (one of: OK) The comment you wrote. Example: `Thank you for the comment!`. | | `reason` | integer | (one of: OK) 1 — not FAIL, the status is OK. Always `1`. | | `status` | string | (one of: FAIL) FAIL — the request was not carried out. `reason` says why. Always `FAIL`. | | `reason` | integer | (one of: FAIL) The status explanation in case of FAIL. One of: `2` — Your "from" account does not exist (or is missing), or JSON syntax error; `3` — Wrong apiKey (the apiKey header is missing or wrong); `4` — 'mediaId' or 'commentId' is missing (or is not a valid ID); `5` — Missing or invalid content — the 'body' is missing or empty; `6` — Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Instagram endpoint); `7` — Onboarding is still in progress, or the connection was disabled (the connection is not active); `8` — The 'body' is more than 2,200 characters long; `10` — You must do the onboarding again, the connection has expired; `12` — Rate limit error. Too many requests. Please wait a few minutes and try again; `13` — The `mediaId` or `commentId` is invalid or wrong: the post or comment was not found, or it is not accessible; `15` — The content you posted was rejected by Meta, or bad media / format / size, or an invalid parameter. It could also indicate a policy violation inside the content; `18` — General error, try again. | | `from` | string | (one of: FAIL) Your ID for the service. Included only when Meta rejected the request (reasons 10 and up). Example: `463745743546345`. | #### Example: OK The top level comment was created. ```json { "status": "OK", "from": "463745743546345", "timestamp": 1600115719, "reason": 1, "target": "17895695668004550", "commentId": "17870913679157777", "body": "Thank you for the comment!" } ``` #### Example: OK — reply comment The reply was created; `target` is the comment you replied to. ```json { "status": "OK", "from": "463745743546345", "timestamp": 1600115719, "reason": 1, "target": "17870913679156914", "commentId": "17870913679158888", "body": "Thank you for the comment!\nWe will send you the details soon." } ``` #### Example: Reason 4 'mediaId' or 'commentId' is missing. ```json { "status": "FAIL", "reason": 4 } ``` #### Example: Reason 5 'body' is missing or empty. ```json { "status": "FAIL", "reason": 5 } ``` #### Example: Reason 8 'body' is more than 2,200 characters long. ```json { "status": "FAIL", "reason": 8 } ``` #### Example: Reason 13 The post or comment was not found, or it is not accessible. ```json { "status": "FAIL", "reason": 13, "from": "463745743546345" } ``` --- # Delete Comment Source: https://docs.99digital.co.il/facebook-api/instagram-pages/delete-comment Markdown: https://docs.99digital.co.il/markdown/facebook-api/instagram-pages/delete-comment.md Section: Facebook API › Instagram Pages `POST https://api.99digital.co.il/instagram/page/deleteComment` This endpoint allows you to delete a comment on your posts, either written by you or by anyone else. :::warning This is a permanent action and can't be undone. To take a comment out of public view without deleting it, use [Hide Comment](https://docs.99digital.co.il/facebook-api/instagram-pages/hide-comment). ::: **Settings**: | Setting | Value | | --- | --- | | URL | `https://api.99digital.co.il/instagram/page/deleteComment` | | Method | JSON via POST | | Header | Your API key for the service (the `apiKey` header) | **Body**: | Parameter | Description / Example | Mandatory | Example | | --- | --- | --- | --- | | from | The ID you received for the connection | yes | 463745743546345 | | commentId | The comment ID you wish to delete (the id of the comment in [All Comments](https://docs.99digital.co.il/facebook-api/instagram-pages/all-comments)) | yes | 15625364215_56994166514 | **Response**: ```json { "status": "OK", "commentId": "15234562345623_952362434423178", "timestamp": 1600115719, "from": "463745743546345", "reason": 1, "deleted": true } ``` **Response-Explain**: | Parameter | Description | | --- | --- | | status | OK or FAIL | | commentId | The comment ID that you deleted | | timestamp | Time stamp of the message | | from | Your ID for the service | | deleted | true if the delete was successful. A delete that fails answers with status FAIL and a reason instead, so in an OK response it is always true | **reason**: | Value | Information | | --- | --- | | 1 | Not FAIL. The status is OK | | 2 | Your "from" account does not exist (or is missing), or JSON syntax error | | 3 | Wrong apiKey (the apiKey header is missing or wrong) | | 6 | Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Instagram endpoint) | | 7 | Onboarding is still in progress, or the connection was disabled (the connection is not active) | | 10 | You must do the onboarding again, the connection has expired | | 12 | Rate limit error. Too many requests. Please wait a few minutes and try again | | 13 | The commentId you provided is invalid or wrong: the comment was not found, or it is not accessible | | 18 | General error, try again | ## Authentication `apiKey` in the header — Your API key for the service. ## Request body Content type: `application/json` (required) | Field | Type | Required | Description | | --- | --- | --- | --- | | `from` | string | Yes | The ID you received for the connection. Example: `463745743546345`. | | `commentId` | string | Yes | The comment ID you wish to delete (the `id` of the comment in [All Comments](https://docs.99digital.co.il/facebook-api/instagram-pages/all-comments)). It can be a comment written by you or by anyone else. Example: `17870913679156914`. | ### Example (generated from the schema) ```json { "from": "463745743546345", "commentId": "17870913679156914" } ``` ## Responses ### 200 — The request was processed. Both a successful and a failed request answer with HTTP 200 — check `status`, and `reason` when it is FAIL. Content type: `application/json` | Field | Type | Description | | --- | --- | --- | | `status` | string | (one of: OK) OK or FAIL. `OK` — the comment was deleted. Always `OK`. | | `from` | string | (one of: OK) Your ID for the service. Example: `463745743546345`. | | `timestamp` | integer | (one of: OK) Time stamp of the message (Unix time, in seconds). Example: `1600115719`. | | `commentId` | string | (one of: OK) The comment ID that you deleted. Example: `17870913679156914`. | | `deleted` | boolean | (one of: OK) `true` if the delete was successful. A delete that fails answers with status FAIL and a reason instead, so in an OK response it is always `true`. Always `true`. | | `reason` | integer | (one of: OK) 1 — not FAIL, the status is OK. Always `1`. | | `status` | string | (one of: FAIL) FAIL — the request was not carried out. `reason` says why. Always `FAIL`. | | `reason` | integer | (one of: FAIL) The status explanation in case of FAIL. One of: `2` — Your "from" account does not exist (or is missing), or JSON syntax error; `3` — Wrong apiKey (the apiKey header is missing or wrong); `6` — Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Instagram endpoint); `7` — Onboarding is still in progress, or the connection was disabled (the connection is not active); `10` — You must do the onboarding again, the connection has expired; `12` — Rate limit error. Too many requests. Please wait a few minutes and try again; `13` — The `commentId` you provided is invalid or wrong: the comment was not found, or it is not accessible; `18` — General error, try again. | | `from` | string | (one of: FAIL) Your ID for the service. Included only when Meta rejected the request (reasons 10 and up). Example: `463745743546345`. | #### Example: OK The comment was deleted. ```json { "status": "OK", "from": "463745743546345", "timestamp": 1600115719, "reason": 1, "commentId": "17870913679156914", "deleted": true } ``` #### Example: Reason 3 Wrong apiKey. ```json { "status": "FAIL", "reason": 3 } ``` #### Example: Reason 13 The comment was not found, or it is not accessible. ```json { "status": "FAIL", "reason": 13, "from": "463745743546345" } ``` --- # Toggle Comments Source: https://docs.99digital.co.il/facebook-api/instagram-pages/toggle-comments Markdown: https://docs.99digital.co.il/markdown/facebook-api/instagram-pages/toggle-comments.md Section: Facebook API › Instagram Pages `POST https://api.99digital.co.il/instagram/page/toggleComments` This endpoint allows you to enable or disable comments on an Instagram post. **Settings**: | Setting | Value | | --- | --- | | URL | `https://api.99digital.co.il/instagram/page/toggleComments` | | Method | JSON via POST | | Header | Your API key for the service (the `apiKey` header) | **Body**: | Parameter | Description / Example | Mandatory | Example | | --- | --- | --- | --- | | from | The ID you received for the connection | yes | 463745743546345 | | mediaId | The media ID you wish to do the action on: the mediaId you received from [Create Post](https://docs.99digital.co.il/facebook-api/instagram-pages/create-post), or the post's id in [All Posts](https://docs.99digital.co.il/facebook-api/instagram-pages/all-posts) | yes | 15625364215_56994166514 | | enabled | 1 for allow comments. 0 for disable comments. If you leave it out, comments are allowed. true / false work too, as a number or a string; any other value returns reason 8 | no (default 1) | 1 | **Response**: ```json { "status": "OK", "mediaId": "15234562345623_952362434423178", "enabled": true, "timestamp": 1600115719, "from": "463745743546345", "reason": 1 } ``` **Response-Explain**: | Parameter | Description | | --- | --- | | status | OK or FAIL | | mediaId | The media ID of the post you changed | | timestamp | Time stamp of the message | | from | Your ID for the service | | enabled | true if comments are now allowed on the post. false if they are disabled | **reason**: | Value | Information | | --- | --- | | 1 | Not FAIL. The status is OK | | 2 | Your "from" account does not exist (or is missing), or JSON syntax error | | 3 | Wrong apiKey (the apiKey header is missing or wrong) | | 6 | Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Instagram endpoint) | | 7 | Onboarding is still in progress, or the connection was disabled (the connection is not active) | | 8 | 'enabled' is not 1 or 0 (or true / false) | | 10 | You must do the onboarding again, the connection has expired | | 12 | Rate limit error. Too many requests. Please wait a few minutes and try again | | 13 | The media ID you provided is invalid or wrong: the post was not found, or it is not accessible | | 18 | General error / wrong information or bad payload. Please check the payload again and try again | ## Authentication `apiKey` in the header — Your API key for the service. ## Request body Content type: `application/json` (required) | Field | Type | Required | Description | | --- | --- | --- | --- | | `from` | string | Yes | The ID you received for the connection. Example: `463745743546345`. | | `mediaId` | string | Yes | The media ID you wish to do the action on — the `mediaId` you received from [Create Post](https://docs.99digital.co.il/facebook-api/instagram-pages/create-post), or the post's `id` in [All Posts](https://docs.99digital.co.il/facebook-api/instagram-pages/all-posts). Example: `17895695668004550`. | | `enabled` | integer | No | Whether people can comment on the post: 1 for allow comments, 0 for disable comments. If you leave it out, comments are allowed. `true` / `false` work too, as a number or a string; any other value returns reason 8. One of: `0` — Disable comments — nobody can comment on the post; `1` — Allow comments — people can comment on the post. Default: `1`. | ### Example: Disable comments Nobody can comment on the post. ```json { "from": "463745743546345", "mediaId": "17895695668004550", "enabled": 0 } ``` ### Example: Enable comments People can comment on the post again. ```json { "from": "463745743546345", "mediaId": "17895695668004550", "enabled": 1 } ``` ## Responses ### 200 — The request was processed. Both a successful and a failed request answer with HTTP 200 — check `status`, and `reason` when it is FAIL. Content type: `application/json` | Field | Type | Description | | --- | --- | --- | | `status` | string | (one of: OK) OK or FAIL. `OK` — the change was made. Always `OK`. | | `from` | string | (one of: OK) Your ID for the service. Example: `463745743546345`. | | `timestamp` | integer | (one of: OK) Time stamp of the message (Unix time, in seconds). Example: `1600115719`. | | `mediaId` | string | (one of: OK) The media ID of the post you changed. Example: `17895695668004550`. | | `enabled` | boolean | (one of: OK) `true` if comments are now allowed on the post. `false` if they are disabled. | | `reason` | integer | (one of: OK) 1 — not FAIL, the status is OK. Always `1`. | | `status` | string | (one of: FAIL) FAIL — the request was not carried out. `reason` says why. Always `FAIL`. | | `reason` | integer | (one of: FAIL) The status explanation in case of FAIL. One of: `2` — Your "from" account does not exist (or is missing), or JSON syntax error; `3` — Wrong apiKey (the apiKey header is missing or wrong); `6` — Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Instagram endpoint); `7` — Onboarding is still in progress, or the connection was disabled (the connection is not active); `8` — 'enabled' is not 1 or 0 (or true / false); `10` — You must do the onboarding again, the connection has expired; `12` — Rate limit error. Too many requests. Please wait a few minutes and try again; `13` — The media ID you provided is invalid or wrong: the post was not found, or it is not accessible; `18` — General error / wrong information or bad payload. Please check the payload again and try again. | | `from` | string | (one of: FAIL) Your ID for the service. Included only when Meta rejected the request (reasons 10 and up). Example: `463745743546345`. | #### Example: OK Comments are disabled on the post. ```json { "status": "OK", "from": "463745743546345", "timestamp": 1600115719, "reason": 1, "mediaId": "17895695668004550", "enabled": false } ``` #### Example: OK — enabled Comments are allowed on the post again. ```json { "status": "OK", "from": "463745743546345", "timestamp": 1600115719, "reason": 1, "mediaId": "17895695668004550", "enabled": true } ``` #### Example: Reason 3 Wrong apiKey. ```json { "status": "FAIL", "reason": 3 } ``` #### Example: Reason 13 The post was not found, or it is not accessible. ```json { "status": "FAIL", "reason": 13, "from": "463745743546345" } ``` --- # Hide Comment Source: https://docs.99digital.co.il/facebook-api/instagram-pages/hide-comment Markdown: https://docs.99digital.co.il/markdown/facebook-api/instagram-pages/hide-comment.md Section: Facebook API › Instagram Pages `POST https://api.99digital.co.il/instagram/page/hideComment` Hide a comment allows you to make a comment hidden (or back to visible) from the public, so it stays visible only to the writer of the comment, their friends and the admin of the page. **Settings**: | Setting | Value | | --- | --- | | URL | `https://api.99digital.co.il/instagram/page/hideComment` | | Method | JSON via POST | | Header | Your API key for the service (the `apiKey` header) | **Body**: | Parameter | Description / Example | Mandatory | Example | | --- | --- | --- | --- | | from | The ID you received for the connection | yes | 463745743546345 | | commentId | The comment ID you wish to do the action on (the id of the comment in [All Comments](https://docs.99digital.co.il/facebook-api/instagram-pages/all-comments)) | yes | 652346734563_3463234623 | | hide | 1 - hide. 0 - unhide. If you leave it out, the comment is hidden. true / false work too, as a number or a string; any other value returns reason 8 | no (default 1) | 1 | **Response**: ```json { "status": "OK", "commentId": "15234562345623_952362434423178", "from": "463745743546345", "timestamp": 1600115719, "hidden": true, "reason": 1 } ``` **Response-Explain**: | Parameter | Description | | --- | --- | | status | OK or FAIL | | commentId | The comment ID you did the action on (hid or unhid) | | from | Your ID for the service | | timestamp | Time stamp of the message | | hidden | true if the comment was hidden. false if the comment is not hidden | **reason**: | Value | Information | | --- | --- | | 1 | Not FAIL. The status is OK | | 2 | Your "from" account does not exist (or is missing), or JSON syntax error | | 3 | Wrong apiKey (the apiKey header is missing or wrong) | | 4 | commentId is invalid or wrong (missing, or not a valid comment ID) | | 6 | Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Instagram endpoint) | | 7 | Onboarding is still in progress, or the connection was disabled (the connection is not active) | | 8 | 'hide' is not 1 or 0 (or true / false) | | 10 | You must do the onboarding again, the connection has expired | | 12 | Rate limit error. Too many requests. Please wait a few minutes and try again | | 18 | General error, try again | **Remarks**: - Hiding is reversible: send `hide` 0 to make the comment visible again. To remove a comment for good, use [Delete Comment](https://docs.99digital.co.il/facebook-api/instagram-pages/delete-comment). ## Authentication `apiKey` in the header — Your API key for the service. ## Request body Content type: `application/json` (required) | Field | Type | Required | Description | | --- | --- | --- | --- | | `from` | string | Yes | The ID you received for the connection. Example: `463745743546345`. | | `commentId` | string | Yes | The comment ID you wish to do the action on — the `id` of the comment in [All Comments](https://docs.99digital.co.il/facebook-api/instagram-pages/all-comments). Example: `17870913679156914`. | | `hide` | integer | No | 1 - hide, 0 - unhide. If you leave it out, the comment is hidden. `true` / `false` work too, as a number or a string; any other value returns reason 8. One of: `0` — Unhide — the comment is visible to the public again; `1` — Hide — the comment stays visible only to its writer, their friends and the admin of the page. Default: `1`. | ### Example: Hide Hide the comment from the public. ```json { "from": "463745743546345", "commentId": "17870913679156914", "hide": 1 } ``` ### Example: Unhide Make the comment visible to the public again. ```json { "from": "463745743546345", "commentId": "17870913679156914", "hide": 0 } ``` ## Responses ### 200 — The request was processed. Both a successful and a failed request answer with HTTP 200 — check `status`, and `reason` when it is FAIL. Content type: `application/json` | Field | Type | Description | | --- | --- | --- | | `status` | string | (one of: OK) OK or FAIL. `OK` — the change was made. Always `OK`. | | `from` | string | (one of: OK) Your ID for the service. Example: `463745743546345`. | | `timestamp` | integer | (one of: OK) Time stamp of the message (Unix time, in seconds). Example: `1600115719`. | | `commentId` | string | (one of: OK) The comment ID you did the action on (hid or unhid). Example: `17870913679156914`. | | `hidden` | boolean | (one of: OK) `true` if the comment was hidden. `false` if the comment is not hidden. | | `reason` | integer | (one of: OK) 1 — not FAIL, the status is OK. Always `1`. | | `status` | string | (one of: FAIL) FAIL — the request was not carried out. `reason` says why. Always `FAIL`. | | `reason` | integer | (one of: FAIL) The status explanation in case of FAIL. One of: `2` — Your "from" account does not exist (or is missing), or JSON syntax error; `3` — Wrong apiKey (the apiKey header is missing or wrong); `4` — The 'commentId' is invalid or wrong (missing, or not a valid comment ID); `6` — Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Instagram endpoint); `7` — Onboarding is still in progress, or the connection was disabled (the connection is not active); `8` — 'hide' is not 1 or 0 (or true / false); `10` — You must do the onboarding again, the connection has expired; `12` — Rate limit error. Too many requests. Please wait a few minutes and try again; `18` — General error, try again. | | `from` | string | (one of: FAIL) Your ID for the service. Included only when Meta rejected the request (reasons 10 and up). Example: `463745743546345`. | #### Example: OK The comment is hidden. ```json { "status": "OK", "from": "463745743546345", "timestamp": 1600115719, "reason": 1, "commentId": "17870913679156914", "hidden": true } ``` #### Example: OK — unhidden The comment is visible to the public again. ```json { "status": "OK", "from": "463745743546345", "timestamp": 1600115719, "reason": 1, "commentId": "17870913679156914", "hidden": false } ``` #### Example: Reason 4 'commentId' is missing or is not a valid comment ID. ```json { "status": "FAIL", "reason": 4 } ``` #### Example: Reason 10 The connection has expired — do onboarding again. ```json { "status": "FAIL", "reason": 10, "from": "463745743546345" } ``` --- # Private Reply Source: https://docs.99digital.co.il/facebook-api/instagram-pages/private-reply Markdown: https://docs.99digital.co.il/markdown/facebook-api/instagram-pages/private-reply.md Section: Facebook API › Instagram Pages `POST https://api.99digital.co.il/instagram/page/privateReply` This endpoint allows you to send a direct message private reply (DM) to a user that left a comment on your post. You are allowed to send a one-time private reply to a person who wrote a public comment on your media post: you can only send one private reply per comment, within 7 days of when it was written. If the user replies, you can keep chatting with them during a 24-hour open session. You can reply to them directly in Instagram DM, or using the Instagram Messenger API if you connected it. **Settings**: | Setting | Value | | --- | --- | | URL | `https://api.99digital.co.il/instagram/page/privateReply` | | Method | JSON via POST | | Header | Your API key for the service (the `apiKey` header) | **Body**: | Parameter | Description / Example | Mandatory | Example | | --- | --- | --- | --- | | from | The ID you received for the connection | yes | 463745743546345 | | commentId | The comment ID that was posted on your media post, of which you wish to send the private reply to the visitor (the id of the comment in [All Comments](https://docs.99digital.co.il/facebook-api/instagram-pages/all-comments)) | yes | 652346734563_3463234623 | | body | The private message (DM) you want to send to the visitor that wrote the comment. 1,000 bytes maximum (UTF-8): an English letter, a digit or a space is 1 byte, a Hebrew letter 2 bytes, and an emoji usually 4 bytes | yes | Thank you for the comment! Here are our special deals | **Response**: ```json { "status": "OK", "commentId": "15234562345623_425235245346", "from": "463745743546345", "messageId": "aWdfZG06MTpnaDoxMjM0NTY3ODkwOjM0", "body": "Thank you for the comment! Here are our special deals", "timestamp": 1600115719, "reason": 1 } ``` **Response-Explain**: | Parameter | Description | | --- | --- | | status | OK or FAIL | | commentId | The original commentId provided in the request (the comment you replied to) | | messageId | The DM message ID (the ID of the private message that was sent) | | timestamp | Time stamp of the message | | from | Your ID for the service | | body | The message you wrote | **reason**: | Value | Information | | --- | --- | | 1 | Not FAIL. The status is OK | | 2 | Your "from" account does not exist (or is missing), or JSON syntax error | | 3 | Wrong apiKey (the apiKey header is missing or wrong) | | 4 | commentId is missing (or is not a valid comment ID) | | 5 | Missing or invalid content: the 'body' is missing or empty | | 6 | Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Instagram endpoint) | | 7 | Onboarding is still in progress, or the connection was disabled (the connection is not active) | | 8 | The "body" is more than 1,000 bytes long | | 10 | You must do the onboarding again, the connection has expired | | 12 | Rate limit error. Too many requests. Please wait a few minutes and try again | | 13 | The commentId is invalid or wrong: the comment was not found, or it is not accessible | | 14 | You already sent a private reply to this comment, or it is more than 7 days old. Meta allows one private reply, within 7 days | | 15 | The content you posted was rejected by Meta, or bad media / format / size, or an invalid parameter. It could also indicate a policy violation inside the content | | 18 | General error, try again | ## Authentication `apiKey` in the header — Your API key for the service. ## Request body Content type: `application/json` (required) | Field | Type | Required | Description | | --- | --- | --- | --- | | `from` | string | Yes | The ID you received for the connection. Example: `463745743546345`. | | `commentId` | string | Yes | The comment ID that was posted on your media post, of which you wish to send the private reply to the visitor (the `id` of the comment in [All Comments](https://docs.99digital.co.il/facebook-api/instagram-pages/all-comments)). Example: `17870913679156914`. | | `body` | string | Yes | The private message (DM) you want to send to the visitor that wrote the comment. 1,000 bytes maximum (UTF-8): an English letter, a digit or a space is 1 byte, a Hebrew letter 2 bytes, and an emoji usually 4 bytes. Example: `Thank you for the comment! Here are our special deals.`. | ### Example (generated from the schema) ```json { "from": "463745743546345", "commentId": "17870913679156914", "body": "Thank you for the comment! Here are our special deals." } ``` ## Responses ### 200 — The request was processed. Both a successful and a failed request answer with HTTP 200 — check `status`, and `reason` when it is FAIL. Content type: `application/json` | Field | Type | Description | | --- | --- | --- | | `status` | string | (one of: OK) OK or FAIL. `OK` — the private reply was sent. Always `OK`. | | `from` | string | (one of: OK) Your ID for the service. Example: `463745743546345`. | | `timestamp` | integer | (one of: OK) Time stamp of the message (Unix time, in seconds). Example: `1600115719`. | | `commentId` | string | (one of: OK) The original commentId provided in the request (the comment you replied to). Example: `17870913679156914`. | | `messageId` | string | (one of: OK) The DM message ID (the ID of the private message that was sent). Example: `aWdfZG06MTpnaDoxMjM0NTY3ODkwOjM0`. | | `body` | string | (one of: OK) The message you wrote. Example: `Thank you for the comment! Here are our special deals.`. | | `reason` | integer | (one of: OK) 1 — not FAIL, the status is OK. Always `1`. | | `status` | string | (one of: FAIL) FAIL — the request was not carried out. `reason` says why. Always `FAIL`. | | `reason` | integer | (one of: FAIL) The status explanation in case of FAIL. One of: `2` — Your "from" account does not exist (or is missing), or JSON syntax error; `3` — Wrong apiKey (the apiKey header is missing or wrong); `4` — The 'commentId' is missing (or is not a valid comment ID); `5` — Missing or invalid content — the 'body' is missing or empty; `6` — Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Instagram endpoint); `7` — Onboarding is still in progress, or the connection was disabled (the connection is not active); `8` — The 'body' is more than 1,000 bytes long; `10` — You must do the onboarding again, the connection has expired; `12` — Rate limit error. Too many requests. Please wait a few minutes and try again; `13` — The `commentId` is invalid or wrong: the comment was not found, or it is not accessible; `14` — You already sent a private reply to this comment, or it is more than 7 days old — Meta allows one private reply, within 7 days; `15` — The content you posted was rejected by Meta, or bad media / format / size, or an invalid parameter. It could also indicate a policy violation inside the content; `18` — General error, try again. | | `from` | string | (one of: FAIL) Your ID for the service. Included only when Meta rejected the request (reasons 10 and up). Example: `463745743546345`. | #### Example: OK The private reply was sent to the person who wrote the comment. ```json { "status": "OK", "from": "463745743546345", "timestamp": 1600115719, "reason": 1, "commentId": "17870913679156914", "messageId": "aWdfZG06MTpnaDoxMjM0NTY3ODkwOjM0", "body": "Thank you for the comment! Here are our special deals." } ``` #### Example: Reason 4 'commentId' is missing or is not a valid comment ID. ```json { "status": "FAIL", "reason": 4 } ``` #### Example: Reason 5 'body' is missing or empty. ```json { "status": "FAIL", "reason": 5 } ``` #### Example: Reason 8 'body' is more than 1,000 bytes long. ```json { "status": "FAIL", "reason": 8 } ``` #### Example: Reason 13 The comment was not found, or it is not accessible. ```json { "status": "FAIL", "reason": 13, "from": "463745743546345" } ```