Create self-hosted files
curl --request POST \
--url https://managexrapi.com/v1/files/ \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
[
{
"url": "https://my-bucket-name.s3.amazonaws.com/main_assets_all.bundle",
"name": "main_assets_all.bundle",
"size": 1204975930,
"md5": "7ah69cMtXyaz5OfsCRtOjQ==",
"description": "Content bundle for training app",
"libraryDirectoryPath": "/com.managexr.demoTrainingApp/"
},
{
"url": "https://my-bucket-name.s3.amazonaws.com/module2-assets.bundle",
"name": "module2-assets.bundle",
"size": 1204975930,
"md5": "7ah69cMtXyaz5OfsCRtOjQ==",
"description": "Assets for module 2 of training app",
"libraryDirectoryPath": "/com.managexr.demoTrainingApp/"
}
]
'import requests
url = "https://managexrapi.com/v1/files/"
payload = [
{
"url": "https://my-bucket-name.s3.amazonaws.com/main_assets_all.bundle",
"name": "main_assets_all.bundle",
"size": 1204975930,
"md5": "7ah69cMtXyaz5OfsCRtOjQ==",
"description": "Content bundle for training app",
"libraryDirectoryPath": "/com.managexr.demoTrainingApp/"
},
{
"url": "https://my-bucket-name.s3.amazonaws.com/module2-assets.bundle",
"name": "module2-assets.bundle",
"size": 1204975930,
"md5": "7ah69cMtXyaz5OfsCRtOjQ==",
"description": "Assets for module 2 of training app",
"libraryDirectoryPath": "/com.managexr.demoTrainingApp/"
}
]
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
url: 'https://my-bucket-name.s3.amazonaws.com/main_assets_all.bundle',
name: 'main_assets_all.bundle',
size: 1204975930,
md5: '7ah69cMtXyaz5OfsCRtOjQ==',
description: 'Content bundle for training app',
libraryDirectoryPath: '/com.managexr.demoTrainingApp/'
},
{
url: 'https://my-bucket-name.s3.amazonaws.com/module2-assets.bundle',
name: 'module2-assets.bundle',
size: 1204975930,
md5: '7ah69cMtXyaz5OfsCRtOjQ==',
description: 'Assets for module 2 of training app',
libraryDirectoryPath: '/com.managexr.demoTrainingApp/'
}
])
};
fetch('https://managexrapi.com/v1/files/', 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://managexrapi.com/v1/files/",
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' => 'https://my-bucket-name.s3.amazonaws.com/main_assets_all.bundle',
'name' => 'main_assets_all.bundle',
'size' => 1204975930,
'md5' => '7ah69cMtXyaz5OfsCRtOjQ==',
'description' => 'Content bundle for training app',
'libraryDirectoryPath' => '/com.managexr.demoTrainingApp/'
],
[
'url' => 'https://my-bucket-name.s3.amazonaws.com/module2-assets.bundle',
'name' => 'module2-assets.bundle',
'size' => 1204975930,
'md5' => '7ah69cMtXyaz5OfsCRtOjQ==',
'description' => 'Assets for module 2 of training app',
'libraryDirectoryPath' => '/com.managexr.demoTrainingApp/'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://managexrapi.com/v1/files/"
payload := strings.NewReader("[\n {\n \"url\": \"https://my-bucket-name.s3.amazonaws.com/main_assets_all.bundle\",\n \"name\": \"main_assets_all.bundle\",\n \"size\": 1204975930,\n \"md5\": \"7ah69cMtXyaz5OfsCRtOjQ==\",\n \"description\": \"Content bundle for training app\",\n \"libraryDirectoryPath\": \"/com.managexr.demoTrainingApp/\"\n },\n {\n \"url\": \"https://my-bucket-name.s3.amazonaws.com/module2-assets.bundle\",\n \"name\": \"module2-assets.bundle\",\n \"size\": 1204975930,\n \"md5\": \"7ah69cMtXyaz5OfsCRtOjQ==\",\n \"description\": \"Assets for module 2 of training app\",\n \"libraryDirectoryPath\": \"/com.managexr.demoTrainingApp/\"\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://managexrapi.com/v1/files/")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("[\n {\n \"url\": \"https://my-bucket-name.s3.amazonaws.com/main_assets_all.bundle\",\n \"name\": \"main_assets_all.bundle\",\n \"size\": 1204975930,\n \"md5\": \"7ah69cMtXyaz5OfsCRtOjQ==\",\n \"description\": \"Content bundle for training app\",\n \"libraryDirectoryPath\": \"/com.managexr.demoTrainingApp/\"\n },\n {\n \"url\": \"https://my-bucket-name.s3.amazonaws.com/module2-assets.bundle\",\n \"name\": \"module2-assets.bundle\",\n \"size\": 1204975930,\n \"md5\": \"7ah69cMtXyaz5OfsCRtOjQ==\",\n \"description\": \"Assets for module 2 of training app\",\n \"libraryDirectoryPath\": \"/com.managexr.demoTrainingApp/\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://managexrapi.com/v1/files/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"url\": \"https://my-bucket-name.s3.amazonaws.com/main_assets_all.bundle\",\n \"name\": \"main_assets_all.bundle\",\n \"size\": 1204975930,\n \"md5\": \"7ah69cMtXyaz5OfsCRtOjQ==\",\n \"description\": \"Content bundle for training app\",\n \"libraryDirectoryPath\": \"/com.managexr.demoTrainingApp/\"\n },\n {\n \"url\": \"https://my-bucket-name.s3.amazonaws.com/module2-assets.bundle\",\n \"name\": \"module2-assets.bundle\",\n \"size\": 1204975930,\n \"md5\": \"7ah69cMtXyaz5OfsCRtOjQ==\",\n \"description\": \"Assets for module 2 of training app\",\n \"libraryDirectoryPath\": \"/com.managexr.demoTrainingApp/\"\n }\n]"
response = http.request(request)
puts response.read_bodyLibrary
Create Files
Create self-hosted files in your ManageXR Files library.
Once created, you can use Edit App Version or Edit Configuration to deploy the file with an app version or on a configuration, respectively.
To create files hosted on ManageXR’s servers, use the ManageXR CLI
POST
/
v1
/
files
/
Create self-hosted files
curl --request POST \
--url https://managexrapi.com/v1/files/ \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
[
{
"url": "https://my-bucket-name.s3.amazonaws.com/main_assets_all.bundle",
"name": "main_assets_all.bundle",
"size": 1204975930,
"md5": "7ah69cMtXyaz5OfsCRtOjQ==",
"description": "Content bundle for training app",
"libraryDirectoryPath": "/com.managexr.demoTrainingApp/"
},
{
"url": "https://my-bucket-name.s3.amazonaws.com/module2-assets.bundle",
"name": "module2-assets.bundle",
"size": 1204975930,
"md5": "7ah69cMtXyaz5OfsCRtOjQ==",
"description": "Assets for module 2 of training app",
"libraryDirectoryPath": "/com.managexr.demoTrainingApp/"
}
]
'import requests
url = "https://managexrapi.com/v1/files/"
payload = [
{
"url": "https://my-bucket-name.s3.amazonaws.com/main_assets_all.bundle",
"name": "main_assets_all.bundle",
"size": 1204975930,
"md5": "7ah69cMtXyaz5OfsCRtOjQ==",
"description": "Content bundle for training app",
"libraryDirectoryPath": "/com.managexr.demoTrainingApp/"
},
{
"url": "https://my-bucket-name.s3.amazonaws.com/module2-assets.bundle",
"name": "module2-assets.bundle",
"size": 1204975930,
"md5": "7ah69cMtXyaz5OfsCRtOjQ==",
"description": "Assets for module 2 of training app",
"libraryDirectoryPath": "/com.managexr.demoTrainingApp/"
}
]
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
url: 'https://my-bucket-name.s3.amazonaws.com/main_assets_all.bundle',
name: 'main_assets_all.bundle',
size: 1204975930,
md5: '7ah69cMtXyaz5OfsCRtOjQ==',
description: 'Content bundle for training app',
libraryDirectoryPath: '/com.managexr.demoTrainingApp/'
},
{
url: 'https://my-bucket-name.s3.amazonaws.com/module2-assets.bundle',
name: 'module2-assets.bundle',
size: 1204975930,
md5: '7ah69cMtXyaz5OfsCRtOjQ==',
description: 'Assets for module 2 of training app',
libraryDirectoryPath: '/com.managexr.demoTrainingApp/'
}
])
};
fetch('https://managexrapi.com/v1/files/', 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://managexrapi.com/v1/files/",
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' => 'https://my-bucket-name.s3.amazonaws.com/main_assets_all.bundle',
'name' => 'main_assets_all.bundle',
'size' => 1204975930,
'md5' => '7ah69cMtXyaz5OfsCRtOjQ==',
'description' => 'Content bundle for training app',
'libraryDirectoryPath' => '/com.managexr.demoTrainingApp/'
],
[
'url' => 'https://my-bucket-name.s3.amazonaws.com/module2-assets.bundle',
'name' => 'module2-assets.bundle',
'size' => 1204975930,
'md5' => '7ah69cMtXyaz5OfsCRtOjQ==',
'description' => 'Assets for module 2 of training app',
'libraryDirectoryPath' => '/com.managexr.demoTrainingApp/'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://managexrapi.com/v1/files/"
payload := strings.NewReader("[\n {\n \"url\": \"https://my-bucket-name.s3.amazonaws.com/main_assets_all.bundle\",\n \"name\": \"main_assets_all.bundle\",\n \"size\": 1204975930,\n \"md5\": \"7ah69cMtXyaz5OfsCRtOjQ==\",\n \"description\": \"Content bundle for training app\",\n \"libraryDirectoryPath\": \"/com.managexr.demoTrainingApp/\"\n },\n {\n \"url\": \"https://my-bucket-name.s3.amazonaws.com/module2-assets.bundle\",\n \"name\": \"module2-assets.bundle\",\n \"size\": 1204975930,\n \"md5\": \"7ah69cMtXyaz5OfsCRtOjQ==\",\n \"description\": \"Assets for module 2 of training app\",\n \"libraryDirectoryPath\": \"/com.managexr.demoTrainingApp/\"\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://managexrapi.com/v1/files/")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("[\n {\n \"url\": \"https://my-bucket-name.s3.amazonaws.com/main_assets_all.bundle\",\n \"name\": \"main_assets_all.bundle\",\n \"size\": 1204975930,\n \"md5\": \"7ah69cMtXyaz5OfsCRtOjQ==\",\n \"description\": \"Content bundle for training app\",\n \"libraryDirectoryPath\": \"/com.managexr.demoTrainingApp/\"\n },\n {\n \"url\": \"https://my-bucket-name.s3.amazonaws.com/module2-assets.bundle\",\n \"name\": \"module2-assets.bundle\",\n \"size\": 1204975930,\n \"md5\": \"7ah69cMtXyaz5OfsCRtOjQ==\",\n \"description\": \"Assets for module 2 of training app\",\n \"libraryDirectoryPath\": \"/com.managexr.demoTrainingApp/\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://managexrapi.com/v1/files/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"url\": \"https://my-bucket-name.s3.amazonaws.com/main_assets_all.bundle\",\n \"name\": \"main_assets_all.bundle\",\n \"size\": 1204975930,\n \"md5\": \"7ah69cMtXyaz5OfsCRtOjQ==\",\n \"description\": \"Content bundle for training app\",\n \"libraryDirectoryPath\": \"/com.managexr.demoTrainingApp/\"\n },\n {\n \"url\": \"https://my-bucket-name.s3.amazonaws.com/module2-assets.bundle\",\n \"name\": \"module2-assets.bundle\",\n \"size\": 1204975930,\n \"md5\": \"7ah69cMtXyaz5OfsCRtOjQ==\",\n \"description\": \"Assets for module 2 of training app\",\n \"libraryDirectoryPath\": \"/com.managexr.demoTrainingApp/\"\n }\n]"
response = http.request(request)
puts response.read_bodyAuthorizations
Query Parameters
Body
application/json