Publishing
Publish a reel
Publish a reel to the Page. HookMyApp runs the upload session for you.
POST
/
channels
/
{channelId}
/
facebook
/
reels
Publish a reel
curl --request POST \
--url https://api.hookmyapp.com/channels/{channelId}/facebook/reels \
--header 'Content-Type: application/json' \
--data '
{
"videoUrl": "<string>",
"description": "<string>"
}
'import requests
url = "https://api.hookmyapp.com/channels/{channelId}/facebook/reels"
payload = {
"videoUrl": "<string>",
"description": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({videoUrl: '<string>', description: '<string>'})
};
fetch('https://api.hookmyapp.com/channels/{channelId}/facebook/reels', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hookmyapp.com/channels/{channelId}/facebook/reels",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'videoUrl' => '<string>',
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hookmyapp.com/channels/{channelId}/facebook/reels"
payload := strings.NewReader("{\n \"videoUrl\": \"<string>\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hookmyapp.com/channels/{channelId}/facebook/reels")
.header("Content-Type", "application/json")
.body("{\n \"videoUrl\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hookmyapp.com/channels/{channelId}/facebook/reels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"videoUrl\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyPublishes a reel from a public https URL. Meta’s reel upload is a three-step session (start, upload, finish); this route runs all three and returns the post id.
Authentication
Use anhmok_ API key and the workspace header, like every channel route. Requires a workspace admin.
Authorization: Bearer hmok_...
X-Workspace-Id: ws_...
Path parameters
string
required
The Facebook channel id (
ch_xxxxxxxx).Request body
string
required
Public https URL of an MP4.
string
Caption shown with the reel.
Example
curl -X POST "https://api.hookmyapp.com/channels/ch_xxxxxxxx/facebook/reels" \
-H "Authorization: Bearer hmok_..." \
-H "X-Workspace-Id: ws_..." \
-H "Content-Type: application/json" \
-d '{ "videoUrl": "https://example.com/clip.mp4", "description": "Behind the scenes" }'
Successful response
{ "channelId": "ch_xxxxxxxx", "postId": "100000000000001_500000000000003", "kind": "reel" }
Errors
| Status | code | Meaning |
|---|---|---|
404 | CHANNEL_NOT_FOUND | No such channel in this workspace. |
400 | MCP_FB_NOT_FACEBOOK | The channel is not a Facebook Page. |
403 | FACEBOOK_SCOPE_MISSING | The Page was connected without publishing access. Reconnect the Page to enable this. |
⌘I
Publish a reel
curl --request POST \
--url https://api.hookmyapp.com/channels/{channelId}/facebook/reels \
--header 'Content-Type: application/json' \
--data '
{
"videoUrl": "<string>",
"description": "<string>"
}
'import requests
url = "https://api.hookmyapp.com/channels/{channelId}/facebook/reels"
payload = {
"videoUrl": "<string>",
"description": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({videoUrl: '<string>', description: '<string>'})
};
fetch('https://api.hookmyapp.com/channels/{channelId}/facebook/reels', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hookmyapp.com/channels/{channelId}/facebook/reels",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'videoUrl' => '<string>',
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hookmyapp.com/channels/{channelId}/facebook/reels"
payload := strings.NewReader("{\n \"videoUrl\": \"<string>\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hookmyapp.com/channels/{channelId}/facebook/reels")
.header("Content-Type", "application/json")
.body("{\n \"videoUrl\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hookmyapp.com/channels/{channelId}/facebook/reels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"videoUrl\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body