Upload a segment
curl --request POST \
--url https://dev.startree.ai/segments \
--header 'Authorization: <api-key>' \
--header 'Content-Type: multipart/form-data' \
--form 'contentDisposition={
"type": "<string>",
"parameters": {},
"fileName": "<string>",
"creationDate": "2023-11-07T05:31:56Z",
"modificationDate": "2023-11-07T05:31:56Z",
"readDate": "2023-11-07T05:31:56Z",
"size": 123
}' \
--form 'entity={}' \
--form 'headers={}' \
--form 'mediaType={
"type": "<string>",
"subtype": "<string>",
"parameters": {},
"wildcardType": true,
"wildcardSubtype": true
}' \
--form 'messageBodyWorkers={}' \
--form 'parent={
"contentDisposition": {
"type": "<string>",
"parameters": {},
"fileName": "<string>",
"creationDate": "2023-11-07T05:31:56Z",
"modificationDate": "2023-11-07T05:31:56Z",
"readDate": "2023-11-07T05:31:56Z",
"size": 123
},
"entity": {},
"headers": {},
"mediaType": {
"type": "<string>",
"subtype": "<string>",
"parameters": {},
"wildcardType": true,
"wildcardSubtype": true
},
"messageBodyWorkers": {},
"parent": "<unknown>",
"providers": {},
"bodyParts": [
{
"contentDisposition": {
"type": "<string>",
"parameters": {},
"fileName": "<string>",
"creationDate": "2023-11-07T05:31:56Z",
"modificationDate": "2023-11-07T05:31:56Z",
"readDate": "2023-11-07T05:31:56Z",
"size": 123
},
"entity": {},
"headers": {},
"mediaType": {
"type": "<string>",
"subtype": "<string>",
"parameters": {},
"wildcardType": true,
"wildcardSubtype": true
},
"messageBodyWorkers": {},
"parent": "<unknown>",
"providers": {},
"parameterizedHeaders": {}
}
],
"parameterizedHeaders": {}
}' \
--form 'providers={}' \
--form 'bodyParts={
"contentDisposition": {
"type": "<string>",
"parameters": {},
"fileName": "<string>",
"creationDate": "2023-11-07T05:31:56Z",
"modificationDate": "2023-11-07T05:31:56Z",
"readDate": "2023-11-07T05:31:56Z",
"size": 123
},
"entity": {},
"headers": {},
"mediaType": {
"type": "<string>",
"subtype": "<string>",
"parameters": {},
"wildcardType": true,
"wildcardSubtype": true
},
"messageBodyWorkers": {},
"parent": "<unknown>",
"providers": {},
"parameterizedHeaders": {}
}' \
--form 'fields={}' \
--form 'parameterizedHeaders={}'import requests
url = "https://dev.startree.ai/segments"
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"contentDisposition\"\r\n\r\n{\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"entity\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"headers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mediaType\"\r\n\r\n{\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"messageBodyWorkers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"parent\"\r\n\r\n{\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"bodyParts\": [\r\n {\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"parameterizedHeaders\": {}\r\n }\r\n ],\r\n \"parameterizedHeaders\": {}\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"providers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"bodyParts\"\r\n\r\n{\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"parameterizedHeaders\": {}\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fields\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"parameterizedHeaders\"\r\n\r\n{}\r\n-----011000010111000001101001--"
headers = {
"Authorization": "<api-key>",
"Content-Type": "multipart/form-data"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const form = new FormData();
form.append('contentDisposition', '{
"type": "<string>",
"parameters": {},
"fileName": "<string>",
"creationDate": "2023-11-07T05:31:56Z",
"modificationDate": "2023-11-07T05:31:56Z",
"readDate": "2023-11-07T05:31:56Z",
"size": 123
}');
form.append('entity', '{}');
form.append('headers', '{}');
form.append('mediaType', '{
"type": "<string>",
"subtype": "<string>",
"parameters": {},
"wildcardType": true,
"wildcardSubtype": true
}');
form.append('messageBodyWorkers', '{}');
form.append('parent', '{
"contentDisposition": {
"type": "<string>",
"parameters": {},
"fileName": "<string>",
"creationDate": "2023-11-07T05:31:56Z",
"modificationDate": "2023-11-07T05:31:56Z",
"readDate": "2023-11-07T05:31:56Z",
"size": 123
},
"entity": {},
"headers": {},
"mediaType": {
"type": "<string>",
"subtype": "<string>",
"parameters": {},
"wildcardType": true,
"wildcardSubtype": true
},
"messageBodyWorkers": {},
"parent": "<unknown>",
"providers": {},
"bodyParts": [
{
"contentDisposition": {
"type": "<string>",
"parameters": {},
"fileName": "<string>",
"creationDate": "2023-11-07T05:31:56Z",
"modificationDate": "2023-11-07T05:31:56Z",
"readDate": "2023-11-07T05:31:56Z",
"size": 123
},
"entity": {},
"headers": {},
"mediaType": {
"type": "<string>",
"subtype": "<string>",
"parameters": {},
"wildcardType": true,
"wildcardSubtype": true
},
"messageBodyWorkers": {},
"parent": "<unknown>",
"providers": {},
"parameterizedHeaders": {}
}
],
"parameterizedHeaders": {}
}');
form.append('providers', '{}');
form.append('bodyParts', '{
"contentDisposition": {
"type": "<string>",
"parameters": {},
"fileName": "<string>",
"creationDate": "2023-11-07T05:31:56Z",
"modificationDate": "2023-11-07T05:31:56Z",
"readDate": "2023-11-07T05:31:56Z",
"size": 123
},
"entity": {},
"headers": {},
"mediaType": {
"type": "<string>",
"subtype": "<string>",
"parameters": {},
"wildcardType": true,
"wildcardSubtype": true
},
"messageBodyWorkers": {},
"parent": "<unknown>",
"providers": {},
"parameterizedHeaders": {}
}');
form.append('fields', '{}');
form.append('parameterizedHeaders', '{}');
const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
options.body = form;
fetch('https://dev.startree.ai/segments', 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://dev.startree.ai/segments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"contentDisposition\"\r\n\r\n{\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"entity\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"headers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mediaType\"\r\n\r\n{\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"messageBodyWorkers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"parent\"\r\n\r\n{\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"bodyParts\": [\r\n {\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"parameterizedHeaders\": {}\r\n }\r\n ],\r\n \"parameterizedHeaders\": {}\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"providers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"bodyParts\"\r\n\r\n{\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"parameterizedHeaders\": {}\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fields\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"parameterizedHeaders\"\r\n\r\n{}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: multipart/form-data"
],
]);
$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://dev.startree.ai/segments"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"contentDisposition\"\r\n\r\n{\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"entity\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"headers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mediaType\"\r\n\r\n{\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"messageBodyWorkers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"parent\"\r\n\r\n{\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"bodyParts\": [\r\n {\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"parameterizedHeaders\": {}\r\n }\r\n ],\r\n \"parameterizedHeaders\": {}\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"providers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"bodyParts\"\r\n\r\n{\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"parameterizedHeaders\": {}\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fields\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"parameterizedHeaders\"\r\n\r\n{}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://dev.startree.ai/segments")
.header("Authorization", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"contentDisposition\"\r\n\r\n{\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"entity\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"headers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mediaType\"\r\n\r\n{\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"messageBodyWorkers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"parent\"\r\n\r\n{\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"bodyParts\": [\r\n {\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"parameterizedHeaders\": {}\r\n }\r\n ],\r\n \"parameterizedHeaders\": {}\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"providers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"bodyParts\"\r\n\r\n{\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"parameterizedHeaders\": {}\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fields\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"parameterizedHeaders\"\r\n\r\n{}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.startree.ai/segments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"contentDisposition\"\r\n\r\n{\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"entity\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"headers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mediaType\"\r\n\r\n{\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"messageBodyWorkers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"parent\"\r\n\r\n{\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"bodyParts\": [\r\n {\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"parameterizedHeaders\": {}\r\n }\r\n ],\r\n \"parameterizedHeaders\": {}\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"providers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"bodyParts\"\r\n\r\n{\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"parameterizedHeaders\": {}\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fields\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"parameterizedHeaders\"\r\n\r\n{}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_bodyThis response has no body data.This response has no body data.This response has no body data.This response has no body data.This response has no body data.This response has no body data.This response has no body data.Segment
Upload a segment
Upload a segment as binary
POST
/
segments
Upload a segment
curl --request POST \
--url https://dev.startree.ai/segments \
--header 'Authorization: <api-key>' \
--header 'Content-Type: multipart/form-data' \
--form 'contentDisposition={
"type": "<string>",
"parameters": {},
"fileName": "<string>",
"creationDate": "2023-11-07T05:31:56Z",
"modificationDate": "2023-11-07T05:31:56Z",
"readDate": "2023-11-07T05:31:56Z",
"size": 123
}' \
--form 'entity={}' \
--form 'headers={}' \
--form 'mediaType={
"type": "<string>",
"subtype": "<string>",
"parameters": {},
"wildcardType": true,
"wildcardSubtype": true
}' \
--form 'messageBodyWorkers={}' \
--form 'parent={
"contentDisposition": {
"type": "<string>",
"parameters": {},
"fileName": "<string>",
"creationDate": "2023-11-07T05:31:56Z",
"modificationDate": "2023-11-07T05:31:56Z",
"readDate": "2023-11-07T05:31:56Z",
"size": 123
},
"entity": {},
"headers": {},
"mediaType": {
"type": "<string>",
"subtype": "<string>",
"parameters": {},
"wildcardType": true,
"wildcardSubtype": true
},
"messageBodyWorkers": {},
"parent": "<unknown>",
"providers": {},
"bodyParts": [
{
"contentDisposition": {
"type": "<string>",
"parameters": {},
"fileName": "<string>",
"creationDate": "2023-11-07T05:31:56Z",
"modificationDate": "2023-11-07T05:31:56Z",
"readDate": "2023-11-07T05:31:56Z",
"size": 123
},
"entity": {},
"headers": {},
"mediaType": {
"type": "<string>",
"subtype": "<string>",
"parameters": {},
"wildcardType": true,
"wildcardSubtype": true
},
"messageBodyWorkers": {},
"parent": "<unknown>",
"providers": {},
"parameterizedHeaders": {}
}
],
"parameterizedHeaders": {}
}' \
--form 'providers={}' \
--form 'bodyParts={
"contentDisposition": {
"type": "<string>",
"parameters": {},
"fileName": "<string>",
"creationDate": "2023-11-07T05:31:56Z",
"modificationDate": "2023-11-07T05:31:56Z",
"readDate": "2023-11-07T05:31:56Z",
"size": 123
},
"entity": {},
"headers": {},
"mediaType": {
"type": "<string>",
"subtype": "<string>",
"parameters": {},
"wildcardType": true,
"wildcardSubtype": true
},
"messageBodyWorkers": {},
"parent": "<unknown>",
"providers": {},
"parameterizedHeaders": {}
}' \
--form 'fields={}' \
--form 'parameterizedHeaders={}'import requests
url = "https://dev.startree.ai/segments"
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"contentDisposition\"\r\n\r\n{\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"entity\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"headers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mediaType\"\r\n\r\n{\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"messageBodyWorkers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"parent\"\r\n\r\n{\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"bodyParts\": [\r\n {\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"parameterizedHeaders\": {}\r\n }\r\n ],\r\n \"parameterizedHeaders\": {}\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"providers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"bodyParts\"\r\n\r\n{\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"parameterizedHeaders\": {}\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fields\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"parameterizedHeaders\"\r\n\r\n{}\r\n-----011000010111000001101001--"
headers = {
"Authorization": "<api-key>",
"Content-Type": "multipart/form-data"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const form = new FormData();
form.append('contentDisposition', '{
"type": "<string>",
"parameters": {},
"fileName": "<string>",
"creationDate": "2023-11-07T05:31:56Z",
"modificationDate": "2023-11-07T05:31:56Z",
"readDate": "2023-11-07T05:31:56Z",
"size": 123
}');
form.append('entity', '{}');
form.append('headers', '{}');
form.append('mediaType', '{
"type": "<string>",
"subtype": "<string>",
"parameters": {},
"wildcardType": true,
"wildcardSubtype": true
}');
form.append('messageBodyWorkers', '{}');
form.append('parent', '{
"contentDisposition": {
"type": "<string>",
"parameters": {},
"fileName": "<string>",
"creationDate": "2023-11-07T05:31:56Z",
"modificationDate": "2023-11-07T05:31:56Z",
"readDate": "2023-11-07T05:31:56Z",
"size": 123
},
"entity": {},
"headers": {},
"mediaType": {
"type": "<string>",
"subtype": "<string>",
"parameters": {},
"wildcardType": true,
"wildcardSubtype": true
},
"messageBodyWorkers": {},
"parent": "<unknown>",
"providers": {},
"bodyParts": [
{
"contentDisposition": {
"type": "<string>",
"parameters": {},
"fileName": "<string>",
"creationDate": "2023-11-07T05:31:56Z",
"modificationDate": "2023-11-07T05:31:56Z",
"readDate": "2023-11-07T05:31:56Z",
"size": 123
},
"entity": {},
"headers": {},
"mediaType": {
"type": "<string>",
"subtype": "<string>",
"parameters": {},
"wildcardType": true,
"wildcardSubtype": true
},
"messageBodyWorkers": {},
"parent": "<unknown>",
"providers": {},
"parameterizedHeaders": {}
}
],
"parameterizedHeaders": {}
}');
form.append('providers', '{}');
form.append('bodyParts', '{
"contentDisposition": {
"type": "<string>",
"parameters": {},
"fileName": "<string>",
"creationDate": "2023-11-07T05:31:56Z",
"modificationDate": "2023-11-07T05:31:56Z",
"readDate": "2023-11-07T05:31:56Z",
"size": 123
},
"entity": {},
"headers": {},
"mediaType": {
"type": "<string>",
"subtype": "<string>",
"parameters": {},
"wildcardType": true,
"wildcardSubtype": true
},
"messageBodyWorkers": {},
"parent": "<unknown>",
"providers": {},
"parameterizedHeaders": {}
}');
form.append('fields', '{}');
form.append('parameterizedHeaders', '{}');
const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
options.body = form;
fetch('https://dev.startree.ai/segments', 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://dev.startree.ai/segments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"contentDisposition\"\r\n\r\n{\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"entity\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"headers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mediaType\"\r\n\r\n{\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"messageBodyWorkers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"parent\"\r\n\r\n{\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"bodyParts\": [\r\n {\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"parameterizedHeaders\": {}\r\n }\r\n ],\r\n \"parameterizedHeaders\": {}\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"providers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"bodyParts\"\r\n\r\n{\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"parameterizedHeaders\": {}\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fields\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"parameterizedHeaders\"\r\n\r\n{}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: multipart/form-data"
],
]);
$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://dev.startree.ai/segments"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"contentDisposition\"\r\n\r\n{\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"entity\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"headers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mediaType\"\r\n\r\n{\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"messageBodyWorkers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"parent\"\r\n\r\n{\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"bodyParts\": [\r\n {\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"parameterizedHeaders\": {}\r\n }\r\n ],\r\n \"parameterizedHeaders\": {}\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"providers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"bodyParts\"\r\n\r\n{\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"parameterizedHeaders\": {}\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fields\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"parameterizedHeaders\"\r\n\r\n{}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://dev.startree.ai/segments")
.header("Authorization", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"contentDisposition\"\r\n\r\n{\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"entity\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"headers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mediaType\"\r\n\r\n{\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"messageBodyWorkers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"parent\"\r\n\r\n{\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"bodyParts\": [\r\n {\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"parameterizedHeaders\": {}\r\n }\r\n ],\r\n \"parameterizedHeaders\": {}\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"providers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"bodyParts\"\r\n\r\n{\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"parameterizedHeaders\": {}\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fields\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"parameterizedHeaders\"\r\n\r\n{}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.startree.ai/segments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"contentDisposition\"\r\n\r\n{\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"entity\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"headers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mediaType\"\r\n\r\n{\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"messageBodyWorkers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"parent\"\r\n\r\n{\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"bodyParts\": [\r\n {\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"parameterizedHeaders\": {}\r\n }\r\n ],\r\n \"parameterizedHeaders\": {}\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"providers\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"bodyParts\"\r\n\r\n{\r\n \"contentDisposition\": {\r\n \"type\": \"<string>\",\r\n \"parameters\": {},\r\n \"fileName\": \"<string>\",\r\n \"creationDate\": \"2023-11-07T05:31:56Z\",\r\n \"modificationDate\": \"2023-11-07T05:31:56Z\",\r\n \"readDate\": \"2023-11-07T05:31:56Z\",\r\n \"size\": 123\r\n },\r\n \"entity\": {},\r\n \"headers\": {},\r\n \"mediaType\": {\r\n \"type\": \"<string>\",\r\n \"subtype\": \"<string>\",\r\n \"parameters\": {},\r\n \"wildcardType\": true,\r\n \"wildcardSubtype\": true\r\n },\r\n \"messageBodyWorkers\": {},\r\n \"parent\": \"<unknown>\",\r\n \"providers\": {},\r\n \"parameterizedHeaders\": {}\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fields\"\r\n\r\n{}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"parameterizedHeaders\"\r\n\r\n{}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_bodyThis response has no body data.This response has no body data.This response has no body data.This response has no body data.This response has no body data.This response has no body data.This response has no body data.Authorizations
oauthdatabase
The format of the key is "Basic <token>" or "Bearer <token>"
Query Parameters
Name of the table
Type of the table
Whether to enable parallel push protection
Whether to refresh if the segment already exists
Body
multipart/form-data
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
Was this page helpful?
Resets all segments (when errorSegmentsOnly = false) or segments with Error state (when errorSegmentsOnly = true) of the table, by first disabling them, waiting for external view to stabilize, and finally enabling themUpload a segment
⌘I

