Skip to main content
POST
/
v1
/
views
Create a new view!
curl --request POST \
  --url https://platform.thena.ai/v1/views \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "My View",
  "description": "My View Description",
  "teamId": "T00M677SAK",
  "viewsTypeId": "3ENSBTAJ10QG1HAFYYNHADB58PKM5",
  "isShared": true,
  "configuration": {}
}
'
import requests

url = "https://platform.thena.ai/v1/views"

payload = {
    "name": "My View",
    "description": "My View Description",
    "teamId": "T00M677SAK",
    "viewsTypeId": "3ENSBTAJ10QG1HAFYYNHADB58PKM5",
    "isShared": True,
    "configuration": {}
}
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: 'My View',
    description: 'My View Description',
    teamId: 'T00M677SAK',
    viewsTypeId: '3ENSBTAJ10QG1HAFYYNHADB58PKM5',
    isShared: true,
    configuration: {}
  })
};

fetch('https://platform.thena.ai/v1/views', 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://platform.thena.ai/v1/views",
  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' => 'My View',
    'description' => 'My View Description',
    'teamId' => 'T00M677SAK',
    'viewsTypeId' => '3ENSBTAJ10QG1HAFYYNHADB58PKM5',
    'isShared' => true,
    'configuration' => [
        
    ]
  ]),
  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://platform.thena.ai/v1/views"

	payload := strings.NewReader("{\n  \"name\": \"My View\",\n  \"description\": \"My View Description\",\n  \"teamId\": \"T00M677SAK\",\n  \"viewsTypeId\": \"3ENSBTAJ10QG1HAFYYNHADB58PKM5\",\n  \"isShared\": true,\n  \"configuration\": {}\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://platform.thena.ai/v1/views")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"My View\",\n  \"description\": \"My View Description\",\n  \"teamId\": \"T00M677SAK\",\n  \"viewsTypeId\": \"3ENSBTAJ10QG1HAFYYNHADB58PKM5\",\n  \"isShared\": true,\n  \"configuration\": {}\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://platform.thena.ai/v1/views")

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\": \"My View\",\n  \"description\": \"My View Description\",\n  \"teamId\": \"T00M677SAK\",\n  \"viewsTypeId\": \"3ENSBTAJ10QG1HAFYYNHADB58PKM5\",\n  \"isShared\": true,\n  \"configuration\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "status": true,
  "message": "Success",
  "timestamp": "2024-01-01T00:00:00.000Z",
  "data": {
    "id": "<string>",
    "teamId": "<string>",
    "viewId": 123,
    "name": "<string>",
    "description": "<string>",
    "configuration": {},
    "viewsTypeId": "<string>",
    "viewsType": "<string>",
    "owner": "<string>",
    "ownerId": "<string>",
    "isShared": true,
    "isPersonal": true,
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Enter the bearer token

Body

application/json
name
string
required

The name of the view

Example:

"My View"

description
string
required

The description of the view

Example:

"My View Description"

teamId
string
required

The team id of the view

Example:

"T00M677SAK"

viewsTypeId
string
required

The views type id of the view

Example:

"3ENSBTAJ10QG1HAFYYNHADB58PKM5"

isShared
boolean
required

The shared flag of the view

Example:

true

configuration
object
required

The configuration of the view

Response

Operation successful

status
boolean
default:true
required

The status of the response

message
string
default:Success
required

The message of the response

timestamp
string<date-time>
default:2024-01-01T00:00:00.000Z
required

The timestamp of the response

data
object
required

The response for create/update/delete view operations