cURL
curl --request POST \
--url https://integration.service/api/v1/sessions \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"settings": {
"title": "None",
"packageName": "None",
"exportUnitSystem": "SI (Consistent)",
"displayUnitSystem": "Metric",
"multiselectEnabled": true,
"maxRecordBatch": 50,
"pollSeconds": 50,
"mmsApiVersion": "v1",
"theme": "auto"
}
}
'import requests
url = "https://integration.service/api/v1/sessions"
payload = {
"name": "<string>",
"settings": {
"title": "None",
"packageName": "None",
"exportUnitSystem": "SI (Consistent)",
"displayUnitSystem": "Metric",
"multiselectEnabled": True,
"maxRecordBatch": 50,
"pollSeconds": 50,
"mmsApiVersion": "v1",
"theme": "auto"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
settings: {
title: 'None',
packageName: 'None',
exportUnitSystem: 'SI (Consistent)',
displayUnitSystem: 'Metric',
multiselectEnabled: true,
maxRecordBatch: 50,
pollSeconds: 50,
mmsApiVersion: 'v1',
theme: 'auto'
}
})
};
fetch('https://integration.service/api/v1/sessions', 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://integration.service/api/v1/sessions",
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>',
'settings' => [
'title' => 'None',
'packageName' => 'None',
'exportUnitSystem' => 'SI (Consistent)',
'displayUnitSystem' => 'Metric',
'multiselectEnabled' => true,
'maxRecordBatch' => 50,
'pollSeconds' => 50,
'mmsApiVersion' => 'v1',
'theme' => 'auto'
]
]),
CURLOPT_HTTPHEADER => [
"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://integration.service/api/v1/sessions"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"settings\": {\n \"title\": \"None\",\n \"packageName\": \"None\",\n \"exportUnitSystem\": \"SI (Consistent)\",\n \"displayUnitSystem\": \"Metric\",\n \"multiselectEnabled\": true,\n \"maxRecordBatch\": 50,\n \"pollSeconds\": 50,\n \"mmsApiVersion\": \"v1\",\n \"theme\": \"auto\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://integration.service/api/v1/sessions")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"settings\": {\n \"title\": \"None\",\n \"packageName\": \"None\",\n \"exportUnitSystem\": \"SI (Consistent)\",\n \"displayUnitSystem\": \"Metric\",\n \"multiselectEnabled\": true,\n \"maxRecordBatch\": 50,\n \"pollSeconds\": 50,\n \"mmsApiVersion\": \"v1\",\n \"theme\": \"auto\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://integration.service/api/v1/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"settings\": {\n \"title\": \"None\",\n \"packageName\": \"None\",\n \"exportUnitSystem\": \"SI (Consistent)\",\n \"displayUnitSystem\": \"Metric\",\n \"multiselectEnabled\": true,\n \"maxRecordBatch\": 50,\n \"pollSeconds\": 50,\n \"mmsApiVersion\": \"v1\",\n \"theme\": \"auto\"\n }\n}"
response = http.request(request)
puts response.read_bodyusing RestSharp;
var options = new RestClientOptions("https://integration.service/api/v1/sessions");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n \"name\": \"<string>\",\n \"settings\": {\n \"title\": \"None\",\n \"packageName\": \"None\",\n \"exportUnitSystem\": \"SI (Consistent)\",\n \"displayUnitSystem\": \"Metric\",\n \"multiselectEnabled\": true,\n \"maxRecordBatch\": 50,\n \"pollSeconds\": 50,\n \"mmsApiVersion\": \"v1\",\n \"theme\": \"auto\"\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://integration.service/api/v1/sessions");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"name\": \"<string>\",\n \"settings\": {\n \"title\": \"None\",\n \"packageName\": \"None\",\n \"exportUnitSystem\": \"SI (Consistent)\",\n \"displayUnitSystem\": \"Metric\",\n \"multiselectEnabled\": true,\n \"maxRecordBatch\": 50,\n \"pollSeconds\": 50,\n \"mmsApiVersion\": \"v1\",\n \"theme\": \"auto\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);{
"name": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expiresAt": "2023-11-07T05:31:56Z",
"settings": {
"title": "None",
"packageName": "None",
"exportUnitSystem": "SI (Consistent)",
"displayUnitSystem": "Metric",
"multiselectEnabled": true,
"maxRecordBatch": 50,
"pollSeconds": 50,
"mmsApiVersion": "v1",
"theme": "auto"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}POST /sessions
Creates a new session with a given name and settings (including display name of session in the Granta Material Picker). Returns original session request data together with a unique id and expiry date and time.
POST
/
sessions
cURL
curl --request POST \
--url https://integration.service/api/v1/sessions \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"settings": {
"title": "None",
"packageName": "None",
"exportUnitSystem": "SI (Consistent)",
"displayUnitSystem": "Metric",
"multiselectEnabled": true,
"maxRecordBatch": 50,
"pollSeconds": 50,
"mmsApiVersion": "v1",
"theme": "auto"
}
}
'import requests
url = "https://integration.service/api/v1/sessions"
payload = {
"name": "<string>",
"settings": {
"title": "None",
"packageName": "None",
"exportUnitSystem": "SI (Consistent)",
"displayUnitSystem": "Metric",
"multiselectEnabled": True,
"maxRecordBatch": 50,
"pollSeconds": 50,
"mmsApiVersion": "v1",
"theme": "auto"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
settings: {
title: 'None',
packageName: 'None',
exportUnitSystem: 'SI (Consistent)',
displayUnitSystem: 'Metric',
multiselectEnabled: true,
maxRecordBatch: 50,
pollSeconds: 50,
mmsApiVersion: 'v1',
theme: 'auto'
}
})
};
fetch('https://integration.service/api/v1/sessions', 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://integration.service/api/v1/sessions",
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>',
'settings' => [
'title' => 'None',
'packageName' => 'None',
'exportUnitSystem' => 'SI (Consistent)',
'displayUnitSystem' => 'Metric',
'multiselectEnabled' => true,
'maxRecordBatch' => 50,
'pollSeconds' => 50,
'mmsApiVersion' => 'v1',
'theme' => 'auto'
]
]),
CURLOPT_HTTPHEADER => [
"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://integration.service/api/v1/sessions"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"settings\": {\n \"title\": \"None\",\n \"packageName\": \"None\",\n \"exportUnitSystem\": \"SI (Consistent)\",\n \"displayUnitSystem\": \"Metric\",\n \"multiselectEnabled\": true,\n \"maxRecordBatch\": 50,\n \"pollSeconds\": 50,\n \"mmsApiVersion\": \"v1\",\n \"theme\": \"auto\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://integration.service/api/v1/sessions")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"settings\": {\n \"title\": \"None\",\n \"packageName\": \"None\",\n \"exportUnitSystem\": \"SI (Consistent)\",\n \"displayUnitSystem\": \"Metric\",\n \"multiselectEnabled\": true,\n \"maxRecordBatch\": 50,\n \"pollSeconds\": 50,\n \"mmsApiVersion\": \"v1\",\n \"theme\": \"auto\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://integration.service/api/v1/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"settings\": {\n \"title\": \"None\",\n \"packageName\": \"None\",\n \"exportUnitSystem\": \"SI (Consistent)\",\n \"displayUnitSystem\": \"Metric\",\n \"multiselectEnabled\": true,\n \"maxRecordBatch\": 50,\n \"pollSeconds\": 50,\n \"mmsApiVersion\": \"v1\",\n \"theme\": \"auto\"\n }\n}"
response = http.request(request)
puts response.read_bodyusing RestSharp;
var options = new RestClientOptions("https://integration.service/api/v1/sessions");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n \"name\": \"<string>\",\n \"settings\": {\n \"title\": \"None\",\n \"packageName\": \"None\",\n \"exportUnitSystem\": \"SI (Consistent)\",\n \"displayUnitSystem\": \"Metric\",\n \"multiselectEnabled\": true,\n \"maxRecordBatch\": 50,\n \"pollSeconds\": 50,\n \"mmsApiVersion\": \"v1\",\n \"theme\": \"auto\"\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://integration.service/api/v1/sessions");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"name\": \"<string>\",\n \"settings\": {\n \"title\": \"None\",\n \"packageName\": \"None\",\n \"exportUnitSystem\": \"SI (Consistent)\",\n \"displayUnitSystem\": \"Metric\",\n \"multiselectEnabled\": true,\n \"maxRecordBatch\": 50,\n \"pollSeconds\": 50,\n \"mmsApiVersion\": \"v1\",\n \"theme\": \"auto\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);{
"name": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expiresAt": "2023-11-07T05:31:56Z",
"settings": {
"title": "None",
"packageName": "None",
"exportUnitSystem": "SI (Consistent)",
"displayUnitSystem": "Metric",
"multiselectEnabled": true,
"maxRecordBatch": 50,
"pollSeconds": 50,
"mmsApiVersion": "v1",
"theme": "auto"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Body
application/json
Response
Session object was successfully created
The data returned from a successful POST session request.
Was this page helpful?