Set a table's default view
curl --request PUT \
--url https://app.readyforcommerce.com/api/v1/orgs/{orgId}/core/views/default \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"resource": "<string>",
"viewId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://app.readyforcommerce.com/api/v1/orgs/{orgId}/core/views/default"
payload = {
"resource": "<string>",
"viewId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.readyforcommerce.com/api/v1/orgs/{orgId}/core/views/default",
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([
'resource' => '<string>',
'viewId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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;
}const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({resource: '<string>', viewId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://app.readyforcommerce.com/api/v1/orgs/{orgId}/core/views/default', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"resource": "<string>",
"viewId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"type": "<string>",
"status": 123,
"code": "core.view_resource_not_found",
"requestId": "<string>",
"title": "<string>",
"params": {},
"errors": [
{
"location": "<string>",
"pointer": "<string>",
"code": "<string>",
"params": {}
}
]
}Saved views
Set a table's default view
Sets the saved view a table (resource: core.imports or core.exports) opens with for you, any view of it you see, yours or a shared one, or clears it with viewId null.
PUT
/
api
/
v1
/
orgs
/
{orgId}
/
core
/
views
/
default
Set a table's default view
curl --request PUT \
--url https://app.readyforcommerce.com/api/v1/orgs/{orgId}/core/views/default \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"resource": "<string>",
"viewId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://app.readyforcommerce.com/api/v1/orgs/{orgId}/core/views/default"
payload = {
"resource": "<string>",
"viewId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.readyforcommerce.com/api/v1/orgs/{orgId}/core/views/default",
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([
'resource' => '<string>',
'viewId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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;
}const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({resource: '<string>', viewId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://app.readyforcommerce.com/api/v1/orgs/{orgId}/core/views/default', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"resource": "<string>",
"viewId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"type": "<string>",
"status": 123,
"code": "core.view_resource_not_found",
"requestId": "<string>",
"title": "<string>",
"params": {},
"errors": [
{
"location": "<string>",
"pointer": "<string>",
"code": "<string>",
"params": {}
}
]
}Authorizations
Was this page helpful?