Publishing
Publish a video
Post a video by URL to the Page.
POST
/
meta
/
v25.0
/
{pageId}
/
videos
Publish a video
curl --request POST \
--url https://gateway.hookmyapp.com/meta/v25.0/{pageId}/videos \
--header 'Content-Type: application/json' \
--data '
{
"file_url": "<string>",
"description": "<string>"
}
'import requests
url = "https://gateway.hookmyapp.com/meta/v25.0/{pageId}/videos"
payload = {
"file_url": "<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({file_url: '<string>', description: '<string>'})
};
fetch('https://gateway.hookmyapp.com/meta/v25.0/{pageId}/videos', 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://gateway.hookmyapp.com/meta/v25.0/{pageId}/videos",
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([
'file_url' => '<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://gateway.hookmyapp.com/meta/v25.0/{pageId}/videos"
payload := strings.NewReader("{\n \"file_url\": \"<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://gateway.hookmyapp.com/meta/v25.0/{pageId}/videos")
.header("Content-Type", "application/json")
.body("{\n \"file_url\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.hookmyapp.com/meta/v25.0/{pageId}/videos")
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 \"file_url\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyPublishes a video from a public https URL, with an optional description.
Facebook processes the video after the response; it appears on the Page when encoding finishes.
Authentication
Use thehmat_ channel token from GET /meta/channels/{id}/token or hookmyapp channels token <channel>. Do not use an hmok_ API key for this call.
Authorization: Bearer hmat_...
Path parameters
string
required
The connected Page id.
Request body
string
required
Public https URL of an MP4.
string
Caption shown with the video.
Example
curl -X POST "https://gateway.hookmyapp.com/meta/v25.0/{PAGE_ID}/videos" \
-H "Authorization: Bearer hmat_..." \
-H "Content-Type: application/json" \
-d '{ "file_url": "https://example.com/clip.mp4", "description": "Behind the scenes" }'
Successful response
{ "id": "800000000000001" }
⌘I
Publish a video
curl --request POST \
--url https://gateway.hookmyapp.com/meta/v25.0/{pageId}/videos \
--header 'Content-Type: application/json' \
--data '
{
"file_url": "<string>",
"description": "<string>"
}
'import requests
url = "https://gateway.hookmyapp.com/meta/v25.0/{pageId}/videos"
payload = {
"file_url": "<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({file_url: '<string>', description: '<string>'})
};
fetch('https://gateway.hookmyapp.com/meta/v25.0/{pageId}/videos', 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://gateway.hookmyapp.com/meta/v25.0/{pageId}/videos",
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([
'file_url' => '<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://gateway.hookmyapp.com/meta/v25.0/{pageId}/videos"
payload := strings.NewReader("{\n \"file_url\": \"<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://gateway.hookmyapp.com/meta/v25.0/{pageId}/videos")
.header("Content-Type", "application/json")
.body("{\n \"file_url\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.hookmyapp.com/meta/v25.0/{pageId}/videos")
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 \"file_url\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body