Create Catalog Public
curl --request POST \
--url https://catalogapi.rastro.ai/api/public/catalogs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"unique_id_field": "<string>",
"schema_definition": {},
"description": "<string>",
"product_id_field": "<string>",
"auto_evolve_schema": true,
"strict_mode": false,
"product_enabled": false,
"validation_rules": {},
"catalog_md": "<string>",
"master_catalog_id": "<string>",
"use_master_catalog_defaults": true
}
'import requests
url = "https://catalogapi.rastro.ai/api/public/catalogs"
payload = {
"name": "<string>",
"unique_id_field": "<string>",
"schema_definition": {},
"description": "<string>",
"product_id_field": "<string>",
"auto_evolve_schema": True,
"strict_mode": False,
"product_enabled": False,
"validation_rules": {},
"catalog_md": "<string>",
"master_catalog_id": "<string>",
"use_master_catalog_defaults": True
}
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: '<string>',
unique_id_field: '<string>',
schema_definition: {},
description: '<string>',
product_id_field: '<string>',
auto_evolve_schema: true,
strict_mode: false,
product_enabled: false,
validation_rules: {},
catalog_md: '<string>',
master_catalog_id: '<string>',
use_master_catalog_defaults: true
})
};
fetch('https://catalogapi.rastro.ai/api/public/catalogs', 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://catalogapi.rastro.ai/api/public/catalogs",
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' => '<string>',
'unique_id_field' => '<string>',
'schema_definition' => [
],
'description' => '<string>',
'product_id_field' => '<string>',
'auto_evolve_schema' => true,
'strict_mode' => false,
'product_enabled' => false,
'validation_rules' => [
],
'catalog_md' => '<string>',
'master_catalog_id' => '<string>',
'use_master_catalog_defaults' => true
]),
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://catalogapi.rastro.ai/api/public/catalogs"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"unique_id_field\": \"<string>\",\n \"schema_definition\": {},\n \"description\": \"<string>\",\n \"product_id_field\": \"<string>\",\n \"auto_evolve_schema\": true,\n \"strict_mode\": false,\n \"product_enabled\": false,\n \"validation_rules\": {},\n \"catalog_md\": \"<string>\",\n \"master_catalog_id\": \"<string>\",\n \"use_master_catalog_defaults\": true\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://catalogapi.rastro.ai/api/public/catalogs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"unique_id_field\": \"<string>\",\n \"schema_definition\": {},\n \"description\": \"<string>\",\n \"product_id_field\": \"<string>\",\n \"auto_evolve_schema\": true,\n \"strict_mode\": false,\n \"product_enabled\": false,\n \"validation_rules\": {},\n \"catalog_md\": \"<string>\",\n \"master_catalog_id\": \"<string>\",\n \"use_master_catalog_defaults\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://catalogapi.rastro.ai/api/public/catalogs")
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\": \"<string>\",\n \"unique_id_field\": \"<string>\",\n \"schema_definition\": {},\n \"description\": \"<string>\",\n \"product_id_field\": \"<string>\",\n \"auto_evolve_schema\": true,\n \"strict_mode\": false,\n \"product_enabled\": false,\n \"validation_rules\": {},\n \"catalog_md\": \"<string>\",\n \"master_catalog_id\": \"<string>\",\n \"use_master_catalog_defaults\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"organization_id": "<string>",
"name": "<string>",
"current_schema_version": "<string>",
"unique_id_field": "<string>",
"auto_evolve_schema": true,
"strict_mode": true,
"product_enabled": true,
"item_count": 123,
"created_by_user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"product_id_field": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"schema": {
"id": "<string>",
"catalog_id": "<string>",
"version": "<string>",
"schema_definition": {},
"backward_compatible": true,
"created_by": "<string>",
"change_reason": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"migration_rules": {},
"last_edited_by_workflow": "<string>",
"last_edited_at": "2023-11-07T05:31:56Z",
"fields_workflow_info": [],
"total_fields": 0,
"input_fields_count": 0,
"generated_fields_count": 0
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Catalogs
Create Catalog Public
Create a new catalog (API key or user token).
POST
/
public
/
catalogs
Create Catalog Public
curl --request POST \
--url https://catalogapi.rastro.ai/api/public/catalogs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"unique_id_field": "<string>",
"schema_definition": {},
"description": "<string>",
"product_id_field": "<string>",
"auto_evolve_schema": true,
"strict_mode": false,
"product_enabled": false,
"validation_rules": {},
"catalog_md": "<string>",
"master_catalog_id": "<string>",
"use_master_catalog_defaults": true
}
'import requests
url = "https://catalogapi.rastro.ai/api/public/catalogs"
payload = {
"name": "<string>",
"unique_id_field": "<string>",
"schema_definition": {},
"description": "<string>",
"product_id_field": "<string>",
"auto_evolve_schema": True,
"strict_mode": False,
"product_enabled": False,
"validation_rules": {},
"catalog_md": "<string>",
"master_catalog_id": "<string>",
"use_master_catalog_defaults": True
}
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: '<string>',
unique_id_field: '<string>',
schema_definition: {},
description: '<string>',
product_id_field: '<string>',
auto_evolve_schema: true,
strict_mode: false,
product_enabled: false,
validation_rules: {},
catalog_md: '<string>',
master_catalog_id: '<string>',
use_master_catalog_defaults: true
})
};
fetch('https://catalogapi.rastro.ai/api/public/catalogs', 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://catalogapi.rastro.ai/api/public/catalogs",
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' => '<string>',
'unique_id_field' => '<string>',
'schema_definition' => [
],
'description' => '<string>',
'product_id_field' => '<string>',
'auto_evolve_schema' => true,
'strict_mode' => false,
'product_enabled' => false,
'validation_rules' => [
],
'catalog_md' => '<string>',
'master_catalog_id' => '<string>',
'use_master_catalog_defaults' => true
]),
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://catalogapi.rastro.ai/api/public/catalogs"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"unique_id_field\": \"<string>\",\n \"schema_definition\": {},\n \"description\": \"<string>\",\n \"product_id_field\": \"<string>\",\n \"auto_evolve_schema\": true,\n \"strict_mode\": false,\n \"product_enabled\": false,\n \"validation_rules\": {},\n \"catalog_md\": \"<string>\",\n \"master_catalog_id\": \"<string>\",\n \"use_master_catalog_defaults\": true\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://catalogapi.rastro.ai/api/public/catalogs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"unique_id_field\": \"<string>\",\n \"schema_definition\": {},\n \"description\": \"<string>\",\n \"product_id_field\": \"<string>\",\n \"auto_evolve_schema\": true,\n \"strict_mode\": false,\n \"product_enabled\": false,\n \"validation_rules\": {},\n \"catalog_md\": \"<string>\",\n \"master_catalog_id\": \"<string>\",\n \"use_master_catalog_defaults\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://catalogapi.rastro.ai/api/public/catalogs")
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\": \"<string>\",\n \"unique_id_field\": \"<string>\",\n \"schema_definition\": {},\n \"description\": \"<string>\",\n \"product_id_field\": \"<string>\",\n \"auto_evolve_schema\": true,\n \"strict_mode\": false,\n \"product_enabled\": false,\n \"validation_rules\": {},\n \"catalog_md\": \"<string>\",\n \"master_catalog_id\": \"<string>\",\n \"use_master_catalog_defaults\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"organization_id": "<string>",
"name": "<string>",
"current_schema_version": "<string>",
"unique_id_field": "<string>",
"auto_evolve_schema": true,
"strict_mode": true,
"product_enabled": true,
"item_count": 123,
"created_by_user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"product_id_field": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"schema": {
"id": "<string>",
"catalog_id": "<string>",
"version": "<string>",
"schema_definition": {},
"backward_compatible": true,
"created_by": "<string>",
"change_reason": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"migration_rules": {},
"last_edited_by_workflow": "<string>",
"last_edited_at": "2023-11-07T05:31:56Z",
"fields_workflow_info": [],
"total_fields": 0,
"input_fields_count": 0,
"generated_fields_count": 0
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
application/json
Request to create a new catalog
Response
Successful Response
Response model for catalog information