SendReelByUrl#
Beta version
The functionality is in beta. Features may change and may also work unstably.
The method publishes Reels - a video in the account. The file is passed by a link.
Files
The method accepts a video only: a file of another type results in a refusal in the notification.
The video has to meet the Instagram requirements: MP4 from 3 to 180 seconds long with an aspect ratio from 0.5625 (9:16) to 1.91 (1.91:1). The recommended frame is 1080x1920.
There is no separate field for the cover in the request: the cover is picked from a frame of the video automatically.
Only on an instance authorized with a login
The method is available to an instance authorized by the Login method.
For an instance with an imported browser session the method responds with 422: Reels are not published via the web.
The method uses the limits on the number of requests per second.
Request#
To publish a Reel, you have to execute a request at:
{{apiUrl}}/waInstance{{idInstance}}/sendReelByUrl/{{apiTokenInstance}}
For apiUrl, idInstance and apiTokenInstance request parameters, refer to the Before you start section.
Request parameters#
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
urlFile | string | Yes | The link to the video file of the Reel |
caption | string | No | The caption of the post. The maximum length is 2200 characters |
disableComments | boolean | No | Publish the Reel with closed comments. The default is false |
Request body example#
Publish a Reels video:#
{
"urlFile": "https://example.com/reel.mp4",
"caption": "The caption of the Reel"
}
Publish a Reels video with closed comments:#
{
"urlFile": "https://example.com/reel.mp4",
"caption": "The caption of the Reel",
"disableComments": true
}
Response#
Response parameters#
| Field | Type | Description |
|---|---|---|
postId | string | The post identifier. |
Response body example#
{
"postId": "3977953643059237032"
}
SendReelByUrl errors#
For a list of errors common to all methods, refer to the Common errors section
| HTTP code | Error ID | Description |
|---|---|---|
| 400 | Bad Request Validation failed | Validation error |
| 400 | Validation failed. Details: 'urlFile' is required | The link to the file is not passed |
| 400 | Validation failed. Details: 'urlFile' must be a valid uri with a scheme matching the http\|https pattern | The link is not an http or https address |
| 422 | SendReelByUrl: not available for a web session | The instance is authorized by importing a browser session: such an instance does not publish Reels |
Refusals in the notification#
The command is executed through the queue: the method responds with 200 and postId at once. If the command could not be executed, the outgoingPostStatus notification arrives with status = failed, the reason is in the description field:
description | Description |
|---|---|
uploader answered 400: request was failed with bad status code (404). URL: 'http://example.com/file.mp4' | The file is not available at the specified link. The HTTP code of the response of the server that hosts the file is in the brackets |
unsupported file type for instagram post: application/octet-stream | What the link points to is neither an image nor a video of a suitable format |
post upload: video duration 310000 ms is outside 3000 … 180000 | The duration of the video is outside the allowed range, in milliseconds |
post upload: video aspect ratio 2.40 is outside 0.5625 … 1.91 | The aspect ratio of the video is outside the allowed range |
Request examples#
import requests
url = "{{apiUrl}}/waInstance{{idInstance}}/sendReelByUrl/{{apiTokenInstance}}"
payload = {
"urlFile": "https://example.com/reel.mp4",
"caption": "The caption of the Reel"
}
headers = {'Content-Type': 'application/json'}
response = requests.post(url, json=payload, headers=headers)
print(response.text.encode('utf8'))
curl --location '{{apiUrl}}/waInstance{{idInstance}}/sendReelByUrl/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"urlFile": "https://example.com/reel.mp4",
"caption": "The caption of the Reel"
}'