cURL
curl --request POST \
--url https://{server}/api/collections/ \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"description": "",
"alias": "",
"tags": [
"<string>"
],
"type": [
"<string>"
],
"parent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"preferred_repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"license": "<string>"
}
'import requests
url = "https://{server}/api/collections/"
payload = {
"title": "<string>",
"description": "",
"alias": "",
"tags": ["<string>"],
"type": ["<string>"],
"parent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"preferred_repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"license": "<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({
title: '<string>',
description: '',
alias: '',
tags: ['<string>'],
type: ['<string>'],
parent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
owner_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
preferred_repository_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
license: '<string>'
})
};
fetch('https://{server}/api/collections/', 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://{server}/api/collections/",
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([
'title' => '<string>',
'description' => '',
'alias' => '',
'tags' => [
'<string>'
],
'type' => [
'<string>'
],
'parent_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'owner_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'preferred_repository_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'license' => '<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://{server}/api/collections/"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"description\": \"\",\n \"alias\": \"\",\n \"tags\": [\n \"<string>\"\n ],\n \"type\": [\n \"<string>\"\n ],\n \"parent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"preferred_repository_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"license\": \"<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://{server}/api/collections/")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"description\": \"\",\n \"alias\": \"\",\n \"tags\": [\n \"<string>\"\n ],\n \"type\": [\n \"<string>\"\n ],\n \"parent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"preferred_repository_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"license\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{server}/api/collections/")
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 \"title\": \"<string>\",\n \"description\": \"\",\n \"alias\": \"\",\n \"tags\": [\n \"<string>\"\n ],\n \"type\": [\n \"<string>\"\n ],\n \"parent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"preferred_repository_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"license\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"parent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parent_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"owner_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_root": true,
"preferred_repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"owner_user_name": "<string>",
"owner_project_name": "<string>",
"effective_flags": 123,
"is_starred": true,
"access_scope": "<string>",
"description": "<string>",
"alias": "<string>",
"tags": [
"<string>"
],
"type": [
"<string>"
],
"provenance_token": "<string>"
}POST
/
api
/
collections
/
cURL
curl --request POST \
--url https://{server}/api/collections/ \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"description": "",
"alias": "",
"tags": [
"<string>"
],
"type": [
"<string>"
],
"parent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"preferred_repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"license": "<string>"
}
'import requests
url = "https://{server}/api/collections/"
payload = {
"title": "<string>",
"description": "",
"alias": "",
"tags": ["<string>"],
"type": ["<string>"],
"parent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"preferred_repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"license": "<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({
title: '<string>',
description: '',
alias: '',
tags: ['<string>'],
type: ['<string>'],
parent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
owner_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
preferred_repository_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
license: '<string>'
})
};
fetch('https://{server}/api/collections/', 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://{server}/api/collections/",
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([
'title' => '<string>',
'description' => '',
'alias' => '',
'tags' => [
'<string>'
],
'type' => [
'<string>'
],
'parent_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'owner_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'preferred_repository_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'license' => '<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://{server}/api/collections/"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"description\": \"\",\n \"alias\": \"\",\n \"tags\": [\n \"<string>\"\n ],\n \"type\": [\n \"<string>\"\n ],\n \"parent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"preferred_repository_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"license\": \"<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://{server}/api/collections/")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"description\": \"\",\n \"alias\": \"\",\n \"tags\": [\n \"<string>\"\n ],\n \"type\": [\n \"<string>\"\n ],\n \"parent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"preferred_repository_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"license\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{server}/api/collections/")
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 \"title\": \"<string>\",\n \"description\": \"\",\n \"alias\": \"\",\n \"tags\": [\n \"<string>\"\n ],\n \"type\": [\n \"<string>\"\n ],\n \"parent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"preferred_repository_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"license\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"parent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parent_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"owner_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_root": true,
"preferred_repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"owner_user_name": "<string>",
"owner_project_name": "<string>",
"effective_flags": 123,
"is_starred": true,
"access_scope": "<string>",
"description": "<string>",
"alias": "<string>",
"tags": [
"<string>"
],
"type": [
"<string>"
],
"provenance_token": "<string>"
}Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Maximum string length:
255Maximum string length:
255Maximum string length:
100Maximum string length:
100project- projectuser- user
Available options:
project, user Response
201 - application/json
Maximum string length:
255Maximum string length:
255Maximum string length:
100Maximum string length:
100⌘I