cURL
curl --request POST \
--url https://api.opal.dev/v1/bundles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Engineering Team Bundle",
"description": "Engineering team bundle.",
"admin_owner_id": "7870617d-e72a-47f5-a84c-693817ab4567"
}
'import requests
url = "https://api.opal.dev/v1/bundles"
payload = {
"name": "Engineering Team Bundle",
"description": "Engineering team bundle.",
"admin_owner_id": "7870617d-e72a-47f5-a84c-693817ab4567"
}
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({
name: 'Engineering Team Bundle',
description: 'Engineering team bundle.',
admin_owner_id: '7870617d-e72a-47f5-a84c-693817ab4567'
})
};
fetch('https://api.opal.dev/v1/bundles', 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.opal.dev/v1/bundles",
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([
'name' => 'Engineering Team Bundle',
'description' => 'Engineering team bundle.',
'admin_owner_id' => '7870617d-e72a-47f5-a84c-693817ab4567'
]),
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.opal.dev/v1/bundles"
payload := strings.NewReader("{\n \"name\": \"Engineering Team Bundle\",\n \"description\": \"Engineering team bundle.\",\n \"admin_owner_id\": \"7870617d-e72a-47f5-a84c-693817ab4567\"\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.opal.dev/v1/bundles")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Engineering Team Bundle\",\n \"description\": \"Engineering team bundle.\",\n \"admin_owner_id\": \"7870617d-e72a-47f5-a84c-693817ab4567\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/bundles")
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 \"name\": \"Engineering Team Bundle\",\n \"description\": \"Engineering team bundle.\",\n \"admin_owner_id\": \"7870617d-e72a-47f5-a84c-693817ab4567\"\n}"
response = http.request(request)
puts response.read_body{
"bundle_id": "a381e7a3-e5e0-4c48-b1d6-4ccb4c191bc1",
"name": "Bundle 1",
"description": "Description of bundle 1",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"admin_owner_id": "4aed3e8a-727b-4d72-8010-3b8710c50bec",
"total_num_items": 15,
"total_num_resources": 10,
"total_num_groups": 5
}Post bundles
Creates a bundle.
POST
/
bundles
cURL
curl --request POST \
--url https://api.opal.dev/v1/bundles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Engineering Team Bundle",
"description": "Engineering team bundle.",
"admin_owner_id": "7870617d-e72a-47f5-a84c-693817ab4567"
}
'import requests
url = "https://api.opal.dev/v1/bundles"
payload = {
"name": "Engineering Team Bundle",
"description": "Engineering team bundle.",
"admin_owner_id": "7870617d-e72a-47f5-a84c-693817ab4567"
}
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({
name: 'Engineering Team Bundle',
description: 'Engineering team bundle.',
admin_owner_id: '7870617d-e72a-47f5-a84c-693817ab4567'
})
};
fetch('https://api.opal.dev/v1/bundles', 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.opal.dev/v1/bundles",
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([
'name' => 'Engineering Team Bundle',
'description' => 'Engineering team bundle.',
'admin_owner_id' => '7870617d-e72a-47f5-a84c-693817ab4567'
]),
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.opal.dev/v1/bundles"
payload := strings.NewReader("{\n \"name\": \"Engineering Team Bundle\",\n \"description\": \"Engineering team bundle.\",\n \"admin_owner_id\": \"7870617d-e72a-47f5-a84c-693817ab4567\"\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.opal.dev/v1/bundles")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Engineering Team Bundle\",\n \"description\": \"Engineering team bundle.\",\n \"admin_owner_id\": \"7870617d-e72a-47f5-a84c-693817ab4567\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/bundles")
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 \"name\": \"Engineering Team Bundle\",\n \"description\": \"Engineering team bundle.\",\n \"admin_owner_id\": \"7870617d-e72a-47f5-a84c-693817ab4567\"\n}"
response = http.request(request)
puts response.read_body{
"bundle_id": "a381e7a3-e5e0-4c48-b1d6-4ccb4c191bc1",
"name": "Bundle 1",
"description": "Description of bundle 1",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"admin_owner_id": "4aed3e8a-727b-4d72-8010-3b8710c50bec",
"total_num_items": 15,
"total_num_resources": 10,
"total_num_groups": 5
}Authorizations
Body
application/json
CreateBundleInfo Object
Description
The CreateBundleInfo object is used to store creation info for a bundle.
Usage Example
Use in the POST Bundles endpoint.
Response
201 - application/json
The bundle successfully created.
Was this page helpful?