Update catalog
curl --request PUT \
--url https://api.squared.ai/api/v1/catalogs/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connector_id": 6,
"catalog": {
"json_schema": {
"field": "test_field"
}
}
}
'import requests
url = "https://api.squared.ai/api/v1/catalogs/{id}"
payload = {
"connector_id": 6,
"catalog": { "json_schema": { "field": "test_field" } }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({connector_id: 6, catalog: {json_schema: {field: 'test_field'}}})
};
fetch('https://api.squared.ai/api/v1/catalogs/{id}', 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.squared.ai/api/v1/catalogs/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'connector_id' => 6,
'catalog' => [
'json_schema' => [
'field' => 'test_field'
]
]
]),
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.squared.ai/api/v1/catalogs/{id}"
payload := strings.NewReader("{\n \"connector_id\": 6,\n \"catalog\": {\n \"json_schema\": {\n \"field\": \"test_field\"\n }\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.squared.ai/api/v1/catalogs/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connector_id\": 6,\n \"catalog\": {\n \"json_schema\": {\n \"field\": \"test_field\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.squared.ai/api/v1/catalogs/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connector_id\": 6,\n \"catalog\": {\n \"json_schema\": {\n \"field\": \"test_field\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "34",
"type": "catalogs",
"attributes": {
"connector_id": 6,
"workspace_id": 2,
"catalog": {
"streams": [
{
"name": "test_name",
"url": "test_url",
"json_schema": {
"field": "test field"
},
"batch_support": false,
"batch_size": 0,
"request_method": "POST"
}
],
"request_rate_concurrency": 10,
"request_rate_limit": 600,
"request_rate_limit_unit": "minute"
},
"catalog_hash": "0755b5f0d3432bc3b0064227d2b6178d402327b9"
}
}
}Catalogs
Update Catalog
PUT
/
api
/
v1
/
catalogs
/
{id}
Update catalog
curl --request PUT \
--url https://api.squared.ai/api/v1/catalogs/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connector_id": 6,
"catalog": {
"json_schema": {
"field": "test_field"
}
}
}
'import requests
url = "https://api.squared.ai/api/v1/catalogs/{id}"
payload = {
"connector_id": 6,
"catalog": { "json_schema": { "field": "test_field" } }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({connector_id: 6, catalog: {json_schema: {field: 'test_field'}}})
};
fetch('https://api.squared.ai/api/v1/catalogs/{id}', 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.squared.ai/api/v1/catalogs/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'connector_id' => 6,
'catalog' => [
'json_schema' => [
'field' => 'test_field'
]
]
]),
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.squared.ai/api/v1/catalogs/{id}"
payload := strings.NewReader("{\n \"connector_id\": 6,\n \"catalog\": {\n \"json_schema\": {\n \"field\": \"test_field\"\n }\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.squared.ai/api/v1/catalogs/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connector_id\": 6,\n \"catalog\": {\n \"json_schema\": {\n \"field\": \"test_field\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.squared.ai/api/v1/catalogs/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connector_id\": 6,\n \"catalog\": {\n \"json_schema\": {\n \"field\": \"test_field\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "34",
"type": "catalogs",
"attributes": {
"connector_id": 6,
"workspace_id": 2,
"catalog": {
"streams": [
{
"name": "test_name",
"url": "test_url",
"json_schema": {
"field": "test field"
},
"batch_support": false,
"batch_size": 0,
"request_method": "POST"
}
],
"request_rate_concurrency": 10,
"request_rate_limit": 600,
"request_rate_limit_unit": "minute"
},
"catalog_hash": "0755b5f0d3432bc3b0064227d2b6178d402327b9"
}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the catalog to update
Example:
34
Response
Catalog updated successfully
Show child attributes
Show child attributes
Was this page helpful?
⌘I