Upload an asset from URL
curl --request POST \
--url https://api.journeybee.io/v1/assets/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"file_name": "<string>",
"description": "<string>"
}
'import requests
url = "https://api.journeybee.io/v1/assets/"
payload = {
"url": "<string>",
"file_name": "<string>",
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', file_name: '<string>', description: '<string>'})
};
fetch('https://api.journeybee.io/v1/assets/', 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.journeybee.io/v1/assets/",
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([
'url' => '<string>',
'file_name' => '<string>',
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.journeybee.io/v1/assets/"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"file_name\": \"<string>\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.journeybee.io/v1/assets/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"file_name\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.journeybee.io/v1/assets/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"file_name\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"uuid": "<string>",
"file_name": "<string>",
"file_url": "<string>",
"mime_type": "<string>",
"size": 123,
"width": 123,
"height": 123,
"category": "resource",
"resource_type": "<string>",
"description": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}Assets
Upload an asset from URL
Fetches a file from the provided public URL and uploads it to Journeybee’s CDN. Returns the asset with a UUID that can be used in resource blocks, room blocks, and other content. Maximum file size: 5GB.
POST
/
assets
/
Upload an asset from URL
curl --request POST \
--url https://api.journeybee.io/v1/assets/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"file_name": "<string>",
"description": "<string>"
}
'import requests
url = "https://api.journeybee.io/v1/assets/"
payload = {
"url": "<string>",
"file_name": "<string>",
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', file_name: '<string>', description: '<string>'})
};
fetch('https://api.journeybee.io/v1/assets/', 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.journeybee.io/v1/assets/",
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([
'url' => '<string>',
'file_name' => '<string>',
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.journeybee.io/v1/assets/"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"file_name\": \"<string>\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.journeybee.io/v1/assets/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"file_name\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.journeybee.io/v1/assets/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"file_name\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"uuid": "<string>",
"file_name": "<string>",
"file_url": "<string>",
"mime_type": "<string>",
"size": 123,
"width": 123,
"height": 123,
"category": "resource",
"resource_type": "<string>",
"description": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}Authorizations
API key authentication. Use "Bearer <api_key>" or "Api-Key <api_key>".
Body
application/json
Public URL of the file to upload. The file will be fetched and stored in Journeybee's CDN.
Maximum string length:
2000Asset category: 'resource' for use in resources and certifications, 'room' for use in rooms and partner portal
Available options:
resource, room Override the file name. If not provided, the original filename is used.
Maximum string length:
500Description of the asset
Maximum string length:
2000Resource visibility type. Only used when category is 'resource'. Defaults to 'partner'.
Available options:
partner, internal, campaigns Response
201 - application/json
Default Response
Asset category
Available options:
resource, room