Create new environments
POST/unified/environment
Payload
body
Returns
Environmentarray
const options = {
method: 'POST',
url: 'https://api.unified.to/unified/environment',
headers: {
authorization: 'bearer .....'
},
data: undefined,
};
const results = await axios.request(options);Code Samples
Node.js SDK
import { UnifiedTo } from '@unified-api/typescript-sdk';
const sdk = new UnifiedTo({
security: {
jwt: '<YOUR_API_KEY_HERE>',
},
});
const results = await sdk.unified.createUnifiedEnvironment({
});Node.js (axios)
const options = {
method: 'POST',
url: 'https://api.unified.to/unified/environment',
headers: {
authorization: 'bearer .....'
},
data: undefined,
};
const results = await axios.request(options);Java
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "https://api.unified.to/unified/environment")
.setHeader("accept", "application/json")
.setHeader("authorization", ".....")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();Go
import (
"fmt"
"net/http"
"io/ioutil"
)
url := `https://api.unified.to/unified/environment
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("accept", "application/json")
req.Header.Add("authorization", ".....")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)Python
import requests
url = "https://api.unified.to/unified/environment"
headers = {
"accept": "application/json",
"authorization": "....."
}
response = requests.post(url, headers=headers)PHP
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.unified.to/unified/environment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"accept: application/json",
"authorization: ....."
],
]);Ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.unified.to/unified/environment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = 'application/json'
request["authorization"] = '....'
response = http.request(request)
puts response.read_bodycURL
curl --request POST \
--url 'https://api.unified.to/unified/environment' \
--header 'accept: application/json' \
--header 'authorization: .....' Are we missing anything? Let us know