Airbyte Configuration API
POST
For worker to register the workflow id in attempt.
{{baseUrl}}/v1/attempt/set_workflow_in_attempt
BODY json
{
"attemptNumber": 0,
"jobId": 0,
"processingTaskQueue": "",
"workflowId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/attempt/set_workflow_in_attempt");
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 \"attemptNumber\": 0,\n \"jobId\": 0,\n \"processingTaskQueue\": \"\",\n \"workflowId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/attempt/set_workflow_in_attempt" {:content-type :json
:form-params {:attemptNumber 0
:jobId 0
:processingTaskQueue ""
:workflowId ""}})
require "http/client"
url = "{{baseUrl}}/v1/attempt/set_workflow_in_attempt"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"attemptNumber\": 0,\n \"jobId\": 0,\n \"processingTaskQueue\": \"\",\n \"workflowId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/attempt/set_workflow_in_attempt"),
Content = new StringContent("{\n \"attemptNumber\": 0,\n \"jobId\": 0,\n \"processingTaskQueue\": \"\",\n \"workflowId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/attempt/set_workflow_in_attempt");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"attemptNumber\": 0,\n \"jobId\": 0,\n \"processingTaskQueue\": \"\",\n \"workflowId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/attempt/set_workflow_in_attempt"
payload := strings.NewReader("{\n \"attemptNumber\": 0,\n \"jobId\": 0,\n \"processingTaskQueue\": \"\",\n \"workflowId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/attempt/set_workflow_in_attempt HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 87
{
"attemptNumber": 0,
"jobId": 0,
"processingTaskQueue": "",
"workflowId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/attempt/set_workflow_in_attempt")
.setHeader("content-type", "application/json")
.setBody("{\n \"attemptNumber\": 0,\n \"jobId\": 0,\n \"processingTaskQueue\": \"\",\n \"workflowId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/attempt/set_workflow_in_attempt"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"attemptNumber\": 0,\n \"jobId\": 0,\n \"processingTaskQueue\": \"\",\n \"workflowId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"attemptNumber\": 0,\n \"jobId\": 0,\n \"processingTaskQueue\": \"\",\n \"workflowId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/attempt/set_workflow_in_attempt")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/attempt/set_workflow_in_attempt")
.header("content-type", "application/json")
.body("{\n \"attemptNumber\": 0,\n \"jobId\": 0,\n \"processingTaskQueue\": \"\",\n \"workflowId\": \"\"\n}")
.asString();
const data = JSON.stringify({
attemptNumber: 0,
jobId: 0,
processingTaskQueue: '',
workflowId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/attempt/set_workflow_in_attempt');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/attempt/set_workflow_in_attempt',
headers: {'content-type': 'application/json'},
data: {attemptNumber: 0, jobId: 0, processingTaskQueue: '', workflowId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/attempt/set_workflow_in_attempt';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"attemptNumber":0,"jobId":0,"processingTaskQueue":"","workflowId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/attempt/set_workflow_in_attempt',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "attemptNumber": 0,\n "jobId": 0,\n "processingTaskQueue": "",\n "workflowId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"attemptNumber\": 0,\n \"jobId\": 0,\n \"processingTaskQueue\": \"\",\n \"workflowId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/attempt/set_workflow_in_attempt")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/attempt/set_workflow_in_attempt',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({attemptNumber: 0, jobId: 0, processingTaskQueue: '', workflowId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/attempt/set_workflow_in_attempt',
headers: {'content-type': 'application/json'},
body: {attemptNumber: 0, jobId: 0, processingTaskQueue: '', workflowId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/attempt/set_workflow_in_attempt');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
attemptNumber: 0,
jobId: 0,
processingTaskQueue: '',
workflowId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/attempt/set_workflow_in_attempt',
headers: {'content-type': 'application/json'},
data: {attemptNumber: 0, jobId: 0, processingTaskQueue: '', workflowId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/attempt/set_workflow_in_attempt';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"attemptNumber":0,"jobId":0,"processingTaskQueue":"","workflowId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"attemptNumber": @0,
@"jobId": @0,
@"processingTaskQueue": @"",
@"workflowId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/attempt/set_workflow_in_attempt"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/attempt/set_workflow_in_attempt" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"attemptNumber\": 0,\n \"jobId\": 0,\n \"processingTaskQueue\": \"\",\n \"workflowId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/attempt/set_workflow_in_attempt",
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([
'attemptNumber' => 0,
'jobId' => 0,
'processingTaskQueue' => '',
'workflowId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/attempt/set_workflow_in_attempt', [
'body' => '{
"attemptNumber": 0,
"jobId": 0,
"processingTaskQueue": "",
"workflowId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/attempt/set_workflow_in_attempt');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'attemptNumber' => 0,
'jobId' => 0,
'processingTaskQueue' => '',
'workflowId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'attemptNumber' => 0,
'jobId' => 0,
'processingTaskQueue' => '',
'workflowId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/attempt/set_workflow_in_attempt');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/attempt/set_workflow_in_attempt' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"attemptNumber": 0,
"jobId": 0,
"processingTaskQueue": "",
"workflowId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/attempt/set_workflow_in_attempt' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"attemptNumber": 0,
"jobId": 0,
"processingTaskQueue": "",
"workflowId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"attemptNumber\": 0,\n \"jobId\": 0,\n \"processingTaskQueue\": \"\",\n \"workflowId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/attempt/set_workflow_in_attempt", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/attempt/set_workflow_in_attempt"
payload = {
"attemptNumber": 0,
"jobId": 0,
"processingTaskQueue": "",
"workflowId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/attempt/set_workflow_in_attempt"
payload <- "{\n \"attemptNumber\": 0,\n \"jobId\": 0,\n \"processingTaskQueue\": \"\",\n \"workflowId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/attempt/set_workflow_in_attempt")
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 \"attemptNumber\": 0,\n \"jobId\": 0,\n \"processingTaskQueue\": \"\",\n \"workflowId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/attempt/set_workflow_in_attempt') do |req|
req.body = "{\n \"attemptNumber\": 0,\n \"jobId\": 0,\n \"processingTaskQueue\": \"\",\n \"workflowId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/attempt/set_workflow_in_attempt";
let payload = json!({
"attemptNumber": 0,
"jobId": 0,
"processingTaskQueue": "",
"workflowId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/attempt/set_workflow_in_attempt \
--header 'content-type: application/json' \
--data '{
"attemptNumber": 0,
"jobId": 0,
"processingTaskQueue": "",
"workflowId": ""
}'
echo '{
"attemptNumber": 0,
"jobId": 0,
"processingTaskQueue": "",
"workflowId": ""
}' | \
http POST {{baseUrl}}/v1/attempt/set_workflow_in_attempt \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "attemptNumber": 0,\n "jobId": 0,\n "processingTaskQueue": "",\n "workflowId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/attempt/set_workflow_in_attempt
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"attemptNumber": 0,
"jobId": 0,
"processingTaskQueue": "",
"workflowId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/attempt/set_workflow_in_attempt")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
For worker to save the AttemptSyncConfig for an attempt.
{{baseUrl}}/v1/attempt/save_sync_config
BODY json
{
"attemptNumber": 0,
"jobId": 0,
"syncConfig": {
"destinationConfiguration": "",
"sourceConfiguration": "",
"state": {
"connectionId": "",
"globalState": {
"shared_state": {},
"streamStates": [
{
"streamDescriptor": {
"name": "",
"namespace": ""
},
"streamState": {}
}
]
},
"state": {},
"stateType": "",
"streamState": [
{}
]
}
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/attempt/save_sync_config");
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 \"syncConfig\": {\n \"destinationConfiguration\": {\n \"user\": \"charles\"\n },\n \"sourceConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/attempt/save_sync_config" {:content-type :json
:form-params {:syncConfig {:destinationConfiguration {:user "charles"}
:sourceConfiguration {:user "charles"}}}})
require "http/client"
url = "{{baseUrl}}/v1/attempt/save_sync_config"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"syncConfig\": {\n \"destinationConfiguration\": {\n \"user\": \"charles\"\n },\n \"sourceConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/attempt/save_sync_config"),
Content = new StringContent("{\n \"syncConfig\": {\n \"destinationConfiguration\": {\n \"user\": \"charles\"\n },\n \"sourceConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/attempt/save_sync_config");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"syncConfig\": {\n \"destinationConfiguration\": {\n \"user\": \"charles\"\n },\n \"sourceConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/attempt/save_sync_config"
payload := strings.NewReader("{\n \"syncConfig\": {\n \"destinationConfiguration\": {\n \"user\": \"charles\"\n },\n \"sourceConfiguration\": {\n \"user\": \"charles\"\n }\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/attempt/save_sync_config HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 149
{
"syncConfig": {
"destinationConfiguration": {
"user": "charles"
},
"sourceConfiguration": {
"user": "charles"
}
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/attempt/save_sync_config")
.setHeader("content-type", "application/json")
.setBody("{\n \"syncConfig\": {\n \"destinationConfiguration\": {\n \"user\": \"charles\"\n },\n \"sourceConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/attempt/save_sync_config"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"syncConfig\": {\n \"destinationConfiguration\": {\n \"user\": \"charles\"\n },\n \"sourceConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"syncConfig\": {\n \"destinationConfiguration\": {\n \"user\": \"charles\"\n },\n \"sourceConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/attempt/save_sync_config")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/attempt/save_sync_config")
.header("content-type", "application/json")
.body("{\n \"syncConfig\": {\n \"destinationConfiguration\": {\n \"user\": \"charles\"\n },\n \"sourceConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}")
.asString();
const data = JSON.stringify({
syncConfig: {
destinationConfiguration: {
user: 'charles'
},
sourceConfiguration: {
user: 'charles'
}
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/attempt/save_sync_config');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/attempt/save_sync_config',
headers: {'content-type': 'application/json'},
data: {
syncConfig: {
destinationConfiguration: {user: 'charles'},
sourceConfiguration: {user: 'charles'}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/attempt/save_sync_config';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"syncConfig":{"destinationConfiguration":{"user":"charles"},"sourceConfiguration":{"user":"charles"}}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/attempt/save_sync_config',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "syncConfig": {\n "destinationConfiguration": {\n "user": "charles"\n },\n "sourceConfiguration": {\n "user": "charles"\n }\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"syncConfig\": {\n \"destinationConfiguration\": {\n \"user\": \"charles\"\n },\n \"sourceConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/attempt/save_sync_config")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/attempt/save_sync_config',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
syncConfig: {
destinationConfiguration: {user: 'charles'},
sourceConfiguration: {user: 'charles'}
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/attempt/save_sync_config',
headers: {'content-type': 'application/json'},
body: {
syncConfig: {
destinationConfiguration: {user: 'charles'},
sourceConfiguration: {user: 'charles'}
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/attempt/save_sync_config');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
syncConfig: {
destinationConfiguration: {
user: 'charles'
},
sourceConfiguration: {
user: 'charles'
}
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/attempt/save_sync_config',
headers: {'content-type': 'application/json'},
data: {
syncConfig: {
destinationConfiguration: {user: 'charles'},
sourceConfiguration: {user: 'charles'}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/attempt/save_sync_config';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"syncConfig":{"destinationConfiguration":{"user":"charles"},"sourceConfiguration":{"user":"charles"}}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"syncConfig": @{ @"destinationConfiguration": @{ @"user": @"charles" }, @"sourceConfiguration": @{ @"user": @"charles" } } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/attempt/save_sync_config"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/attempt/save_sync_config" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"syncConfig\": {\n \"destinationConfiguration\": {\n \"user\": \"charles\"\n },\n \"sourceConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/attempt/save_sync_config",
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([
'syncConfig' => [
'destinationConfiguration' => [
'user' => 'charles'
],
'sourceConfiguration' => [
'user' => 'charles'
]
]
]),
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;
}
request('POST', '{{baseUrl}}/v1/attempt/save_sync_config', [
'body' => '{
"syncConfig": {
"destinationConfiguration": {
"user": "charles"
},
"sourceConfiguration": {
"user": "charles"
}
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/attempt/save_sync_config');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'syncConfig' => [
'destinationConfiguration' => [
'user' => 'charles'
],
'sourceConfiguration' => [
'user' => 'charles'
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'syncConfig' => [
'destinationConfiguration' => [
'user' => 'charles'
],
'sourceConfiguration' => [
'user' => 'charles'
]
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/attempt/save_sync_config');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/attempt/save_sync_config' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"syncConfig": {
"destinationConfiguration": {
"user": "charles"
},
"sourceConfiguration": {
"user": "charles"
}
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/attempt/save_sync_config' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"syncConfig": {
"destinationConfiguration": {
"user": "charles"
},
"sourceConfiguration": {
"user": "charles"
}
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"syncConfig\": {\n \"destinationConfiguration\": {\n \"user\": \"charles\"\n },\n \"sourceConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/attempt/save_sync_config", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/attempt/save_sync_config"
payload = { "syncConfig": {
"destinationConfiguration": { "user": "charles" },
"sourceConfiguration": { "user": "charles" }
} }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/attempt/save_sync_config"
payload <- "{\n \"syncConfig\": {\n \"destinationConfiguration\": {\n \"user\": \"charles\"\n },\n \"sourceConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/attempt/save_sync_config")
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 \"syncConfig\": {\n \"destinationConfiguration\": {\n \"user\": \"charles\"\n },\n \"sourceConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/attempt/save_sync_config') do |req|
req.body = "{\n \"syncConfig\": {\n \"destinationConfiguration\": {\n \"user\": \"charles\"\n },\n \"sourceConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/attempt/save_sync_config";
let payload = json!({"syncConfig": json!({
"destinationConfiguration": json!({"user": "charles"}),
"sourceConfiguration": json!({"user": "charles"})
})});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/attempt/save_sync_config \
--header 'content-type: application/json' \
--data '{
"syncConfig": {
"destinationConfiguration": {
"user": "charles"
},
"sourceConfiguration": {
"user": "charles"
}
}
}'
echo '{
"syncConfig": {
"destinationConfiguration": {
"user": "charles"
},
"sourceConfiguration": {
"user": "charles"
}
}
}' | \
http POST {{baseUrl}}/v1/attempt/save_sync_config \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "syncConfig": {\n "destinationConfiguration": {\n "user": "charles"\n },\n "sourceConfiguration": {\n "user": "charles"\n }\n }\n}' \
--output-document \
- {{baseUrl}}/v1/attempt/save_sync_config
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["syncConfig": [
"destinationConfiguration": ["user": "charles"],
"sourceConfiguration": ["user": "charles"]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/attempt/save_sync_config")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
For worker to set sync stats of a running attempt.
{{baseUrl}}/v1/attempt/save_stats
BODY json
{
"attemptNumber": 0,
"jobId": 0,
"stats": {
"bytesEmitted": 0,
"estimatedBytes": 0,
"estimatedRecords": 0,
"recordsCommitted": 0,
"recordsEmitted": 0,
"stateMessagesEmitted": 0
},
"streamStats": [
{
"stats": {},
"streamName": "",
"streamNamespace": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/attempt/save_stats");
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 \"attemptNumber\": 0,\n \"jobId\": 0,\n \"stats\": {\n \"bytesEmitted\": 0,\n \"estimatedBytes\": 0,\n \"estimatedRecords\": 0,\n \"recordsCommitted\": 0,\n \"recordsEmitted\": 0,\n \"stateMessagesEmitted\": 0\n },\n \"streamStats\": [\n {\n \"stats\": {},\n \"streamName\": \"\",\n \"streamNamespace\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/attempt/save_stats" {:content-type :json
:form-params {:attemptNumber 0
:jobId 0
:stats {:bytesEmitted 0
:estimatedBytes 0
:estimatedRecords 0
:recordsCommitted 0
:recordsEmitted 0
:stateMessagesEmitted 0}
:streamStats [{:stats {}
:streamName ""
:streamNamespace ""}]}})
require "http/client"
url = "{{baseUrl}}/v1/attempt/save_stats"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"attemptNumber\": 0,\n \"jobId\": 0,\n \"stats\": {\n \"bytesEmitted\": 0,\n \"estimatedBytes\": 0,\n \"estimatedRecords\": 0,\n \"recordsCommitted\": 0,\n \"recordsEmitted\": 0,\n \"stateMessagesEmitted\": 0\n },\n \"streamStats\": [\n {\n \"stats\": {},\n \"streamName\": \"\",\n \"streamNamespace\": \"\"\n }\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/attempt/save_stats"),
Content = new StringContent("{\n \"attemptNumber\": 0,\n \"jobId\": 0,\n \"stats\": {\n \"bytesEmitted\": 0,\n \"estimatedBytes\": 0,\n \"estimatedRecords\": 0,\n \"recordsCommitted\": 0,\n \"recordsEmitted\": 0,\n \"stateMessagesEmitted\": 0\n },\n \"streamStats\": [\n {\n \"stats\": {},\n \"streamName\": \"\",\n \"streamNamespace\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/attempt/save_stats");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"attemptNumber\": 0,\n \"jobId\": 0,\n \"stats\": {\n \"bytesEmitted\": 0,\n \"estimatedBytes\": 0,\n \"estimatedRecords\": 0,\n \"recordsCommitted\": 0,\n \"recordsEmitted\": 0,\n \"stateMessagesEmitted\": 0\n },\n \"streamStats\": [\n {\n \"stats\": {},\n \"streamName\": \"\",\n \"streamNamespace\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/attempt/save_stats"
payload := strings.NewReader("{\n \"attemptNumber\": 0,\n \"jobId\": 0,\n \"stats\": {\n \"bytesEmitted\": 0,\n \"estimatedBytes\": 0,\n \"estimatedRecords\": 0,\n \"recordsCommitted\": 0,\n \"recordsEmitted\": 0,\n \"stateMessagesEmitted\": 0\n },\n \"streamStats\": [\n {\n \"stats\": {},\n \"streamName\": \"\",\n \"streamNamespace\": \"\"\n }\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/attempt/save_stats HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 320
{
"attemptNumber": 0,
"jobId": 0,
"stats": {
"bytesEmitted": 0,
"estimatedBytes": 0,
"estimatedRecords": 0,
"recordsCommitted": 0,
"recordsEmitted": 0,
"stateMessagesEmitted": 0
},
"streamStats": [
{
"stats": {},
"streamName": "",
"streamNamespace": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/attempt/save_stats")
.setHeader("content-type", "application/json")
.setBody("{\n \"attemptNumber\": 0,\n \"jobId\": 0,\n \"stats\": {\n \"bytesEmitted\": 0,\n \"estimatedBytes\": 0,\n \"estimatedRecords\": 0,\n \"recordsCommitted\": 0,\n \"recordsEmitted\": 0,\n \"stateMessagesEmitted\": 0\n },\n \"streamStats\": [\n {\n \"stats\": {},\n \"streamName\": \"\",\n \"streamNamespace\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/attempt/save_stats"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"attemptNumber\": 0,\n \"jobId\": 0,\n \"stats\": {\n \"bytesEmitted\": 0,\n \"estimatedBytes\": 0,\n \"estimatedRecords\": 0,\n \"recordsCommitted\": 0,\n \"recordsEmitted\": 0,\n \"stateMessagesEmitted\": 0\n },\n \"streamStats\": [\n {\n \"stats\": {},\n \"streamName\": \"\",\n \"streamNamespace\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"attemptNumber\": 0,\n \"jobId\": 0,\n \"stats\": {\n \"bytesEmitted\": 0,\n \"estimatedBytes\": 0,\n \"estimatedRecords\": 0,\n \"recordsCommitted\": 0,\n \"recordsEmitted\": 0,\n \"stateMessagesEmitted\": 0\n },\n \"streamStats\": [\n {\n \"stats\": {},\n \"streamName\": \"\",\n \"streamNamespace\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/attempt/save_stats")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/attempt/save_stats")
.header("content-type", "application/json")
.body("{\n \"attemptNumber\": 0,\n \"jobId\": 0,\n \"stats\": {\n \"bytesEmitted\": 0,\n \"estimatedBytes\": 0,\n \"estimatedRecords\": 0,\n \"recordsCommitted\": 0,\n \"recordsEmitted\": 0,\n \"stateMessagesEmitted\": 0\n },\n \"streamStats\": [\n {\n \"stats\": {},\n \"streamName\": \"\",\n \"streamNamespace\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
attemptNumber: 0,
jobId: 0,
stats: {
bytesEmitted: 0,
estimatedBytes: 0,
estimatedRecords: 0,
recordsCommitted: 0,
recordsEmitted: 0,
stateMessagesEmitted: 0
},
streamStats: [
{
stats: {},
streamName: '',
streamNamespace: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/attempt/save_stats');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/attempt/save_stats',
headers: {'content-type': 'application/json'},
data: {
attemptNumber: 0,
jobId: 0,
stats: {
bytesEmitted: 0,
estimatedBytes: 0,
estimatedRecords: 0,
recordsCommitted: 0,
recordsEmitted: 0,
stateMessagesEmitted: 0
},
streamStats: [{stats: {}, streamName: '', streamNamespace: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/attempt/save_stats';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"attemptNumber":0,"jobId":0,"stats":{"bytesEmitted":0,"estimatedBytes":0,"estimatedRecords":0,"recordsCommitted":0,"recordsEmitted":0,"stateMessagesEmitted":0},"streamStats":[{"stats":{},"streamName":"","streamNamespace":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/attempt/save_stats',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "attemptNumber": 0,\n "jobId": 0,\n "stats": {\n "bytesEmitted": 0,\n "estimatedBytes": 0,\n "estimatedRecords": 0,\n "recordsCommitted": 0,\n "recordsEmitted": 0,\n "stateMessagesEmitted": 0\n },\n "streamStats": [\n {\n "stats": {},\n "streamName": "",\n "streamNamespace": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"attemptNumber\": 0,\n \"jobId\": 0,\n \"stats\": {\n \"bytesEmitted\": 0,\n \"estimatedBytes\": 0,\n \"estimatedRecords\": 0,\n \"recordsCommitted\": 0,\n \"recordsEmitted\": 0,\n \"stateMessagesEmitted\": 0\n },\n \"streamStats\": [\n {\n \"stats\": {},\n \"streamName\": \"\",\n \"streamNamespace\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/attempt/save_stats")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/attempt/save_stats',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
attemptNumber: 0,
jobId: 0,
stats: {
bytesEmitted: 0,
estimatedBytes: 0,
estimatedRecords: 0,
recordsCommitted: 0,
recordsEmitted: 0,
stateMessagesEmitted: 0
},
streamStats: [{stats: {}, streamName: '', streamNamespace: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/attempt/save_stats',
headers: {'content-type': 'application/json'},
body: {
attemptNumber: 0,
jobId: 0,
stats: {
bytesEmitted: 0,
estimatedBytes: 0,
estimatedRecords: 0,
recordsCommitted: 0,
recordsEmitted: 0,
stateMessagesEmitted: 0
},
streamStats: [{stats: {}, streamName: '', streamNamespace: ''}]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/attempt/save_stats');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
attemptNumber: 0,
jobId: 0,
stats: {
bytesEmitted: 0,
estimatedBytes: 0,
estimatedRecords: 0,
recordsCommitted: 0,
recordsEmitted: 0,
stateMessagesEmitted: 0
},
streamStats: [
{
stats: {},
streamName: '',
streamNamespace: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/attempt/save_stats',
headers: {'content-type': 'application/json'},
data: {
attemptNumber: 0,
jobId: 0,
stats: {
bytesEmitted: 0,
estimatedBytes: 0,
estimatedRecords: 0,
recordsCommitted: 0,
recordsEmitted: 0,
stateMessagesEmitted: 0
},
streamStats: [{stats: {}, streamName: '', streamNamespace: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/attempt/save_stats';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"attemptNumber":0,"jobId":0,"stats":{"bytesEmitted":0,"estimatedBytes":0,"estimatedRecords":0,"recordsCommitted":0,"recordsEmitted":0,"stateMessagesEmitted":0},"streamStats":[{"stats":{},"streamName":"","streamNamespace":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"attemptNumber": @0,
@"jobId": @0,
@"stats": @{ @"bytesEmitted": @0, @"estimatedBytes": @0, @"estimatedRecords": @0, @"recordsCommitted": @0, @"recordsEmitted": @0, @"stateMessagesEmitted": @0 },
@"streamStats": @[ @{ @"stats": @{ }, @"streamName": @"", @"streamNamespace": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/attempt/save_stats"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/attempt/save_stats" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"attemptNumber\": 0,\n \"jobId\": 0,\n \"stats\": {\n \"bytesEmitted\": 0,\n \"estimatedBytes\": 0,\n \"estimatedRecords\": 0,\n \"recordsCommitted\": 0,\n \"recordsEmitted\": 0,\n \"stateMessagesEmitted\": 0\n },\n \"streamStats\": [\n {\n \"stats\": {},\n \"streamName\": \"\",\n \"streamNamespace\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/attempt/save_stats",
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([
'attemptNumber' => 0,
'jobId' => 0,
'stats' => [
'bytesEmitted' => 0,
'estimatedBytes' => 0,
'estimatedRecords' => 0,
'recordsCommitted' => 0,
'recordsEmitted' => 0,
'stateMessagesEmitted' => 0
],
'streamStats' => [
[
'stats' => [
],
'streamName' => '',
'streamNamespace' => ''
]
]
]),
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;
}
request('POST', '{{baseUrl}}/v1/attempt/save_stats', [
'body' => '{
"attemptNumber": 0,
"jobId": 0,
"stats": {
"bytesEmitted": 0,
"estimatedBytes": 0,
"estimatedRecords": 0,
"recordsCommitted": 0,
"recordsEmitted": 0,
"stateMessagesEmitted": 0
},
"streamStats": [
{
"stats": {},
"streamName": "",
"streamNamespace": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/attempt/save_stats');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'attemptNumber' => 0,
'jobId' => 0,
'stats' => [
'bytesEmitted' => 0,
'estimatedBytes' => 0,
'estimatedRecords' => 0,
'recordsCommitted' => 0,
'recordsEmitted' => 0,
'stateMessagesEmitted' => 0
],
'streamStats' => [
[
'stats' => [
],
'streamName' => '',
'streamNamespace' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'attemptNumber' => 0,
'jobId' => 0,
'stats' => [
'bytesEmitted' => 0,
'estimatedBytes' => 0,
'estimatedRecords' => 0,
'recordsCommitted' => 0,
'recordsEmitted' => 0,
'stateMessagesEmitted' => 0
],
'streamStats' => [
[
'stats' => [
],
'streamName' => '',
'streamNamespace' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/attempt/save_stats');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/attempt/save_stats' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"attemptNumber": 0,
"jobId": 0,
"stats": {
"bytesEmitted": 0,
"estimatedBytes": 0,
"estimatedRecords": 0,
"recordsCommitted": 0,
"recordsEmitted": 0,
"stateMessagesEmitted": 0
},
"streamStats": [
{
"stats": {},
"streamName": "",
"streamNamespace": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/attempt/save_stats' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"attemptNumber": 0,
"jobId": 0,
"stats": {
"bytesEmitted": 0,
"estimatedBytes": 0,
"estimatedRecords": 0,
"recordsCommitted": 0,
"recordsEmitted": 0,
"stateMessagesEmitted": 0
},
"streamStats": [
{
"stats": {},
"streamName": "",
"streamNamespace": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"attemptNumber\": 0,\n \"jobId\": 0,\n \"stats\": {\n \"bytesEmitted\": 0,\n \"estimatedBytes\": 0,\n \"estimatedRecords\": 0,\n \"recordsCommitted\": 0,\n \"recordsEmitted\": 0,\n \"stateMessagesEmitted\": 0\n },\n \"streamStats\": [\n {\n \"stats\": {},\n \"streamName\": \"\",\n \"streamNamespace\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/attempt/save_stats", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/attempt/save_stats"
payload = {
"attemptNumber": 0,
"jobId": 0,
"stats": {
"bytesEmitted": 0,
"estimatedBytes": 0,
"estimatedRecords": 0,
"recordsCommitted": 0,
"recordsEmitted": 0,
"stateMessagesEmitted": 0
},
"streamStats": [
{
"stats": {},
"streamName": "",
"streamNamespace": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/attempt/save_stats"
payload <- "{\n \"attemptNumber\": 0,\n \"jobId\": 0,\n \"stats\": {\n \"bytesEmitted\": 0,\n \"estimatedBytes\": 0,\n \"estimatedRecords\": 0,\n \"recordsCommitted\": 0,\n \"recordsEmitted\": 0,\n \"stateMessagesEmitted\": 0\n },\n \"streamStats\": [\n {\n \"stats\": {},\n \"streamName\": \"\",\n \"streamNamespace\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/attempt/save_stats")
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 \"attemptNumber\": 0,\n \"jobId\": 0,\n \"stats\": {\n \"bytesEmitted\": 0,\n \"estimatedBytes\": 0,\n \"estimatedRecords\": 0,\n \"recordsCommitted\": 0,\n \"recordsEmitted\": 0,\n \"stateMessagesEmitted\": 0\n },\n \"streamStats\": [\n {\n \"stats\": {},\n \"streamName\": \"\",\n \"streamNamespace\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/attempt/save_stats') do |req|
req.body = "{\n \"attemptNumber\": 0,\n \"jobId\": 0,\n \"stats\": {\n \"bytesEmitted\": 0,\n \"estimatedBytes\": 0,\n \"estimatedRecords\": 0,\n \"recordsCommitted\": 0,\n \"recordsEmitted\": 0,\n \"stateMessagesEmitted\": 0\n },\n \"streamStats\": [\n {\n \"stats\": {},\n \"streamName\": \"\",\n \"streamNamespace\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/attempt/save_stats";
let payload = json!({
"attemptNumber": 0,
"jobId": 0,
"stats": json!({
"bytesEmitted": 0,
"estimatedBytes": 0,
"estimatedRecords": 0,
"recordsCommitted": 0,
"recordsEmitted": 0,
"stateMessagesEmitted": 0
}),
"streamStats": (
json!({
"stats": json!({}),
"streamName": "",
"streamNamespace": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/attempt/save_stats \
--header 'content-type: application/json' \
--data '{
"attemptNumber": 0,
"jobId": 0,
"stats": {
"bytesEmitted": 0,
"estimatedBytes": 0,
"estimatedRecords": 0,
"recordsCommitted": 0,
"recordsEmitted": 0,
"stateMessagesEmitted": 0
},
"streamStats": [
{
"stats": {},
"streamName": "",
"streamNamespace": ""
}
]
}'
echo '{
"attemptNumber": 0,
"jobId": 0,
"stats": {
"bytesEmitted": 0,
"estimatedBytes": 0,
"estimatedRecords": 0,
"recordsCommitted": 0,
"recordsEmitted": 0,
"stateMessagesEmitted": 0
},
"streamStats": [
{
"stats": {},
"streamName": "",
"streamNamespace": ""
}
]
}' | \
http POST {{baseUrl}}/v1/attempt/save_stats \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "attemptNumber": 0,\n "jobId": 0,\n "stats": {\n "bytesEmitted": 0,\n "estimatedBytes": 0,\n "estimatedRecords": 0,\n "recordsCommitted": 0,\n "recordsEmitted": 0,\n "stateMessagesEmitted": 0\n },\n "streamStats": [\n {\n "stats": {},\n "streamName": "",\n "streamNamespace": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/v1/attempt/save_stats
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"attemptNumber": 0,
"jobId": 0,
"stats": [
"bytesEmitted": 0,
"estimatedBytes": 0,
"estimatedRecords": 0,
"recordsCommitted": 0,
"recordsEmitted": 0,
"stateMessagesEmitted": 0
],
"streamStats": [
[
"stats": [],
"streamName": "",
"streamNamespace": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/attempt/save_stats")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Create a connection between a source and a destination
{{baseUrl}}/v1/connections/create
BODY json
{
"destinationId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operationIds": [],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"sourceCatalogId": "",
"sourceId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/connections/create");
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 \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/connections/create" {:content-type :json
:form-params {:destinationId ""
:geography ""
:name ""
:namespaceDefinition ""
:namespaceFormat ""
:nonBreakingChangesPreference ""
:notifySchemaChanges false
:operationIds []
:prefix ""
:resourceRequirements {:cpu_limit ""
:cpu_request ""
:memory_limit ""
:memory_request ""}
:schedule {:timeUnit ""
:units 0}
:scheduleData {:basicSchedule {:timeUnit ""
:units 0}
:cron {:cronExpression ""
:cronTimeZone ""}}
:scheduleType ""
:sourceCatalogId ""
:sourceId ""
:status ""
:syncCatalog {:streams [{:config {:aliasName ""
:cursorField []
:destinationSyncMode ""
:fieldSelectionEnabled false
:primaryKey []
:selected false
:selectedFields [{:fieldPath []}]
:suggested false
:syncMode ""}
:stream {:defaultCursorField []
:jsonSchema {}
:name ""
:namespace ""
:sourceDefinedCursor false
:sourceDefinedPrimaryKey []
:supportedSyncModes []}}]}}})
require "http/client"
url = "{{baseUrl}}/v1/connections/create"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/connections/create"),
Content = new StringContent("{\n \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/connections/create");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/connections/create"
payload := strings.NewReader("{\n \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/connections/create HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1351
{
"destinationId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operationIds": [],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"sourceCatalogId": "",
"sourceId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/connections/create")
.setHeader("content-type", "application/json")
.setBody("{\n \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/connections/create"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/connections/create")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/connections/create")
.header("content-type", "application/json")
.body("{\n \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}")
.asString();
const data = JSON.stringify({
destinationId: '',
geography: '',
name: '',
namespaceDefinition: '',
namespaceFormat: '',
nonBreakingChangesPreference: '',
notifySchemaChanges: false,
operationIds: [],
prefix: '',
resourceRequirements: {
cpu_limit: '',
cpu_request: '',
memory_limit: '',
memory_request: ''
},
schedule: {
timeUnit: '',
units: 0
},
scheduleData: {
basicSchedule: {
timeUnit: '',
units: 0
},
cron: {
cronExpression: '',
cronTimeZone: ''
}
},
scheduleType: '',
sourceCatalogId: '',
sourceId: '',
status: '',
syncCatalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [
{
fieldPath: []
}
],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/connections/create');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/create',
headers: {'content-type': 'application/json'},
data: {
destinationId: '',
geography: '',
name: '',
namespaceDefinition: '',
namespaceFormat: '',
nonBreakingChangesPreference: '',
notifySchemaChanges: false,
operationIds: [],
prefix: '',
resourceRequirements: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
schedule: {timeUnit: '', units: 0},
scheduleData: {
basicSchedule: {timeUnit: '', units: 0},
cron: {cronExpression: '', cronTimeZone: ''}
},
scheduleType: '',
sourceCatalogId: '',
sourceId: '',
status: '',
syncCatalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [{fieldPath: []}],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/connections/create';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationId":"","geography":"","name":"","namespaceDefinition":"","namespaceFormat":"","nonBreakingChangesPreference":"","notifySchemaChanges":false,"operationIds":[],"prefix":"","resourceRequirements":{"cpu_limit":"","cpu_request":"","memory_limit":"","memory_request":""},"schedule":{"timeUnit":"","units":0},"scheduleData":{"basicSchedule":{"timeUnit":"","units":0},"cron":{"cronExpression":"","cronTimeZone":""}},"scheduleType":"","sourceCatalogId":"","sourceId":"","status":"","syncCatalog":{"streams":[{"config":{"aliasName":"","cursorField":[],"destinationSyncMode":"","fieldSelectionEnabled":false,"primaryKey":[],"selected":false,"selectedFields":[{"fieldPath":[]}],"suggested":false,"syncMode":""},"stream":{"defaultCursorField":[],"jsonSchema":{},"name":"","namespace":"","sourceDefinedCursor":false,"sourceDefinedPrimaryKey":[],"supportedSyncModes":[]}}]}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/connections/create',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "destinationId": "",\n "geography": "",\n "name": "",\n "namespaceDefinition": "",\n "namespaceFormat": "",\n "nonBreakingChangesPreference": "",\n "notifySchemaChanges": false,\n "operationIds": [],\n "prefix": "",\n "resourceRequirements": {\n "cpu_limit": "",\n "cpu_request": "",\n "memory_limit": "",\n "memory_request": ""\n },\n "schedule": {\n "timeUnit": "",\n "units": 0\n },\n "scheduleData": {\n "basicSchedule": {\n "timeUnit": "",\n "units": 0\n },\n "cron": {\n "cronExpression": "",\n "cronTimeZone": ""\n }\n },\n "scheduleType": "",\n "sourceCatalogId": "",\n "sourceId": "",\n "status": "",\n "syncCatalog": {\n "streams": [\n {\n "config": {\n "aliasName": "",\n "cursorField": [],\n "destinationSyncMode": "",\n "fieldSelectionEnabled": false,\n "primaryKey": [],\n "selected": false,\n "selectedFields": [\n {\n "fieldPath": []\n }\n ],\n "suggested": false,\n "syncMode": ""\n },\n "stream": {\n "defaultCursorField": [],\n "jsonSchema": {},\n "name": "",\n "namespace": "",\n "sourceDefinedCursor": false,\n "sourceDefinedPrimaryKey": [],\n "supportedSyncModes": []\n }\n }\n ]\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/connections/create")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/connections/create',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
destinationId: '',
geography: '',
name: '',
namespaceDefinition: '',
namespaceFormat: '',
nonBreakingChangesPreference: '',
notifySchemaChanges: false,
operationIds: [],
prefix: '',
resourceRequirements: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
schedule: {timeUnit: '', units: 0},
scheduleData: {
basicSchedule: {timeUnit: '', units: 0},
cron: {cronExpression: '', cronTimeZone: ''}
},
scheduleType: '',
sourceCatalogId: '',
sourceId: '',
status: '',
syncCatalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [{fieldPath: []}],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/create',
headers: {'content-type': 'application/json'},
body: {
destinationId: '',
geography: '',
name: '',
namespaceDefinition: '',
namespaceFormat: '',
nonBreakingChangesPreference: '',
notifySchemaChanges: false,
operationIds: [],
prefix: '',
resourceRequirements: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
schedule: {timeUnit: '', units: 0},
scheduleData: {
basicSchedule: {timeUnit: '', units: 0},
cron: {cronExpression: '', cronTimeZone: ''}
},
scheduleType: '',
sourceCatalogId: '',
sourceId: '',
status: '',
syncCatalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [{fieldPath: []}],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/connections/create');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
destinationId: '',
geography: '',
name: '',
namespaceDefinition: '',
namespaceFormat: '',
nonBreakingChangesPreference: '',
notifySchemaChanges: false,
operationIds: [],
prefix: '',
resourceRequirements: {
cpu_limit: '',
cpu_request: '',
memory_limit: '',
memory_request: ''
},
schedule: {
timeUnit: '',
units: 0
},
scheduleData: {
basicSchedule: {
timeUnit: '',
units: 0
},
cron: {
cronExpression: '',
cronTimeZone: ''
}
},
scheduleType: '',
sourceCatalogId: '',
sourceId: '',
status: '',
syncCatalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [
{
fieldPath: []
}
],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/create',
headers: {'content-type': 'application/json'},
data: {
destinationId: '',
geography: '',
name: '',
namespaceDefinition: '',
namespaceFormat: '',
nonBreakingChangesPreference: '',
notifySchemaChanges: false,
operationIds: [],
prefix: '',
resourceRequirements: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
schedule: {timeUnit: '', units: 0},
scheduleData: {
basicSchedule: {timeUnit: '', units: 0},
cron: {cronExpression: '', cronTimeZone: ''}
},
scheduleType: '',
sourceCatalogId: '',
sourceId: '',
status: '',
syncCatalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [{fieldPath: []}],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/connections/create';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationId":"","geography":"","name":"","namespaceDefinition":"","namespaceFormat":"","nonBreakingChangesPreference":"","notifySchemaChanges":false,"operationIds":[],"prefix":"","resourceRequirements":{"cpu_limit":"","cpu_request":"","memory_limit":"","memory_request":""},"schedule":{"timeUnit":"","units":0},"scheduleData":{"basicSchedule":{"timeUnit":"","units":0},"cron":{"cronExpression":"","cronTimeZone":""}},"scheduleType":"","sourceCatalogId":"","sourceId":"","status":"","syncCatalog":{"streams":[{"config":{"aliasName":"","cursorField":[],"destinationSyncMode":"","fieldSelectionEnabled":false,"primaryKey":[],"selected":false,"selectedFields":[{"fieldPath":[]}],"suggested":false,"syncMode":""},"stream":{"defaultCursorField":[],"jsonSchema":{},"name":"","namespace":"","sourceDefinedCursor":false,"sourceDefinedPrimaryKey":[],"supportedSyncModes":[]}}]}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"destinationId": @"",
@"geography": @"",
@"name": @"",
@"namespaceDefinition": @"",
@"namespaceFormat": @"",
@"nonBreakingChangesPreference": @"",
@"notifySchemaChanges": @NO,
@"operationIds": @[ ],
@"prefix": @"",
@"resourceRequirements": @{ @"cpu_limit": @"", @"cpu_request": @"", @"memory_limit": @"", @"memory_request": @"" },
@"schedule": @{ @"timeUnit": @"", @"units": @0 },
@"scheduleData": @{ @"basicSchedule": @{ @"timeUnit": @"", @"units": @0 }, @"cron": @{ @"cronExpression": @"", @"cronTimeZone": @"" } },
@"scheduleType": @"",
@"sourceCatalogId": @"",
@"sourceId": @"",
@"status": @"",
@"syncCatalog": @{ @"streams": @[ @{ @"config": @{ @"aliasName": @"", @"cursorField": @[ ], @"destinationSyncMode": @"", @"fieldSelectionEnabled": @NO, @"primaryKey": @[ ], @"selected": @NO, @"selectedFields": @[ @{ @"fieldPath": @[ ] } ], @"suggested": @NO, @"syncMode": @"" }, @"stream": @{ @"defaultCursorField": @[ ], @"jsonSchema": @{ }, @"name": @"", @"namespace": @"", @"sourceDefinedCursor": @NO, @"sourceDefinedPrimaryKey": @[ ], @"supportedSyncModes": @[ ] } } ] } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/connections/create"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/connections/create" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/connections/create",
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([
'destinationId' => '',
'geography' => '',
'name' => '',
'namespaceDefinition' => '',
'namespaceFormat' => '',
'nonBreakingChangesPreference' => '',
'notifySchemaChanges' => null,
'operationIds' => [
],
'prefix' => '',
'resourceRequirements' => [
'cpu_limit' => '',
'cpu_request' => '',
'memory_limit' => '',
'memory_request' => ''
],
'schedule' => [
'timeUnit' => '',
'units' => 0
],
'scheduleData' => [
'basicSchedule' => [
'timeUnit' => '',
'units' => 0
],
'cron' => [
'cronExpression' => '',
'cronTimeZone' => ''
]
],
'scheduleType' => '',
'sourceCatalogId' => '',
'sourceId' => '',
'status' => '',
'syncCatalog' => [
'streams' => [
[
'config' => [
'aliasName' => '',
'cursorField' => [
],
'destinationSyncMode' => '',
'fieldSelectionEnabled' => null,
'primaryKey' => [
],
'selected' => null,
'selectedFields' => [
[
'fieldPath' => [
]
]
],
'suggested' => null,
'syncMode' => ''
],
'stream' => [
'defaultCursorField' => [
],
'jsonSchema' => [
],
'name' => '',
'namespace' => '',
'sourceDefinedCursor' => null,
'sourceDefinedPrimaryKey' => [
],
'supportedSyncModes' => [
]
]
]
]
]
]),
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;
}
request('POST', '{{baseUrl}}/v1/connections/create', [
'body' => '{
"destinationId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operationIds": [],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"sourceCatalogId": "",
"sourceId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/connections/create');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'destinationId' => '',
'geography' => '',
'name' => '',
'namespaceDefinition' => '',
'namespaceFormat' => '',
'nonBreakingChangesPreference' => '',
'notifySchemaChanges' => null,
'operationIds' => [
],
'prefix' => '',
'resourceRequirements' => [
'cpu_limit' => '',
'cpu_request' => '',
'memory_limit' => '',
'memory_request' => ''
],
'schedule' => [
'timeUnit' => '',
'units' => 0
],
'scheduleData' => [
'basicSchedule' => [
'timeUnit' => '',
'units' => 0
],
'cron' => [
'cronExpression' => '',
'cronTimeZone' => ''
]
],
'scheduleType' => '',
'sourceCatalogId' => '',
'sourceId' => '',
'status' => '',
'syncCatalog' => [
'streams' => [
[
'config' => [
'aliasName' => '',
'cursorField' => [
],
'destinationSyncMode' => '',
'fieldSelectionEnabled' => null,
'primaryKey' => [
],
'selected' => null,
'selectedFields' => [
[
'fieldPath' => [
]
]
],
'suggested' => null,
'syncMode' => ''
],
'stream' => [
'defaultCursorField' => [
],
'jsonSchema' => [
],
'name' => '',
'namespace' => '',
'sourceDefinedCursor' => null,
'sourceDefinedPrimaryKey' => [
],
'supportedSyncModes' => [
]
]
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'destinationId' => '',
'geography' => '',
'name' => '',
'namespaceDefinition' => '',
'namespaceFormat' => '',
'nonBreakingChangesPreference' => '',
'notifySchemaChanges' => null,
'operationIds' => [
],
'prefix' => '',
'resourceRequirements' => [
'cpu_limit' => '',
'cpu_request' => '',
'memory_limit' => '',
'memory_request' => ''
],
'schedule' => [
'timeUnit' => '',
'units' => 0
],
'scheduleData' => [
'basicSchedule' => [
'timeUnit' => '',
'units' => 0
],
'cron' => [
'cronExpression' => '',
'cronTimeZone' => ''
]
],
'scheduleType' => '',
'sourceCatalogId' => '',
'sourceId' => '',
'status' => '',
'syncCatalog' => [
'streams' => [
[
'config' => [
'aliasName' => '',
'cursorField' => [
],
'destinationSyncMode' => '',
'fieldSelectionEnabled' => null,
'primaryKey' => [
],
'selected' => null,
'selectedFields' => [
[
'fieldPath' => [
]
]
],
'suggested' => null,
'syncMode' => ''
],
'stream' => [
'defaultCursorField' => [
],
'jsonSchema' => [
],
'name' => '',
'namespace' => '',
'sourceDefinedCursor' => null,
'sourceDefinedPrimaryKey' => [
],
'supportedSyncModes' => [
]
]
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/connections/create');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/connections/create' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operationIds": [],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"sourceCatalogId": "",
"sourceId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/connections/create' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operationIds": [],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"sourceCatalogId": "",
"sourceId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/connections/create", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/connections/create"
payload = {
"destinationId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": False,
"operationIds": [],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"sourceCatalogId": "",
"sourceId": "",
"status": "",
"syncCatalog": { "streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": False,
"primaryKey": [],
"selected": False,
"selectedFields": [{ "fieldPath": [] }],
"suggested": False,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": False,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
] }
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/connections/create"
payload <- "{\n \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/connections/create")
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 \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/connections/create') do |req|
req.body = "{\n \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/connections/create";
let payload = json!({
"destinationId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operationIds": (),
"prefix": "",
"resourceRequirements": json!({
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
}),
"schedule": json!({
"timeUnit": "",
"units": 0
}),
"scheduleData": json!({
"basicSchedule": json!({
"timeUnit": "",
"units": 0
}),
"cron": json!({
"cronExpression": "",
"cronTimeZone": ""
})
}),
"scheduleType": "",
"sourceCatalogId": "",
"sourceId": "",
"status": "",
"syncCatalog": json!({"streams": (
json!({
"config": json!({
"aliasName": "",
"cursorField": (),
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": (),
"selected": false,
"selectedFields": (json!({"fieldPath": ()})),
"suggested": false,
"syncMode": ""
}),
"stream": json!({
"defaultCursorField": (),
"jsonSchema": json!({}),
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": (),
"supportedSyncModes": ()
})
})
)})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/connections/create \
--header 'content-type: application/json' \
--data '{
"destinationId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operationIds": [],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"sourceCatalogId": "",
"sourceId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}'
echo '{
"destinationId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operationIds": [],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"sourceCatalogId": "",
"sourceId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}' | \
http POST {{baseUrl}}/v1/connections/create \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "destinationId": "",\n "geography": "",\n "name": "",\n "namespaceDefinition": "",\n "namespaceFormat": "",\n "nonBreakingChangesPreference": "",\n "notifySchemaChanges": false,\n "operationIds": [],\n "prefix": "",\n "resourceRequirements": {\n "cpu_limit": "",\n "cpu_request": "",\n "memory_limit": "",\n "memory_request": ""\n },\n "schedule": {\n "timeUnit": "",\n "units": 0\n },\n "scheduleData": {\n "basicSchedule": {\n "timeUnit": "",\n "units": 0\n },\n "cron": {\n "cronExpression": "",\n "cronTimeZone": ""\n }\n },\n "scheduleType": "",\n "sourceCatalogId": "",\n "sourceId": "",\n "status": "",\n "syncCatalog": {\n "streams": [\n {\n "config": {\n "aliasName": "",\n "cursorField": [],\n "destinationSyncMode": "",\n "fieldSelectionEnabled": false,\n "primaryKey": [],\n "selected": false,\n "selectedFields": [\n {\n "fieldPath": []\n }\n ],\n "suggested": false,\n "syncMode": ""\n },\n "stream": {\n "defaultCursorField": [],\n "jsonSchema": {},\n "name": "",\n "namespace": "",\n "sourceDefinedCursor": false,\n "sourceDefinedPrimaryKey": [],\n "supportedSyncModes": []\n }\n }\n ]\n }\n}' \
--output-document \
- {{baseUrl}}/v1/connections/create
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"destinationId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operationIds": [],
"prefix": "",
"resourceRequirements": [
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
],
"schedule": [
"timeUnit": "",
"units": 0
],
"scheduleData": [
"basicSchedule": [
"timeUnit": "",
"units": 0
],
"cron": [
"cronExpression": "",
"cronTimeZone": ""
]
],
"scheduleType": "",
"sourceCatalogId": "",
"sourceId": "",
"status": "",
"syncCatalog": ["streams": [
[
"config": [
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [["fieldPath": []]],
"suggested": false,
"syncMode": ""
],
"stream": [
"defaultCursorField": [],
"jsonSchema": [],
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
]
]
]]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/connections/create")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"namespaceFormat": "${SOURCE_NAMESPACE}"
}
POST
Delete a connection
{{baseUrl}}/v1/connections/delete
BODY json
{
"connectionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/connections/delete");
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 \"connectionId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/connections/delete" {:content-type :json
:form-params {:connectionId ""}})
require "http/client"
url = "{{baseUrl}}/v1/connections/delete"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"connectionId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/connections/delete"),
Content = new StringContent("{\n \"connectionId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/connections/delete");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"connectionId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/connections/delete"
payload := strings.NewReader("{\n \"connectionId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/connections/delete HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 24
{
"connectionId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/connections/delete")
.setHeader("content-type", "application/json")
.setBody("{\n \"connectionId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/connections/delete"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"connectionId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"connectionId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/connections/delete")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/connections/delete")
.header("content-type", "application/json")
.body("{\n \"connectionId\": \"\"\n}")
.asString();
const data = JSON.stringify({
connectionId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/connections/delete');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/delete',
headers: {'content-type': 'application/json'},
data: {connectionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/connections/delete';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/connections/delete',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "connectionId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"connectionId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/connections/delete")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/connections/delete',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({connectionId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/delete',
headers: {'content-type': 'application/json'},
body: {connectionId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/connections/delete');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
connectionId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/delete',
headers: {'content-type': 'application/json'},
data: {connectionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/connections/delete';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"connectionId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/connections/delete"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/connections/delete" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"connectionId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/connections/delete",
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([
'connectionId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/connections/delete', [
'body' => '{
"connectionId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/connections/delete');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'connectionId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'connectionId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/connections/delete');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/connections/delete' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/connections/delete' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"connectionId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/connections/delete", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/connections/delete"
payload = { "connectionId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/connections/delete"
payload <- "{\n \"connectionId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/connections/delete")
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 \"connectionId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/connections/delete') do |req|
req.body = "{\n \"connectionId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/connections/delete";
let payload = json!({"connectionId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/connections/delete \
--header 'content-type: application/json' \
--data '{
"connectionId": ""
}'
echo '{
"connectionId": ""
}' | \
http POST {{baseUrl}}/v1/connections/delete \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "connectionId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/connections/delete
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["connectionId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/connections/delete")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Get a connection
{{baseUrl}}/v1/connections/get
BODY json
{
"connectionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/connections/get");
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 \"connectionId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/connections/get" {:content-type :json
:form-params {:connectionId ""}})
require "http/client"
url = "{{baseUrl}}/v1/connections/get"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"connectionId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/connections/get"),
Content = new StringContent("{\n \"connectionId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/connections/get");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"connectionId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/connections/get"
payload := strings.NewReader("{\n \"connectionId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/connections/get HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 24
{
"connectionId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/connections/get")
.setHeader("content-type", "application/json")
.setBody("{\n \"connectionId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/connections/get"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"connectionId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"connectionId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/connections/get")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/connections/get")
.header("content-type", "application/json")
.body("{\n \"connectionId\": \"\"\n}")
.asString();
const data = JSON.stringify({
connectionId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/connections/get');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/get',
headers: {'content-type': 'application/json'},
data: {connectionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/connections/get';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/connections/get',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "connectionId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"connectionId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/connections/get")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/connections/get',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({connectionId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/get',
headers: {'content-type': 'application/json'},
body: {connectionId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/connections/get');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
connectionId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/get',
headers: {'content-type': 'application/json'},
data: {connectionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/connections/get';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"connectionId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/connections/get"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/connections/get" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"connectionId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/connections/get",
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([
'connectionId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/connections/get', [
'body' => '{
"connectionId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/connections/get');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'connectionId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'connectionId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/connections/get');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/connections/get' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/connections/get' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"connectionId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/connections/get", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/connections/get"
payload = { "connectionId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/connections/get"
payload <- "{\n \"connectionId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/connections/get")
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 \"connectionId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/connections/get') do |req|
req.body = "{\n \"connectionId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/connections/get";
let payload = json!({"connectionId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/connections/get \
--header 'content-type: application/json' \
--data '{
"connectionId": ""
}'
echo '{
"connectionId": ""
}' | \
http POST {{baseUrl}}/v1/connections/get \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "connectionId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/connections/get
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["connectionId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/connections/get")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"namespaceFormat": "${SOURCE_NAMESPACE}"
}
POST
Reset the data for the connection. Deletes data generated by the connection in the destination. Resets any cursors back to initial state.
{{baseUrl}}/v1/connections/reset
BODY json
{
"connectionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/connections/reset");
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 \"connectionId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/connections/reset" {:content-type :json
:form-params {:connectionId ""}})
require "http/client"
url = "{{baseUrl}}/v1/connections/reset"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"connectionId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/connections/reset"),
Content = new StringContent("{\n \"connectionId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/connections/reset");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"connectionId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/connections/reset"
payload := strings.NewReader("{\n \"connectionId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/connections/reset HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 24
{
"connectionId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/connections/reset")
.setHeader("content-type", "application/json")
.setBody("{\n \"connectionId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/connections/reset"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"connectionId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"connectionId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/connections/reset")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/connections/reset")
.header("content-type", "application/json")
.body("{\n \"connectionId\": \"\"\n}")
.asString();
const data = JSON.stringify({
connectionId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/connections/reset');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/reset',
headers: {'content-type': 'application/json'},
data: {connectionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/connections/reset';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/connections/reset',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "connectionId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"connectionId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/connections/reset")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/connections/reset',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({connectionId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/reset',
headers: {'content-type': 'application/json'},
body: {connectionId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/connections/reset');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
connectionId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/reset',
headers: {'content-type': 'application/json'},
data: {connectionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/connections/reset';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"connectionId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/connections/reset"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/connections/reset" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"connectionId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/connections/reset",
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([
'connectionId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/connections/reset', [
'body' => '{
"connectionId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/connections/reset');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'connectionId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'connectionId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/connections/reset');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/connections/reset' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/connections/reset' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"connectionId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/connections/reset", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/connections/reset"
payload = { "connectionId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/connections/reset"
payload <- "{\n \"connectionId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/connections/reset")
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 \"connectionId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/connections/reset') do |req|
req.body = "{\n \"connectionId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/connections/reset";
let payload = json!({"connectionId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/connections/reset \
--header 'content-type: application/json' \
--data '{
"connectionId": ""
}'
echo '{
"connectionId": ""
}' | \
http POST {{baseUrl}}/v1/connections/reset \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "connectionId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/connections/reset
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["connectionId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/connections/reset")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Returns all connections for a workspace, including deleted connections.
{{baseUrl}}/v1/connections/list_all
BODY json
{
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/connections/list_all");
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 \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/connections/list_all" {:content-type :json
:form-params {:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/connections/list_all"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/connections/list_all"),
Content = new StringContent("{\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/connections/list_all");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/connections/list_all"
payload := strings.NewReader("{\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/connections/list_all HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/connections/list_all")
.setHeader("content-type", "application/json")
.setBody("{\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/connections/list_all"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/connections/list_all")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/connections/list_all")
.header("content-type", "application/json")
.body("{\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/connections/list_all');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/list_all',
headers: {'content-type': 'application/json'},
data: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/connections/list_all';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/connections/list_all',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/connections/list_all")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/connections/list_all',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({workspaceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/list_all',
headers: {'content-type': 'application/json'},
body: {workspaceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/connections/list_all');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/list_all',
headers: {'content-type': 'application/json'},
data: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/connections/list_all';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/connections/list_all"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/connections/list_all" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/connections/list_all",
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([
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/connections/list_all', [
'body' => '{
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/connections/list_all');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/connections/list_all');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/connections/list_all' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/connections/list_all' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/connections/list_all", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/connections/list_all"
payload = { "workspaceId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/connections/list_all"
payload <- "{\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/connections/list_all")
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 \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/connections/list_all') do |req|
req.body = "{\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/connections/list_all";
let payload = json!({"workspaceId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/connections/list_all \
--header 'content-type: application/json' \
--data '{
"workspaceId": ""
}'
echo '{
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/connections/list_all \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/connections/list_all
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["workspaceId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/connections/list_all")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Returns all connections for a workspace.
{{baseUrl}}/v1/connections/list
BODY json
{
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/connections/list");
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 \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/connections/list" {:content-type :json
:form-params {:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/connections/list"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/connections/list"),
Content = new StringContent("{\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/connections/list");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/connections/list"
payload := strings.NewReader("{\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/connections/list HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/connections/list")
.setHeader("content-type", "application/json")
.setBody("{\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/connections/list"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/connections/list")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/connections/list")
.header("content-type", "application/json")
.body("{\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/connections/list');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/list',
headers: {'content-type': 'application/json'},
data: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/connections/list';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/connections/list',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/connections/list")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/connections/list',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({workspaceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/list',
headers: {'content-type': 'application/json'},
body: {workspaceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/connections/list');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/list',
headers: {'content-type': 'application/json'},
data: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/connections/list';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/connections/list"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/connections/list" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/connections/list",
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([
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/connections/list', [
'body' => '{
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/connections/list');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/connections/list');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/connections/list' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/connections/list' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/connections/list", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/connections/list"
payload = { "workspaceId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/connections/list"
payload <- "{\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/connections/list")
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 \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/connections/list') do |req|
req.body = "{\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/connections/list";
let payload = json!({"workspaceId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/connections/list \
--header 'content-type: application/json' \
--data '{
"workspaceId": ""
}'
echo '{
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/connections/list \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/connections/list
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["workspaceId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/connections/list")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Search connections
{{baseUrl}}/v1/connections/search
BODY json
{
"connectionId": "",
"destination": {
"connectionConfiguration": "",
"destinationDefinitionId": "",
"destinationId": "",
"destinationName": "",
"name": "",
"workspaceId": ""
},
"destinationId": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"prefix": "",
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"source": {
"connectionConfiguration": "",
"name": "",
"sourceDefinitionId": "",
"sourceId": "",
"sourceName": "",
"workspaceId": ""
},
"sourceId": "",
"status": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/connections/search");
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 \"destination\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n },\n \"namespaceFormat\": \"${SOURCE_NAMESPACE}\",\n \"source\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/connections/search" {:content-type :json
:form-params {:destination {:connectionConfiguration {:user "charles"}}
:namespaceFormat "${SOURCE_NAMESPACE}"
:source {:connectionConfiguration {:user "charles"}}}})
require "http/client"
url = "{{baseUrl}}/v1/connections/search"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"destination\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n },\n \"namespaceFormat\": \"${SOURCE_NAMESPACE}\",\n \"source\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/connections/search"),
Content = new StringContent("{\n \"destination\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n },\n \"namespaceFormat\": \"${SOURCE_NAMESPACE}\",\n \"source\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/connections/search");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"destination\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n },\n \"namespaceFormat\": \"${SOURCE_NAMESPACE}\",\n \"source\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/connections/search"
payload := strings.NewReader("{\n \"destination\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n },\n \"namespaceFormat\": \"${SOURCE_NAMESPACE}\",\n \"source\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/connections/search HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 215
{
"destination": {
"connectionConfiguration": {
"user": "charles"
}
},
"namespaceFormat": "${SOURCE_NAMESPACE}",
"source": {
"connectionConfiguration": {
"user": "charles"
}
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/connections/search")
.setHeader("content-type", "application/json")
.setBody("{\n \"destination\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n },\n \"namespaceFormat\": \"${SOURCE_NAMESPACE}\",\n \"source\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/connections/search"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"destination\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n },\n \"namespaceFormat\": \"${SOURCE_NAMESPACE}\",\n \"source\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"destination\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n },\n \"namespaceFormat\": \"${SOURCE_NAMESPACE}\",\n \"source\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/connections/search")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/connections/search")
.header("content-type", "application/json")
.body("{\n \"destination\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n },\n \"namespaceFormat\": \"${SOURCE_NAMESPACE}\",\n \"source\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}")
.asString();
const data = JSON.stringify({
destination: {
connectionConfiguration: {
user: 'charles'
}
},
namespaceFormat: '${SOURCE_NAMESPACE}',
source: {
connectionConfiguration: {
user: 'charles'
}
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/connections/search');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/search',
headers: {'content-type': 'application/json'},
data: {
destination: {connectionConfiguration: {user: 'charles'}},
namespaceFormat: '${SOURCE_NAMESPACE}',
source: {connectionConfiguration: {user: 'charles'}}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/connections/search';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destination":{"connectionConfiguration":{"user":"charles"}},"namespaceFormat":"${SOURCE_NAMESPACE}","source":{"connectionConfiguration":{"user":"charles"}}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/connections/search',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "destination": {\n "connectionConfiguration": {\n "user": "charles"\n }\n },\n "namespaceFormat": "${SOURCE_NAMESPACE}",\n "source": {\n "connectionConfiguration": {\n "user": "charles"\n }\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"destination\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n },\n \"namespaceFormat\": \"${SOURCE_NAMESPACE}\",\n \"source\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/connections/search")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/connections/search',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
destination: {connectionConfiguration: {user: 'charles'}},
namespaceFormat: '${SOURCE_NAMESPACE}',
source: {connectionConfiguration: {user: 'charles'}}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/search',
headers: {'content-type': 'application/json'},
body: {
destination: {connectionConfiguration: {user: 'charles'}},
namespaceFormat: '${SOURCE_NAMESPACE}',
source: {connectionConfiguration: {user: 'charles'}}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/connections/search');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
destination: {
connectionConfiguration: {
user: 'charles'
}
},
namespaceFormat: '${SOURCE_NAMESPACE}',
source: {
connectionConfiguration: {
user: 'charles'
}
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/search',
headers: {'content-type': 'application/json'},
data: {
destination: {connectionConfiguration: {user: 'charles'}},
namespaceFormat: '${SOURCE_NAMESPACE}',
source: {connectionConfiguration: {user: 'charles'}}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/connections/search';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destination":{"connectionConfiguration":{"user":"charles"}},"namespaceFormat":"${SOURCE_NAMESPACE}","source":{"connectionConfiguration":{"user":"charles"}}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"destination": @{ @"connectionConfiguration": @{ @"user": @"charles" } },
@"namespaceFormat": @"${SOURCE_NAMESPACE}",
@"source": @{ @"connectionConfiguration": @{ @"user": @"charles" } } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/connections/search"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/connections/search" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"destination\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n },\n \"namespaceFormat\": \"${SOURCE_NAMESPACE}\",\n \"source\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/connections/search",
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([
'destination' => [
'connectionConfiguration' => [
'user' => 'charles'
]
],
'namespaceFormat' => '${SOURCE_NAMESPACE}',
'source' => [
'connectionConfiguration' => [
'user' => 'charles'
]
]
]),
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;
}
request('POST', '{{baseUrl}}/v1/connections/search', [
'body' => '{
"destination": {
"connectionConfiguration": {
"user": "charles"
}
},
"namespaceFormat": "${SOURCE_NAMESPACE}",
"source": {
"connectionConfiguration": {
"user": "charles"
}
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/connections/search');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'destination' => [
'connectionConfiguration' => [
'user' => 'charles'
]
],
'namespaceFormat' => '${SOURCE_NAMESPACE}',
'source' => [
'connectionConfiguration' => [
'user' => 'charles'
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'destination' => [
'connectionConfiguration' => [
'user' => 'charles'
]
],
'namespaceFormat' => '${SOURCE_NAMESPACE}',
'source' => [
'connectionConfiguration' => [
'user' => 'charles'
]
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/connections/search');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/connections/search' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destination": {
"connectionConfiguration": {
"user": "charles"
}
},
"namespaceFormat": "${SOURCE_NAMESPACE}",
"source": {
"connectionConfiguration": {
"user": "charles"
}
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/connections/search' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destination": {
"connectionConfiguration": {
"user": "charles"
}
},
"namespaceFormat": "${SOURCE_NAMESPACE}",
"source": {
"connectionConfiguration": {
"user": "charles"
}
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"destination\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n },\n \"namespaceFormat\": \"${SOURCE_NAMESPACE}\",\n \"source\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/connections/search", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/connections/search"
payload = {
"destination": { "connectionConfiguration": { "user": "charles" } },
"namespaceFormat": "${SOURCE_NAMESPACE}",
"source": { "connectionConfiguration": { "user": "charles" } }
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/connections/search"
payload <- "{\n \"destination\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n },\n \"namespaceFormat\": \"${SOURCE_NAMESPACE}\",\n \"source\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/connections/search")
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 \"destination\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n },\n \"namespaceFormat\": \"${SOURCE_NAMESPACE}\",\n \"source\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/connections/search') do |req|
req.body = "{\n \"destination\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n },\n \"namespaceFormat\": \"${SOURCE_NAMESPACE}\",\n \"source\": {\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/connections/search";
let payload = json!({
"destination": json!({"connectionConfiguration": json!({"user": "charles"})}),
"namespaceFormat": "${SOURCE_NAMESPACE}",
"source": json!({"connectionConfiguration": json!({"user": "charles"})})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/connections/search \
--header 'content-type: application/json' \
--data '{
"destination": {
"connectionConfiguration": {
"user": "charles"
}
},
"namespaceFormat": "${SOURCE_NAMESPACE}",
"source": {
"connectionConfiguration": {
"user": "charles"
}
}
}'
echo '{
"destination": {
"connectionConfiguration": {
"user": "charles"
}
},
"namespaceFormat": "${SOURCE_NAMESPACE}",
"source": {
"connectionConfiguration": {
"user": "charles"
}
}
}' | \
http POST {{baseUrl}}/v1/connections/search \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "destination": {\n "connectionConfiguration": {\n "user": "charles"\n }\n },\n "namespaceFormat": "${SOURCE_NAMESPACE}",\n "source": {\n "connectionConfiguration": {\n "user": "charles"\n }\n }\n}' \
--output-document \
- {{baseUrl}}/v1/connections/search
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"destination": ["connectionConfiguration": ["user": "charles"]],
"namespaceFormat": "${SOURCE_NAMESPACE}",
"source": ["connectionConfiguration": ["user": "charles"]]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/connections/search")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Trigger a manual sync of the connection
{{baseUrl}}/v1/connections/sync
BODY json
{
"connectionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/connections/sync");
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 \"connectionId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/connections/sync" {:content-type :json
:form-params {:connectionId ""}})
require "http/client"
url = "{{baseUrl}}/v1/connections/sync"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"connectionId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/connections/sync"),
Content = new StringContent("{\n \"connectionId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/connections/sync");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"connectionId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/connections/sync"
payload := strings.NewReader("{\n \"connectionId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/connections/sync HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 24
{
"connectionId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/connections/sync")
.setHeader("content-type", "application/json")
.setBody("{\n \"connectionId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/connections/sync"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"connectionId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"connectionId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/connections/sync")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/connections/sync")
.header("content-type", "application/json")
.body("{\n \"connectionId\": \"\"\n}")
.asString();
const data = JSON.stringify({
connectionId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/connections/sync');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/sync',
headers: {'content-type': 'application/json'},
data: {connectionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/connections/sync';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/connections/sync',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "connectionId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"connectionId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/connections/sync")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/connections/sync',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({connectionId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/sync',
headers: {'content-type': 'application/json'},
body: {connectionId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/connections/sync');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
connectionId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/sync',
headers: {'content-type': 'application/json'},
data: {connectionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/connections/sync';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"connectionId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/connections/sync"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/connections/sync" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"connectionId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/connections/sync",
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([
'connectionId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/connections/sync', [
'body' => '{
"connectionId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/connections/sync');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'connectionId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'connectionId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/connections/sync');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/connections/sync' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/connections/sync' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"connectionId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/connections/sync", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/connections/sync"
payload = { "connectionId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/connections/sync"
payload <- "{\n \"connectionId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/connections/sync")
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 \"connectionId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/connections/sync') do |req|
req.body = "{\n \"connectionId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/connections/sync";
let payload = json!({"connectionId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/connections/sync \
--header 'content-type: application/json' \
--data '{
"connectionId": ""
}'
echo '{
"connectionId": ""
}' | \
http POST {{baseUrl}}/v1/connections/sync \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "connectionId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/connections/sync
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["connectionId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/connections/sync")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Update a connection
{{baseUrl}}/v1/connections/update
BODY json
{
"breakingChange": false,
"connectionId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operationIds": [],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"sourceCatalogId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/connections/update");
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 \"breakingChange\": false,\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/connections/update" {:content-type :json
:form-params {:breakingChange false
:connectionId ""
:geography ""
:name ""
:namespaceDefinition ""
:namespaceFormat ""
:nonBreakingChangesPreference ""
:notifySchemaChanges false
:operationIds []
:prefix ""
:resourceRequirements {:cpu_limit ""
:cpu_request ""
:memory_limit ""
:memory_request ""}
:schedule {:timeUnit ""
:units 0}
:scheduleData {:basicSchedule {:timeUnit ""
:units 0}
:cron {:cronExpression ""
:cronTimeZone ""}}
:scheduleType ""
:sourceCatalogId ""
:status ""
:syncCatalog {:streams [{:config {:aliasName ""
:cursorField []
:destinationSyncMode ""
:fieldSelectionEnabled false
:primaryKey []
:selected false
:selectedFields [{:fieldPath []}]
:suggested false
:syncMode ""}
:stream {:defaultCursorField []
:jsonSchema {}
:name ""
:namespace ""
:sourceDefinedCursor false
:sourceDefinedPrimaryKey []
:supportedSyncModes []}}]}}})
require "http/client"
url = "{{baseUrl}}/v1/connections/update"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"breakingChange\": false,\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/connections/update"),
Content = new StringContent("{\n \"breakingChange\": false,\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/connections/update");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"breakingChange\": false,\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/connections/update"
payload := strings.NewReader("{\n \"breakingChange\": false,\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/connections/update HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1359
{
"breakingChange": false,
"connectionId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operationIds": [],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"sourceCatalogId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/connections/update")
.setHeader("content-type", "application/json")
.setBody("{\n \"breakingChange\": false,\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/connections/update"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"breakingChange\": false,\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"breakingChange\": false,\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/connections/update")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/connections/update")
.header("content-type", "application/json")
.body("{\n \"breakingChange\": false,\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}")
.asString();
const data = JSON.stringify({
breakingChange: false,
connectionId: '',
geography: '',
name: '',
namespaceDefinition: '',
namespaceFormat: '',
nonBreakingChangesPreference: '',
notifySchemaChanges: false,
operationIds: [],
prefix: '',
resourceRequirements: {
cpu_limit: '',
cpu_request: '',
memory_limit: '',
memory_request: ''
},
schedule: {
timeUnit: '',
units: 0
},
scheduleData: {
basicSchedule: {
timeUnit: '',
units: 0
},
cron: {
cronExpression: '',
cronTimeZone: ''
}
},
scheduleType: '',
sourceCatalogId: '',
status: '',
syncCatalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [
{
fieldPath: []
}
],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/connections/update');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/update',
headers: {'content-type': 'application/json'},
data: {
breakingChange: false,
connectionId: '',
geography: '',
name: '',
namespaceDefinition: '',
namespaceFormat: '',
nonBreakingChangesPreference: '',
notifySchemaChanges: false,
operationIds: [],
prefix: '',
resourceRequirements: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
schedule: {timeUnit: '', units: 0},
scheduleData: {
basicSchedule: {timeUnit: '', units: 0},
cron: {cronExpression: '', cronTimeZone: ''}
},
scheduleType: '',
sourceCatalogId: '',
status: '',
syncCatalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [{fieldPath: []}],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/connections/update';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"breakingChange":false,"connectionId":"","geography":"","name":"","namespaceDefinition":"","namespaceFormat":"","nonBreakingChangesPreference":"","notifySchemaChanges":false,"operationIds":[],"prefix":"","resourceRequirements":{"cpu_limit":"","cpu_request":"","memory_limit":"","memory_request":""},"schedule":{"timeUnit":"","units":0},"scheduleData":{"basicSchedule":{"timeUnit":"","units":0},"cron":{"cronExpression":"","cronTimeZone":""}},"scheduleType":"","sourceCatalogId":"","status":"","syncCatalog":{"streams":[{"config":{"aliasName":"","cursorField":[],"destinationSyncMode":"","fieldSelectionEnabled":false,"primaryKey":[],"selected":false,"selectedFields":[{"fieldPath":[]}],"suggested":false,"syncMode":""},"stream":{"defaultCursorField":[],"jsonSchema":{},"name":"","namespace":"","sourceDefinedCursor":false,"sourceDefinedPrimaryKey":[],"supportedSyncModes":[]}}]}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/connections/update',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "breakingChange": false,\n "connectionId": "",\n "geography": "",\n "name": "",\n "namespaceDefinition": "",\n "namespaceFormat": "",\n "nonBreakingChangesPreference": "",\n "notifySchemaChanges": false,\n "operationIds": [],\n "prefix": "",\n "resourceRequirements": {\n "cpu_limit": "",\n "cpu_request": "",\n "memory_limit": "",\n "memory_request": ""\n },\n "schedule": {\n "timeUnit": "",\n "units": 0\n },\n "scheduleData": {\n "basicSchedule": {\n "timeUnit": "",\n "units": 0\n },\n "cron": {\n "cronExpression": "",\n "cronTimeZone": ""\n }\n },\n "scheduleType": "",\n "sourceCatalogId": "",\n "status": "",\n "syncCatalog": {\n "streams": [\n {\n "config": {\n "aliasName": "",\n "cursorField": [],\n "destinationSyncMode": "",\n "fieldSelectionEnabled": false,\n "primaryKey": [],\n "selected": false,\n "selectedFields": [\n {\n "fieldPath": []\n }\n ],\n "suggested": false,\n "syncMode": ""\n },\n "stream": {\n "defaultCursorField": [],\n "jsonSchema": {},\n "name": "",\n "namespace": "",\n "sourceDefinedCursor": false,\n "sourceDefinedPrimaryKey": [],\n "supportedSyncModes": []\n }\n }\n ]\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"breakingChange\": false,\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/connections/update")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/connections/update',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
breakingChange: false,
connectionId: '',
geography: '',
name: '',
namespaceDefinition: '',
namespaceFormat: '',
nonBreakingChangesPreference: '',
notifySchemaChanges: false,
operationIds: [],
prefix: '',
resourceRequirements: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
schedule: {timeUnit: '', units: 0},
scheduleData: {
basicSchedule: {timeUnit: '', units: 0},
cron: {cronExpression: '', cronTimeZone: ''}
},
scheduleType: '',
sourceCatalogId: '',
status: '',
syncCatalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [{fieldPath: []}],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/update',
headers: {'content-type': 'application/json'},
body: {
breakingChange: false,
connectionId: '',
geography: '',
name: '',
namespaceDefinition: '',
namespaceFormat: '',
nonBreakingChangesPreference: '',
notifySchemaChanges: false,
operationIds: [],
prefix: '',
resourceRequirements: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
schedule: {timeUnit: '', units: 0},
scheduleData: {
basicSchedule: {timeUnit: '', units: 0},
cron: {cronExpression: '', cronTimeZone: ''}
},
scheduleType: '',
sourceCatalogId: '',
status: '',
syncCatalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [{fieldPath: []}],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/connections/update');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
breakingChange: false,
connectionId: '',
geography: '',
name: '',
namespaceDefinition: '',
namespaceFormat: '',
nonBreakingChangesPreference: '',
notifySchemaChanges: false,
operationIds: [],
prefix: '',
resourceRequirements: {
cpu_limit: '',
cpu_request: '',
memory_limit: '',
memory_request: ''
},
schedule: {
timeUnit: '',
units: 0
},
scheduleData: {
basicSchedule: {
timeUnit: '',
units: 0
},
cron: {
cronExpression: '',
cronTimeZone: ''
}
},
scheduleType: '',
sourceCatalogId: '',
status: '',
syncCatalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [
{
fieldPath: []
}
],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/connections/update',
headers: {'content-type': 'application/json'},
data: {
breakingChange: false,
connectionId: '',
geography: '',
name: '',
namespaceDefinition: '',
namespaceFormat: '',
nonBreakingChangesPreference: '',
notifySchemaChanges: false,
operationIds: [],
prefix: '',
resourceRequirements: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
schedule: {timeUnit: '', units: 0},
scheduleData: {
basicSchedule: {timeUnit: '', units: 0},
cron: {cronExpression: '', cronTimeZone: ''}
},
scheduleType: '',
sourceCatalogId: '',
status: '',
syncCatalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [{fieldPath: []}],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/connections/update';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"breakingChange":false,"connectionId":"","geography":"","name":"","namespaceDefinition":"","namespaceFormat":"","nonBreakingChangesPreference":"","notifySchemaChanges":false,"operationIds":[],"prefix":"","resourceRequirements":{"cpu_limit":"","cpu_request":"","memory_limit":"","memory_request":""},"schedule":{"timeUnit":"","units":0},"scheduleData":{"basicSchedule":{"timeUnit":"","units":0},"cron":{"cronExpression":"","cronTimeZone":""}},"scheduleType":"","sourceCatalogId":"","status":"","syncCatalog":{"streams":[{"config":{"aliasName":"","cursorField":[],"destinationSyncMode":"","fieldSelectionEnabled":false,"primaryKey":[],"selected":false,"selectedFields":[{"fieldPath":[]}],"suggested":false,"syncMode":""},"stream":{"defaultCursorField":[],"jsonSchema":{},"name":"","namespace":"","sourceDefinedCursor":false,"sourceDefinedPrimaryKey":[],"supportedSyncModes":[]}}]}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"breakingChange": @NO,
@"connectionId": @"",
@"geography": @"",
@"name": @"",
@"namespaceDefinition": @"",
@"namespaceFormat": @"",
@"nonBreakingChangesPreference": @"",
@"notifySchemaChanges": @NO,
@"operationIds": @[ ],
@"prefix": @"",
@"resourceRequirements": @{ @"cpu_limit": @"", @"cpu_request": @"", @"memory_limit": @"", @"memory_request": @"" },
@"schedule": @{ @"timeUnit": @"", @"units": @0 },
@"scheduleData": @{ @"basicSchedule": @{ @"timeUnit": @"", @"units": @0 }, @"cron": @{ @"cronExpression": @"", @"cronTimeZone": @"" } },
@"scheduleType": @"",
@"sourceCatalogId": @"",
@"status": @"",
@"syncCatalog": @{ @"streams": @[ @{ @"config": @{ @"aliasName": @"", @"cursorField": @[ ], @"destinationSyncMode": @"", @"fieldSelectionEnabled": @NO, @"primaryKey": @[ ], @"selected": @NO, @"selectedFields": @[ @{ @"fieldPath": @[ ] } ], @"suggested": @NO, @"syncMode": @"" }, @"stream": @{ @"defaultCursorField": @[ ], @"jsonSchema": @{ }, @"name": @"", @"namespace": @"", @"sourceDefinedCursor": @NO, @"sourceDefinedPrimaryKey": @[ ], @"supportedSyncModes": @[ ] } } ] } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/connections/update"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/connections/update" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"breakingChange\": false,\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/connections/update",
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([
'breakingChange' => null,
'connectionId' => '',
'geography' => '',
'name' => '',
'namespaceDefinition' => '',
'namespaceFormat' => '',
'nonBreakingChangesPreference' => '',
'notifySchemaChanges' => null,
'operationIds' => [
],
'prefix' => '',
'resourceRequirements' => [
'cpu_limit' => '',
'cpu_request' => '',
'memory_limit' => '',
'memory_request' => ''
],
'schedule' => [
'timeUnit' => '',
'units' => 0
],
'scheduleData' => [
'basicSchedule' => [
'timeUnit' => '',
'units' => 0
],
'cron' => [
'cronExpression' => '',
'cronTimeZone' => ''
]
],
'scheduleType' => '',
'sourceCatalogId' => '',
'status' => '',
'syncCatalog' => [
'streams' => [
[
'config' => [
'aliasName' => '',
'cursorField' => [
],
'destinationSyncMode' => '',
'fieldSelectionEnabled' => null,
'primaryKey' => [
],
'selected' => null,
'selectedFields' => [
[
'fieldPath' => [
]
]
],
'suggested' => null,
'syncMode' => ''
],
'stream' => [
'defaultCursorField' => [
],
'jsonSchema' => [
],
'name' => '',
'namespace' => '',
'sourceDefinedCursor' => null,
'sourceDefinedPrimaryKey' => [
],
'supportedSyncModes' => [
]
]
]
]
]
]),
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;
}
request('POST', '{{baseUrl}}/v1/connections/update', [
'body' => '{
"breakingChange": false,
"connectionId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operationIds": [],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"sourceCatalogId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/connections/update');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'breakingChange' => null,
'connectionId' => '',
'geography' => '',
'name' => '',
'namespaceDefinition' => '',
'namespaceFormat' => '',
'nonBreakingChangesPreference' => '',
'notifySchemaChanges' => null,
'operationIds' => [
],
'prefix' => '',
'resourceRequirements' => [
'cpu_limit' => '',
'cpu_request' => '',
'memory_limit' => '',
'memory_request' => ''
],
'schedule' => [
'timeUnit' => '',
'units' => 0
],
'scheduleData' => [
'basicSchedule' => [
'timeUnit' => '',
'units' => 0
],
'cron' => [
'cronExpression' => '',
'cronTimeZone' => ''
]
],
'scheduleType' => '',
'sourceCatalogId' => '',
'status' => '',
'syncCatalog' => [
'streams' => [
[
'config' => [
'aliasName' => '',
'cursorField' => [
],
'destinationSyncMode' => '',
'fieldSelectionEnabled' => null,
'primaryKey' => [
],
'selected' => null,
'selectedFields' => [
[
'fieldPath' => [
]
]
],
'suggested' => null,
'syncMode' => ''
],
'stream' => [
'defaultCursorField' => [
],
'jsonSchema' => [
],
'name' => '',
'namespace' => '',
'sourceDefinedCursor' => null,
'sourceDefinedPrimaryKey' => [
],
'supportedSyncModes' => [
]
]
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'breakingChange' => null,
'connectionId' => '',
'geography' => '',
'name' => '',
'namespaceDefinition' => '',
'namespaceFormat' => '',
'nonBreakingChangesPreference' => '',
'notifySchemaChanges' => null,
'operationIds' => [
],
'prefix' => '',
'resourceRequirements' => [
'cpu_limit' => '',
'cpu_request' => '',
'memory_limit' => '',
'memory_request' => ''
],
'schedule' => [
'timeUnit' => '',
'units' => 0
],
'scheduleData' => [
'basicSchedule' => [
'timeUnit' => '',
'units' => 0
],
'cron' => [
'cronExpression' => '',
'cronTimeZone' => ''
]
],
'scheduleType' => '',
'sourceCatalogId' => '',
'status' => '',
'syncCatalog' => [
'streams' => [
[
'config' => [
'aliasName' => '',
'cursorField' => [
],
'destinationSyncMode' => '',
'fieldSelectionEnabled' => null,
'primaryKey' => [
],
'selected' => null,
'selectedFields' => [
[
'fieldPath' => [
]
]
],
'suggested' => null,
'syncMode' => ''
],
'stream' => [
'defaultCursorField' => [
],
'jsonSchema' => [
],
'name' => '',
'namespace' => '',
'sourceDefinedCursor' => null,
'sourceDefinedPrimaryKey' => [
],
'supportedSyncModes' => [
]
]
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/connections/update');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/connections/update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"breakingChange": false,
"connectionId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operationIds": [],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"sourceCatalogId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/connections/update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"breakingChange": false,
"connectionId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operationIds": [],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"sourceCatalogId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"breakingChange\": false,\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/connections/update", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/connections/update"
payload = {
"breakingChange": False,
"connectionId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": False,
"operationIds": [],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"sourceCatalogId": "",
"status": "",
"syncCatalog": { "streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": False,
"primaryKey": [],
"selected": False,
"selectedFields": [{ "fieldPath": [] }],
"suggested": False,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": False,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
] }
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/connections/update"
payload <- "{\n \"breakingChange\": false,\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/connections/update")
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 \"breakingChange\": false,\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/connections/update') do |req|
req.body = "{\n \"breakingChange\": false,\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operationIds\": [],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/connections/update";
let payload = json!({
"breakingChange": false,
"connectionId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operationIds": (),
"prefix": "",
"resourceRequirements": json!({
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
}),
"schedule": json!({
"timeUnit": "",
"units": 0
}),
"scheduleData": json!({
"basicSchedule": json!({
"timeUnit": "",
"units": 0
}),
"cron": json!({
"cronExpression": "",
"cronTimeZone": ""
})
}),
"scheduleType": "",
"sourceCatalogId": "",
"status": "",
"syncCatalog": json!({"streams": (
json!({
"config": json!({
"aliasName": "",
"cursorField": (),
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": (),
"selected": false,
"selectedFields": (json!({"fieldPath": ()})),
"suggested": false,
"syncMode": ""
}),
"stream": json!({
"defaultCursorField": (),
"jsonSchema": json!({}),
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": (),
"supportedSyncModes": ()
})
})
)})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/connections/update \
--header 'content-type: application/json' \
--data '{
"breakingChange": false,
"connectionId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operationIds": [],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"sourceCatalogId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}'
echo '{
"breakingChange": false,
"connectionId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operationIds": [],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"sourceCatalogId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}' | \
http POST {{baseUrl}}/v1/connections/update \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "breakingChange": false,\n "connectionId": "",\n "geography": "",\n "name": "",\n "namespaceDefinition": "",\n "namespaceFormat": "",\n "nonBreakingChangesPreference": "",\n "notifySchemaChanges": false,\n "operationIds": [],\n "prefix": "",\n "resourceRequirements": {\n "cpu_limit": "",\n "cpu_request": "",\n "memory_limit": "",\n "memory_request": ""\n },\n "schedule": {\n "timeUnit": "",\n "units": 0\n },\n "scheduleData": {\n "basicSchedule": {\n "timeUnit": "",\n "units": 0\n },\n "cron": {\n "cronExpression": "",\n "cronTimeZone": ""\n }\n },\n "scheduleType": "",\n "sourceCatalogId": "",\n "status": "",\n "syncCatalog": {\n "streams": [\n {\n "config": {\n "aliasName": "",\n "cursorField": [],\n "destinationSyncMode": "",\n "fieldSelectionEnabled": false,\n "primaryKey": [],\n "selected": false,\n "selectedFields": [\n {\n "fieldPath": []\n }\n ],\n "suggested": false,\n "syncMode": ""\n },\n "stream": {\n "defaultCursorField": [],\n "jsonSchema": {},\n "name": "",\n "namespace": "",\n "sourceDefinedCursor": false,\n "sourceDefinedPrimaryKey": [],\n "supportedSyncModes": []\n }\n }\n ]\n }\n}' \
--output-document \
- {{baseUrl}}/v1/connections/update
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"breakingChange": false,
"connectionId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operationIds": [],
"prefix": "",
"resourceRequirements": [
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
],
"schedule": [
"timeUnit": "",
"units": 0
],
"scheduleData": [
"basicSchedule": [
"timeUnit": "",
"units": 0
],
"cron": [
"cronExpression": "",
"cronTimeZone": ""
]
],
"scheduleType": "",
"sourceCatalogId": "",
"status": "",
"syncCatalog": ["streams": [
[
"config": [
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [["fieldPath": []]],
"suggested": false,
"syncMode": ""
],
"stream": [
"defaultCursorField": [],
"jsonSchema": [],
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
]
]
]]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/connections/update")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"namespaceFormat": "${SOURCE_NAMESPACE}"
}
POST
Check connection for a proposed update to a destination
{{baseUrl}}/v1/destinations/check_connection_for_update
BODY json
{
"connectionConfiguration": "",
"destinationId": "",
"name": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/destinations/check_connection_for_update");
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 \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/destinations/check_connection_for_update" {:content-type :json
:form-params {:connectionConfiguration {:user "charles"}}})
require "http/client"
url = "{{baseUrl}}/v1/destinations/check_connection_for_update"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/destinations/check_connection_for_update"),
Content = new StringContent("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/destinations/check_connection_for_update");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/destinations/check_connection_for_update"
payload := strings.NewReader("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/destinations/check_connection_for_update HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 60
{
"connectionConfiguration": {
"user": "charles"
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/destinations/check_connection_for_update")
.setHeader("content-type", "application/json")
.setBody("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/destinations/check_connection_for_update"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/destinations/check_connection_for_update")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/destinations/check_connection_for_update")
.header("content-type", "application/json")
.body("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
.asString();
const data = JSON.stringify({
connectionConfiguration: {
user: 'charles'
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/destinations/check_connection_for_update');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/check_connection_for_update',
headers: {'content-type': 'application/json'},
data: {connectionConfiguration: {user: 'charles'}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/destinations/check_connection_for_update';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionConfiguration":{"user":"charles"}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/destinations/check_connection_for_update',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "connectionConfiguration": {\n "user": "charles"\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/destinations/check_connection_for_update")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/destinations/check_connection_for_update',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({connectionConfiguration: {user: 'charles'}}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/check_connection_for_update',
headers: {'content-type': 'application/json'},
body: {connectionConfiguration: {user: 'charles'}},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/destinations/check_connection_for_update');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
connectionConfiguration: {
user: 'charles'
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/check_connection_for_update',
headers: {'content-type': 'application/json'},
data: {connectionConfiguration: {user: 'charles'}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/destinations/check_connection_for_update';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionConfiguration":{"user":"charles"}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"connectionConfiguration": @{ @"user": @"charles" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/destinations/check_connection_for_update"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/destinations/check_connection_for_update" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/destinations/check_connection_for_update",
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([
'connectionConfiguration' => [
'user' => 'charles'
]
]),
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;
}
request('POST', '{{baseUrl}}/v1/destinations/check_connection_for_update', [
'body' => '{
"connectionConfiguration": {
"user": "charles"
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/destinations/check_connection_for_update');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'connectionConfiguration' => [
'user' => 'charles'
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'connectionConfiguration' => [
'user' => 'charles'
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/destinations/check_connection_for_update');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/destinations/check_connection_for_update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionConfiguration": {
"user": "charles"
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/destinations/check_connection_for_update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionConfiguration": {
"user": "charles"
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/destinations/check_connection_for_update", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/destinations/check_connection_for_update"
payload = { "connectionConfiguration": { "user": "charles" } }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/destinations/check_connection_for_update"
payload <- "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/destinations/check_connection_for_update")
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 \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/destinations/check_connection_for_update') do |req|
req.body = "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/destinations/check_connection_for_update";
let payload = json!({"connectionConfiguration": json!({"user": "charles"})});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/destinations/check_connection_for_update \
--header 'content-type: application/json' \
--data '{
"connectionConfiguration": {
"user": "charles"
}
}'
echo '{
"connectionConfiguration": {
"user": "charles"
}
}' | \
http POST {{baseUrl}}/v1/destinations/check_connection_for_update \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "connectionConfiguration": {\n "user": "charles"\n }\n}' \
--output-document \
- {{baseUrl}}/v1/destinations/check_connection_for_update
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["connectionConfiguration": ["user": "charles"]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/destinations/check_connection_for_update")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Check connection to the destination
{{baseUrl}}/v1/destinations/check_connection
BODY json
{
"destinationId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/destinations/check_connection");
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 \"destinationId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/destinations/check_connection" {:content-type :json
:form-params {:destinationId ""}})
require "http/client"
url = "{{baseUrl}}/v1/destinations/check_connection"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"destinationId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/destinations/check_connection"),
Content = new StringContent("{\n \"destinationId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/destinations/check_connection");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"destinationId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/destinations/check_connection"
payload := strings.NewReader("{\n \"destinationId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/destinations/check_connection HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 25
{
"destinationId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/destinations/check_connection")
.setHeader("content-type", "application/json")
.setBody("{\n \"destinationId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/destinations/check_connection"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"destinationId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"destinationId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/destinations/check_connection")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/destinations/check_connection")
.header("content-type", "application/json")
.body("{\n \"destinationId\": \"\"\n}")
.asString();
const data = JSON.stringify({
destinationId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/destinations/check_connection');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/check_connection',
headers: {'content-type': 'application/json'},
data: {destinationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/destinations/check_connection';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/destinations/check_connection',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "destinationId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"destinationId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/destinations/check_connection")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/destinations/check_connection',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({destinationId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/check_connection',
headers: {'content-type': 'application/json'},
body: {destinationId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/destinations/check_connection');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
destinationId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/check_connection',
headers: {'content-type': 'application/json'},
data: {destinationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/destinations/check_connection';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"destinationId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/destinations/check_connection"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/destinations/check_connection" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"destinationId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/destinations/check_connection",
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([
'destinationId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/destinations/check_connection', [
'body' => '{
"destinationId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/destinations/check_connection');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'destinationId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'destinationId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/destinations/check_connection');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/destinations/check_connection' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/destinations/check_connection' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"destinationId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/destinations/check_connection", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/destinations/check_connection"
payload = { "destinationId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/destinations/check_connection"
payload <- "{\n \"destinationId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/destinations/check_connection")
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 \"destinationId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/destinations/check_connection') do |req|
req.body = "{\n \"destinationId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/destinations/check_connection";
let payload = json!({"destinationId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/destinations/check_connection \
--header 'content-type: application/json' \
--data '{
"destinationId": ""
}'
echo '{
"destinationId": ""
}' | \
http POST {{baseUrl}}/v1/destinations/check_connection \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "destinationId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/destinations/check_connection
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["destinationId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/destinations/check_connection")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Clone destination
{{baseUrl}}/v1/destinations/clone
BODY json
{
"destinationCloneId": "",
"destinationConfiguration": {
"connectionConfiguration": "",
"name": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/destinations/clone");
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 \"destinationCloneId\": \"\",\n \"destinationConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/destinations/clone" {:content-type :json
:form-params {:destinationCloneId ""
:destinationConfiguration {:connectionConfiguration ""
:name ""}}})
require "http/client"
url = "{{baseUrl}}/v1/destinations/clone"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"destinationCloneId\": \"\",\n \"destinationConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/destinations/clone"),
Content = new StringContent("{\n \"destinationCloneId\": \"\",\n \"destinationConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/destinations/clone");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"destinationCloneId\": \"\",\n \"destinationConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/destinations/clone"
payload := strings.NewReader("{\n \"destinationCloneId\": \"\",\n \"destinationConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/destinations/clone HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 117
{
"destinationCloneId": "",
"destinationConfiguration": {
"connectionConfiguration": "",
"name": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/destinations/clone")
.setHeader("content-type", "application/json")
.setBody("{\n \"destinationCloneId\": \"\",\n \"destinationConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/destinations/clone"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"destinationCloneId\": \"\",\n \"destinationConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"destinationCloneId\": \"\",\n \"destinationConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/destinations/clone")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/destinations/clone")
.header("content-type", "application/json")
.body("{\n \"destinationCloneId\": \"\",\n \"destinationConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
destinationCloneId: '',
destinationConfiguration: {
connectionConfiguration: '',
name: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/destinations/clone');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/clone',
headers: {'content-type': 'application/json'},
data: {
destinationCloneId: '',
destinationConfiguration: {connectionConfiguration: '', name: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/destinations/clone';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationCloneId":"","destinationConfiguration":{"connectionConfiguration":"","name":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/destinations/clone',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "destinationCloneId": "",\n "destinationConfiguration": {\n "connectionConfiguration": "",\n "name": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"destinationCloneId\": \"\",\n \"destinationConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/destinations/clone")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/destinations/clone',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
destinationCloneId: '',
destinationConfiguration: {connectionConfiguration: '', name: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/clone',
headers: {'content-type': 'application/json'},
body: {
destinationCloneId: '',
destinationConfiguration: {connectionConfiguration: '', name: ''}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/destinations/clone');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
destinationCloneId: '',
destinationConfiguration: {
connectionConfiguration: '',
name: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/clone',
headers: {'content-type': 'application/json'},
data: {
destinationCloneId: '',
destinationConfiguration: {connectionConfiguration: '', name: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/destinations/clone';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationCloneId":"","destinationConfiguration":{"connectionConfiguration":"","name":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"destinationCloneId": @"",
@"destinationConfiguration": @{ @"connectionConfiguration": @"", @"name": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/destinations/clone"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/destinations/clone" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"destinationCloneId\": \"\",\n \"destinationConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/destinations/clone",
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([
'destinationCloneId' => '',
'destinationConfiguration' => [
'connectionConfiguration' => '',
'name' => ''
]
]),
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;
}
request('POST', '{{baseUrl}}/v1/destinations/clone', [
'body' => '{
"destinationCloneId": "",
"destinationConfiguration": {
"connectionConfiguration": "",
"name": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/destinations/clone');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'destinationCloneId' => '',
'destinationConfiguration' => [
'connectionConfiguration' => '',
'name' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'destinationCloneId' => '',
'destinationConfiguration' => [
'connectionConfiguration' => '',
'name' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/destinations/clone');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/destinations/clone' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationCloneId": "",
"destinationConfiguration": {
"connectionConfiguration": "",
"name": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/destinations/clone' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationCloneId": "",
"destinationConfiguration": {
"connectionConfiguration": "",
"name": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"destinationCloneId\": \"\",\n \"destinationConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/destinations/clone", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/destinations/clone"
payload = {
"destinationCloneId": "",
"destinationConfiguration": {
"connectionConfiguration": "",
"name": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/destinations/clone"
payload <- "{\n \"destinationCloneId\": \"\",\n \"destinationConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/destinations/clone")
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 \"destinationCloneId\": \"\",\n \"destinationConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/destinations/clone') do |req|
req.body = "{\n \"destinationCloneId\": \"\",\n \"destinationConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/destinations/clone";
let payload = json!({
"destinationCloneId": "",
"destinationConfiguration": json!({
"connectionConfiguration": "",
"name": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/destinations/clone \
--header 'content-type: application/json' \
--data '{
"destinationCloneId": "",
"destinationConfiguration": {
"connectionConfiguration": "",
"name": ""
}
}'
echo '{
"destinationCloneId": "",
"destinationConfiguration": {
"connectionConfiguration": "",
"name": ""
}
}' | \
http POST {{baseUrl}}/v1/destinations/clone \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "destinationCloneId": "",\n "destinationConfiguration": {\n "connectionConfiguration": "",\n "name": ""\n }\n}' \
--output-document \
- {{baseUrl}}/v1/destinations/clone
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"destinationCloneId": "",
"destinationConfiguration": [
"connectionConfiguration": "",
"name": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/destinations/clone")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"connectionConfiguration": {
"user": "charles"
}
}
POST
Create a destination
{{baseUrl}}/v1/destinations/create
BODY json
{
"connectionConfiguration": "",
"destinationDefinitionId": "",
"name": "",
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/destinations/create");
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 \"connectionConfiguration\": \"\",\n \"destinationDefinitionId\": \"\",\n \"name\": \"\",\n \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/destinations/create" {:content-type :json
:form-params {:connectionConfiguration ""
:destinationDefinitionId ""
:name ""
:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/destinations/create"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"connectionConfiguration\": \"\",\n \"destinationDefinitionId\": \"\",\n \"name\": \"\",\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/destinations/create"),
Content = new StringContent("{\n \"connectionConfiguration\": \"\",\n \"destinationDefinitionId\": \"\",\n \"name\": \"\",\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/destinations/create");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"connectionConfiguration\": \"\",\n \"destinationDefinitionId\": \"\",\n \"name\": \"\",\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/destinations/create"
payload := strings.NewReader("{\n \"connectionConfiguration\": \"\",\n \"destinationDefinitionId\": \"\",\n \"name\": \"\",\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/destinations/create HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 103
{
"connectionConfiguration": "",
"destinationDefinitionId": "",
"name": "",
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/destinations/create")
.setHeader("content-type", "application/json")
.setBody("{\n \"connectionConfiguration\": \"\",\n \"destinationDefinitionId\": \"\",\n \"name\": \"\",\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/destinations/create"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"connectionConfiguration\": \"\",\n \"destinationDefinitionId\": \"\",\n \"name\": \"\",\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"connectionConfiguration\": \"\",\n \"destinationDefinitionId\": \"\",\n \"name\": \"\",\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/destinations/create")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/destinations/create")
.header("content-type", "application/json")
.body("{\n \"connectionConfiguration\": \"\",\n \"destinationDefinitionId\": \"\",\n \"name\": \"\",\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
connectionConfiguration: '',
destinationDefinitionId: '',
name: '',
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/destinations/create');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/create',
headers: {'content-type': 'application/json'},
data: {
connectionConfiguration: '',
destinationDefinitionId: '',
name: '',
workspaceId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/destinations/create';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionConfiguration":"","destinationDefinitionId":"","name":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/destinations/create',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "connectionConfiguration": "",\n "destinationDefinitionId": "",\n "name": "",\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"connectionConfiguration\": \"\",\n \"destinationDefinitionId\": \"\",\n \"name\": \"\",\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/destinations/create")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/destinations/create',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
connectionConfiguration: '',
destinationDefinitionId: '',
name: '',
workspaceId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/create',
headers: {'content-type': 'application/json'},
body: {
connectionConfiguration: '',
destinationDefinitionId: '',
name: '',
workspaceId: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/destinations/create');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
connectionConfiguration: '',
destinationDefinitionId: '',
name: '',
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/create',
headers: {'content-type': 'application/json'},
data: {
connectionConfiguration: '',
destinationDefinitionId: '',
name: '',
workspaceId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/destinations/create';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionConfiguration":"","destinationDefinitionId":"","name":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"connectionConfiguration": @"",
@"destinationDefinitionId": @"",
@"name": @"",
@"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/destinations/create"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/destinations/create" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"connectionConfiguration\": \"\",\n \"destinationDefinitionId\": \"\",\n \"name\": \"\",\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/destinations/create",
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([
'connectionConfiguration' => '',
'destinationDefinitionId' => '',
'name' => '',
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/destinations/create', [
'body' => '{
"connectionConfiguration": "",
"destinationDefinitionId": "",
"name": "",
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/destinations/create');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'connectionConfiguration' => '',
'destinationDefinitionId' => '',
'name' => '',
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'connectionConfiguration' => '',
'destinationDefinitionId' => '',
'name' => '',
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/destinations/create');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/destinations/create' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionConfiguration": "",
"destinationDefinitionId": "",
"name": "",
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/destinations/create' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionConfiguration": "",
"destinationDefinitionId": "",
"name": "",
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"connectionConfiguration\": \"\",\n \"destinationDefinitionId\": \"\",\n \"name\": \"\",\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/destinations/create", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/destinations/create"
payload = {
"connectionConfiguration": "",
"destinationDefinitionId": "",
"name": "",
"workspaceId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/destinations/create"
payload <- "{\n \"connectionConfiguration\": \"\",\n \"destinationDefinitionId\": \"\",\n \"name\": \"\",\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/destinations/create")
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 \"connectionConfiguration\": \"\",\n \"destinationDefinitionId\": \"\",\n \"name\": \"\",\n \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/destinations/create') do |req|
req.body = "{\n \"connectionConfiguration\": \"\",\n \"destinationDefinitionId\": \"\",\n \"name\": \"\",\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/destinations/create";
let payload = json!({
"connectionConfiguration": "",
"destinationDefinitionId": "",
"name": "",
"workspaceId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/destinations/create \
--header 'content-type: application/json' \
--data '{
"connectionConfiguration": "",
"destinationDefinitionId": "",
"name": "",
"workspaceId": ""
}'
echo '{
"connectionConfiguration": "",
"destinationDefinitionId": "",
"name": "",
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/destinations/create \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "connectionConfiguration": "",\n "destinationDefinitionId": "",\n "name": "",\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/destinations/create
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"connectionConfiguration": "",
"destinationDefinitionId": "",
"name": "",
"workspaceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/destinations/create")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"connectionConfiguration": {
"user": "charles"
}
}
POST
Delete the destination
{{baseUrl}}/v1/destinations/delete
BODY json
{
"destinationId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/destinations/delete");
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 \"destinationId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/destinations/delete" {:content-type :json
:form-params {:destinationId ""}})
require "http/client"
url = "{{baseUrl}}/v1/destinations/delete"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"destinationId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/destinations/delete"),
Content = new StringContent("{\n \"destinationId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/destinations/delete");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"destinationId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/destinations/delete"
payload := strings.NewReader("{\n \"destinationId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/destinations/delete HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 25
{
"destinationId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/destinations/delete")
.setHeader("content-type", "application/json")
.setBody("{\n \"destinationId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/destinations/delete"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"destinationId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"destinationId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/destinations/delete")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/destinations/delete")
.header("content-type", "application/json")
.body("{\n \"destinationId\": \"\"\n}")
.asString();
const data = JSON.stringify({
destinationId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/destinations/delete');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/delete',
headers: {'content-type': 'application/json'},
data: {destinationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/destinations/delete';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/destinations/delete',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "destinationId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"destinationId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/destinations/delete")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/destinations/delete',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({destinationId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/delete',
headers: {'content-type': 'application/json'},
body: {destinationId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/destinations/delete');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
destinationId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/delete',
headers: {'content-type': 'application/json'},
data: {destinationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/destinations/delete';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"destinationId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/destinations/delete"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/destinations/delete" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"destinationId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/destinations/delete",
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([
'destinationId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/destinations/delete', [
'body' => '{
"destinationId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/destinations/delete');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'destinationId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'destinationId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/destinations/delete');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/destinations/delete' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/destinations/delete' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"destinationId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/destinations/delete", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/destinations/delete"
payload = { "destinationId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/destinations/delete"
payload <- "{\n \"destinationId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/destinations/delete")
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 \"destinationId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/destinations/delete') do |req|
req.body = "{\n \"destinationId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/destinations/delete";
let payload = json!({"destinationId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/destinations/delete \
--header 'content-type: application/json' \
--data '{
"destinationId": ""
}'
echo '{
"destinationId": ""
}' | \
http POST {{baseUrl}}/v1/destinations/delete \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "destinationId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/destinations/delete
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["destinationId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/destinations/delete")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Get configured destination
{{baseUrl}}/v1/destinations/get
BODY json
{
"destinationId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/destinations/get");
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 \"destinationId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/destinations/get" {:content-type :json
:form-params {:destinationId ""}})
require "http/client"
url = "{{baseUrl}}/v1/destinations/get"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"destinationId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/destinations/get"),
Content = new StringContent("{\n \"destinationId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/destinations/get");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"destinationId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/destinations/get"
payload := strings.NewReader("{\n \"destinationId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/destinations/get HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 25
{
"destinationId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/destinations/get")
.setHeader("content-type", "application/json")
.setBody("{\n \"destinationId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/destinations/get"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"destinationId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"destinationId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/destinations/get")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/destinations/get")
.header("content-type", "application/json")
.body("{\n \"destinationId\": \"\"\n}")
.asString();
const data = JSON.stringify({
destinationId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/destinations/get');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/get',
headers: {'content-type': 'application/json'},
data: {destinationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/destinations/get';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/destinations/get',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "destinationId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"destinationId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/destinations/get")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/destinations/get',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({destinationId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/get',
headers: {'content-type': 'application/json'},
body: {destinationId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/destinations/get');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
destinationId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/get',
headers: {'content-type': 'application/json'},
data: {destinationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/destinations/get';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"destinationId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/destinations/get"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/destinations/get" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"destinationId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/destinations/get",
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([
'destinationId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/destinations/get', [
'body' => '{
"destinationId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/destinations/get');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'destinationId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'destinationId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/destinations/get');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/destinations/get' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/destinations/get' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"destinationId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/destinations/get", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/destinations/get"
payload = { "destinationId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/destinations/get"
payload <- "{\n \"destinationId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/destinations/get")
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 \"destinationId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/destinations/get') do |req|
req.body = "{\n \"destinationId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/destinations/get";
let payload = json!({"destinationId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/destinations/get \
--header 'content-type: application/json' \
--data '{
"destinationId": ""
}'
echo '{
"destinationId": ""
}' | \
http POST {{baseUrl}}/v1/destinations/get \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "destinationId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/destinations/get
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["destinationId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/destinations/get")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"connectionConfiguration": {
"user": "charles"
}
}
POST
List configured destinations for a workspace
{{baseUrl}}/v1/destinations/list
BODY json
{
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/destinations/list");
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 \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/destinations/list" {:content-type :json
:form-params {:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/destinations/list"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/destinations/list"),
Content = new StringContent("{\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/destinations/list");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/destinations/list"
payload := strings.NewReader("{\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/destinations/list HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/destinations/list")
.setHeader("content-type", "application/json")
.setBody("{\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/destinations/list"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/destinations/list")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/destinations/list")
.header("content-type", "application/json")
.body("{\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/destinations/list');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/list',
headers: {'content-type': 'application/json'},
data: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/destinations/list';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/destinations/list',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/destinations/list")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/destinations/list',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({workspaceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/list',
headers: {'content-type': 'application/json'},
body: {workspaceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/destinations/list');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/list',
headers: {'content-type': 'application/json'},
data: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/destinations/list';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/destinations/list"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/destinations/list" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/destinations/list",
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([
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/destinations/list', [
'body' => '{
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/destinations/list');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/destinations/list');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/destinations/list' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/destinations/list' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/destinations/list", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/destinations/list"
payload = { "workspaceId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/destinations/list"
payload <- "{\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/destinations/list")
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 \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/destinations/list') do |req|
req.body = "{\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/destinations/list";
let payload = json!({"workspaceId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/destinations/list \
--header 'content-type: application/json' \
--data '{
"workspaceId": ""
}'
echo '{
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/destinations/list \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/destinations/list
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["workspaceId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/destinations/list")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Search destinations
{{baseUrl}}/v1/destinations/search
BODY json
{
"connectionConfiguration": "",
"destinationDefinitionId": "",
"destinationId": "",
"destinationName": "",
"name": "",
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/destinations/search");
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 \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/destinations/search" {:content-type :json
:form-params {:connectionConfiguration {:user "charles"}}})
require "http/client"
url = "{{baseUrl}}/v1/destinations/search"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/destinations/search"),
Content = new StringContent("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/destinations/search");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/destinations/search"
payload := strings.NewReader("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/destinations/search HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 60
{
"connectionConfiguration": {
"user": "charles"
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/destinations/search")
.setHeader("content-type", "application/json")
.setBody("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/destinations/search"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/destinations/search")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/destinations/search")
.header("content-type", "application/json")
.body("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
.asString();
const data = JSON.stringify({
connectionConfiguration: {
user: 'charles'
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/destinations/search');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/search',
headers: {'content-type': 'application/json'},
data: {connectionConfiguration: {user: 'charles'}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/destinations/search';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionConfiguration":{"user":"charles"}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/destinations/search',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "connectionConfiguration": {\n "user": "charles"\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/destinations/search")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/destinations/search',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({connectionConfiguration: {user: 'charles'}}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/search',
headers: {'content-type': 'application/json'},
body: {connectionConfiguration: {user: 'charles'}},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/destinations/search');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
connectionConfiguration: {
user: 'charles'
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/search',
headers: {'content-type': 'application/json'},
data: {connectionConfiguration: {user: 'charles'}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/destinations/search';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionConfiguration":{"user":"charles"}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"connectionConfiguration": @{ @"user": @"charles" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/destinations/search"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/destinations/search" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/destinations/search",
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([
'connectionConfiguration' => [
'user' => 'charles'
]
]),
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;
}
request('POST', '{{baseUrl}}/v1/destinations/search', [
'body' => '{
"connectionConfiguration": {
"user": "charles"
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/destinations/search');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'connectionConfiguration' => [
'user' => 'charles'
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'connectionConfiguration' => [
'user' => 'charles'
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/destinations/search');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/destinations/search' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionConfiguration": {
"user": "charles"
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/destinations/search' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionConfiguration": {
"user": "charles"
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/destinations/search", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/destinations/search"
payload = { "connectionConfiguration": { "user": "charles" } }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/destinations/search"
payload <- "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/destinations/search")
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 \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/destinations/search') do |req|
req.body = "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/destinations/search";
let payload = json!({"connectionConfiguration": json!({"user": "charles"})});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/destinations/search \
--header 'content-type: application/json' \
--data '{
"connectionConfiguration": {
"user": "charles"
}
}'
echo '{
"connectionConfiguration": {
"user": "charles"
}
}' | \
http POST {{baseUrl}}/v1/destinations/search \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "connectionConfiguration": {\n "user": "charles"\n }\n}' \
--output-document \
- {{baseUrl}}/v1/destinations/search
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["connectionConfiguration": ["user": "charles"]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/destinations/search")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Update a destination
{{baseUrl}}/v1/destinations/update
BODY json
{
"connectionConfiguration": "",
"destinationId": "",
"name": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/destinations/update");
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 \"connectionConfiguration\": \"\",\n \"destinationId\": \"\",\n \"name\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/destinations/update" {:content-type :json
:form-params {:connectionConfiguration ""
:destinationId ""
:name ""}})
require "http/client"
url = "{{baseUrl}}/v1/destinations/update"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"connectionConfiguration\": \"\",\n \"destinationId\": \"\",\n \"name\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/destinations/update"),
Content = new StringContent("{\n \"connectionConfiguration\": \"\",\n \"destinationId\": \"\",\n \"name\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/destinations/update");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"connectionConfiguration\": \"\",\n \"destinationId\": \"\",\n \"name\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/destinations/update"
payload := strings.NewReader("{\n \"connectionConfiguration\": \"\",\n \"destinationId\": \"\",\n \"name\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/destinations/update HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 72
{
"connectionConfiguration": "",
"destinationId": "",
"name": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/destinations/update")
.setHeader("content-type", "application/json")
.setBody("{\n \"connectionConfiguration\": \"\",\n \"destinationId\": \"\",\n \"name\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/destinations/update"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"connectionConfiguration\": \"\",\n \"destinationId\": \"\",\n \"name\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"connectionConfiguration\": \"\",\n \"destinationId\": \"\",\n \"name\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/destinations/update")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/destinations/update")
.header("content-type", "application/json")
.body("{\n \"connectionConfiguration\": \"\",\n \"destinationId\": \"\",\n \"name\": \"\"\n}")
.asString();
const data = JSON.stringify({
connectionConfiguration: '',
destinationId: '',
name: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/destinations/update');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/update',
headers: {'content-type': 'application/json'},
data: {connectionConfiguration: '', destinationId: '', name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/destinations/update';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionConfiguration":"","destinationId":"","name":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/destinations/update',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "connectionConfiguration": "",\n "destinationId": "",\n "name": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"connectionConfiguration\": \"\",\n \"destinationId\": \"\",\n \"name\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/destinations/update")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/destinations/update',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({connectionConfiguration: '', destinationId: '', name: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/update',
headers: {'content-type': 'application/json'},
body: {connectionConfiguration: '', destinationId: '', name: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/destinations/update');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
connectionConfiguration: '',
destinationId: '',
name: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destinations/update',
headers: {'content-type': 'application/json'},
data: {connectionConfiguration: '', destinationId: '', name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/destinations/update';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionConfiguration":"","destinationId":"","name":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"connectionConfiguration": @"",
@"destinationId": @"",
@"name": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/destinations/update"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/destinations/update" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"connectionConfiguration\": \"\",\n \"destinationId\": \"\",\n \"name\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/destinations/update",
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([
'connectionConfiguration' => '',
'destinationId' => '',
'name' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/destinations/update', [
'body' => '{
"connectionConfiguration": "",
"destinationId": "",
"name": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/destinations/update');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'connectionConfiguration' => '',
'destinationId' => '',
'name' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'connectionConfiguration' => '',
'destinationId' => '',
'name' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/destinations/update');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/destinations/update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionConfiguration": "",
"destinationId": "",
"name": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/destinations/update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionConfiguration": "",
"destinationId": "",
"name": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"connectionConfiguration\": \"\",\n \"destinationId\": \"\",\n \"name\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/destinations/update", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/destinations/update"
payload = {
"connectionConfiguration": "",
"destinationId": "",
"name": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/destinations/update"
payload <- "{\n \"connectionConfiguration\": \"\",\n \"destinationId\": \"\",\n \"name\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/destinations/update")
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 \"connectionConfiguration\": \"\",\n \"destinationId\": \"\",\n \"name\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/destinations/update') do |req|
req.body = "{\n \"connectionConfiguration\": \"\",\n \"destinationId\": \"\",\n \"name\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/destinations/update";
let payload = json!({
"connectionConfiguration": "",
"destinationId": "",
"name": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/destinations/update \
--header 'content-type: application/json' \
--data '{
"connectionConfiguration": "",
"destinationId": "",
"name": ""
}'
echo '{
"connectionConfiguration": "",
"destinationId": "",
"name": ""
}' | \
http POST {{baseUrl}}/v1/destinations/update \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "connectionConfiguration": "",\n "destinationId": "",\n "name": ""\n}' \
--output-document \
- {{baseUrl}}/v1/destinations/update
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"connectionConfiguration": "",
"destinationId": "",
"name": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/destinations/update")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"connectionConfiguration": {
"user": "charles"
}
}
POST
Creates a custom destinationDefinition for the given workspace
{{baseUrl}}/v1/destination_definitions/create_custom
BODY json
{
"destinationDefinition": {
"dockerImageTag": "",
"dockerRepository": "",
"documentationUrl": "",
"icon": "",
"name": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
}
},
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/destination_definitions/create_custom");
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 \"destinationDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/destination_definitions/create_custom" {:content-type :json
:form-params {:destinationDefinition {:dockerImageTag ""
:dockerRepository ""
:documentationUrl ""
:icon ""
:name ""
:resourceRequirements {:default {:cpu_limit ""
:cpu_request ""
:memory_limit ""
:memory_request ""}
:jobSpecific [{:jobType ""
:resourceRequirements {}}]}}
:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/destination_definitions/create_custom"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"destinationDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/destination_definitions/create_custom"),
Content = new StringContent("{\n \"destinationDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/destination_definitions/create_custom");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"destinationDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/destination_definitions/create_custom"
payload := strings.NewReader("{\n \"destinationDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/destination_definitions/create_custom HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 457
{
"destinationDefinition": {
"dockerImageTag": "",
"dockerRepository": "",
"documentationUrl": "",
"icon": "",
"name": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
}
},
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/destination_definitions/create_custom")
.setHeader("content-type", "application/json")
.setBody("{\n \"destinationDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/destination_definitions/create_custom"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"destinationDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"destinationDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/destination_definitions/create_custom")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/destination_definitions/create_custom")
.header("content-type", "application/json")
.body("{\n \"destinationDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
destinationDefinition: {
dockerImageTag: '',
dockerRepository: '',
documentationUrl: '',
icon: '',
name: '',
resourceRequirements: {
default: {
cpu_limit: '',
cpu_request: '',
memory_limit: '',
memory_request: ''
},
jobSpecific: [
{
jobType: '',
resourceRequirements: {}
}
]
}
},
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/destination_definitions/create_custom');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/create_custom',
headers: {'content-type': 'application/json'},
data: {
destinationDefinition: {
dockerImageTag: '',
dockerRepository: '',
documentationUrl: '',
icon: '',
name: '',
resourceRequirements: {
default: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
jobSpecific: [{jobType: '', resourceRequirements: {}}]
}
},
workspaceId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/destination_definitions/create_custom';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationDefinition":{"dockerImageTag":"","dockerRepository":"","documentationUrl":"","icon":"","name":"","resourceRequirements":{"default":{"cpu_limit":"","cpu_request":"","memory_limit":"","memory_request":""},"jobSpecific":[{"jobType":"","resourceRequirements":{}}]}},"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/destination_definitions/create_custom',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "destinationDefinition": {\n "dockerImageTag": "",\n "dockerRepository": "",\n "documentationUrl": "",\n "icon": "",\n "name": "",\n "resourceRequirements": {\n "default": {\n "cpu_limit": "",\n "cpu_request": "",\n "memory_limit": "",\n "memory_request": ""\n },\n "jobSpecific": [\n {\n "jobType": "",\n "resourceRequirements": {}\n }\n ]\n }\n },\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"destinationDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/destination_definitions/create_custom")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/destination_definitions/create_custom',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
destinationDefinition: {
dockerImageTag: '',
dockerRepository: '',
documentationUrl: '',
icon: '',
name: '',
resourceRequirements: {
default: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
jobSpecific: [{jobType: '', resourceRequirements: {}}]
}
},
workspaceId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/create_custom',
headers: {'content-type': 'application/json'},
body: {
destinationDefinition: {
dockerImageTag: '',
dockerRepository: '',
documentationUrl: '',
icon: '',
name: '',
resourceRequirements: {
default: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
jobSpecific: [{jobType: '', resourceRequirements: {}}]
}
},
workspaceId: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/destination_definitions/create_custom');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
destinationDefinition: {
dockerImageTag: '',
dockerRepository: '',
documentationUrl: '',
icon: '',
name: '',
resourceRequirements: {
default: {
cpu_limit: '',
cpu_request: '',
memory_limit: '',
memory_request: ''
},
jobSpecific: [
{
jobType: '',
resourceRequirements: {}
}
]
}
},
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/create_custom',
headers: {'content-type': 'application/json'},
data: {
destinationDefinition: {
dockerImageTag: '',
dockerRepository: '',
documentationUrl: '',
icon: '',
name: '',
resourceRequirements: {
default: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
jobSpecific: [{jobType: '', resourceRequirements: {}}]
}
},
workspaceId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/destination_definitions/create_custom';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationDefinition":{"dockerImageTag":"","dockerRepository":"","documentationUrl":"","icon":"","name":"","resourceRequirements":{"default":{"cpu_limit":"","cpu_request":"","memory_limit":"","memory_request":""},"jobSpecific":[{"jobType":"","resourceRequirements":{}}]}},"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"destinationDefinition": @{ @"dockerImageTag": @"", @"dockerRepository": @"", @"documentationUrl": @"", @"icon": @"", @"name": @"", @"resourceRequirements": @{ @"default": @{ @"cpu_limit": @"", @"cpu_request": @"", @"memory_limit": @"", @"memory_request": @"" }, @"jobSpecific": @[ @{ @"jobType": @"", @"resourceRequirements": @{ } } ] } },
@"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/destination_definitions/create_custom"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/destination_definitions/create_custom" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"destinationDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/destination_definitions/create_custom",
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([
'destinationDefinition' => [
'dockerImageTag' => '',
'dockerRepository' => '',
'documentationUrl' => '',
'icon' => '',
'name' => '',
'resourceRequirements' => [
'default' => [
'cpu_limit' => '',
'cpu_request' => '',
'memory_limit' => '',
'memory_request' => ''
],
'jobSpecific' => [
[
'jobType' => '',
'resourceRequirements' => [
]
]
]
]
],
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/destination_definitions/create_custom', [
'body' => '{
"destinationDefinition": {
"dockerImageTag": "",
"dockerRepository": "",
"documentationUrl": "",
"icon": "",
"name": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
}
},
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/destination_definitions/create_custom');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'destinationDefinition' => [
'dockerImageTag' => '',
'dockerRepository' => '',
'documentationUrl' => '',
'icon' => '',
'name' => '',
'resourceRequirements' => [
'default' => [
'cpu_limit' => '',
'cpu_request' => '',
'memory_limit' => '',
'memory_request' => ''
],
'jobSpecific' => [
[
'jobType' => '',
'resourceRequirements' => [
]
]
]
]
],
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'destinationDefinition' => [
'dockerImageTag' => '',
'dockerRepository' => '',
'documentationUrl' => '',
'icon' => '',
'name' => '',
'resourceRequirements' => [
'default' => [
'cpu_limit' => '',
'cpu_request' => '',
'memory_limit' => '',
'memory_request' => ''
],
'jobSpecific' => [
[
'jobType' => '',
'resourceRequirements' => [
]
]
]
]
],
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/destination_definitions/create_custom');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/destination_definitions/create_custom' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationDefinition": {
"dockerImageTag": "",
"dockerRepository": "",
"documentationUrl": "",
"icon": "",
"name": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
}
},
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/destination_definitions/create_custom' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationDefinition": {
"dockerImageTag": "",
"dockerRepository": "",
"documentationUrl": "",
"icon": "",
"name": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
}
},
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"destinationDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/destination_definitions/create_custom", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/destination_definitions/create_custom"
payload = {
"destinationDefinition": {
"dockerImageTag": "",
"dockerRepository": "",
"documentationUrl": "",
"icon": "",
"name": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
}
},
"workspaceId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/destination_definitions/create_custom"
payload <- "{\n \"destinationDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/destination_definitions/create_custom")
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 \"destinationDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/destination_definitions/create_custom') do |req|
req.body = "{\n \"destinationDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/destination_definitions/create_custom";
let payload = json!({
"destinationDefinition": json!({
"dockerImageTag": "",
"dockerRepository": "",
"documentationUrl": "",
"icon": "",
"name": "",
"resourceRequirements": json!({
"default": json!({
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
}),
"jobSpecific": (
json!({
"jobType": "",
"resourceRequirements": json!({})
})
)
})
}),
"workspaceId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/destination_definitions/create_custom \
--header 'content-type: application/json' \
--data '{
"destinationDefinition": {
"dockerImageTag": "",
"dockerRepository": "",
"documentationUrl": "",
"icon": "",
"name": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
}
},
"workspaceId": ""
}'
echo '{
"destinationDefinition": {
"dockerImageTag": "",
"dockerRepository": "",
"documentationUrl": "",
"icon": "",
"name": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
}
},
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/destination_definitions/create_custom \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "destinationDefinition": {\n "dockerImageTag": "",\n "dockerRepository": "",\n "documentationUrl": "",\n "icon": "",\n "name": "",\n "resourceRequirements": {\n "default": {\n "cpu_limit": "",\n "cpu_request": "",\n "memory_limit": "",\n "memory_request": ""\n },\n "jobSpecific": [\n {\n "jobType": "",\n "resourceRequirements": {}\n }\n ]\n }\n },\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/destination_definitions/create_custom
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"destinationDefinition": [
"dockerImageTag": "",
"dockerRepository": "",
"documentationUrl": "",
"icon": "",
"name": "",
"resourceRequirements": [
"default": [
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
],
"jobSpecific": [
[
"jobType": "",
"resourceRequirements": []
]
]
]
],
"workspaceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/destination_definitions/create_custom")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Delete a destination definition
{{baseUrl}}/v1/destination_definitions/delete
BODY json
{
"destinationDefinitionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/destination_definitions/delete");
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 \"destinationDefinitionId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/destination_definitions/delete" {:content-type :json
:form-params {:destinationDefinitionId ""}})
require "http/client"
url = "{{baseUrl}}/v1/destination_definitions/delete"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"destinationDefinitionId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/destination_definitions/delete"),
Content = new StringContent("{\n \"destinationDefinitionId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/destination_definitions/delete");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"destinationDefinitionId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/destination_definitions/delete"
payload := strings.NewReader("{\n \"destinationDefinitionId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/destination_definitions/delete HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 35
{
"destinationDefinitionId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/destination_definitions/delete")
.setHeader("content-type", "application/json")
.setBody("{\n \"destinationDefinitionId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/destination_definitions/delete"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"destinationDefinitionId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"destinationDefinitionId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/destination_definitions/delete")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/destination_definitions/delete")
.header("content-type", "application/json")
.body("{\n \"destinationDefinitionId\": \"\"\n}")
.asString();
const data = JSON.stringify({
destinationDefinitionId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/destination_definitions/delete');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/delete',
headers: {'content-type': 'application/json'},
data: {destinationDefinitionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/destination_definitions/delete';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationDefinitionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/destination_definitions/delete',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "destinationDefinitionId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"destinationDefinitionId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/destination_definitions/delete")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/destination_definitions/delete',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({destinationDefinitionId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/delete',
headers: {'content-type': 'application/json'},
body: {destinationDefinitionId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/destination_definitions/delete');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
destinationDefinitionId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/delete',
headers: {'content-type': 'application/json'},
data: {destinationDefinitionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/destination_definitions/delete';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationDefinitionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"destinationDefinitionId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/destination_definitions/delete"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/destination_definitions/delete" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"destinationDefinitionId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/destination_definitions/delete",
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([
'destinationDefinitionId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/destination_definitions/delete', [
'body' => '{
"destinationDefinitionId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/destination_definitions/delete');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'destinationDefinitionId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'destinationDefinitionId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/destination_definitions/delete');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/destination_definitions/delete' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationDefinitionId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/destination_definitions/delete' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationDefinitionId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"destinationDefinitionId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/destination_definitions/delete", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/destination_definitions/delete"
payload = { "destinationDefinitionId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/destination_definitions/delete"
payload <- "{\n \"destinationDefinitionId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/destination_definitions/delete")
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 \"destinationDefinitionId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/destination_definitions/delete') do |req|
req.body = "{\n \"destinationDefinitionId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/destination_definitions/delete";
let payload = json!({"destinationDefinitionId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/destination_definitions/delete \
--header 'content-type: application/json' \
--data '{
"destinationDefinitionId": ""
}'
echo '{
"destinationDefinitionId": ""
}' | \
http POST {{baseUrl}}/v1/destination_definitions/delete \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "destinationDefinitionId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/destination_definitions/delete
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["destinationDefinitionId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/destination_definitions/delete")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Get a destinationDefinition that is configured for the given workspace
{{baseUrl}}/v1/destination_definitions/get_for_workspace
BODY json
{
"destinationDefinitionId": "",
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/destination_definitions/get_for_workspace");
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 \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/destination_definitions/get_for_workspace" {:content-type :json
:form-params {:destinationDefinitionId ""
:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/destination_definitions/get_for_workspace"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/destination_definitions/get_for_workspace"),
Content = new StringContent("{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/destination_definitions/get_for_workspace");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/destination_definitions/get_for_workspace"
payload := strings.NewReader("{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/destination_definitions/get_for_workspace HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 56
{
"destinationDefinitionId": "",
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/destination_definitions/get_for_workspace")
.setHeader("content-type", "application/json")
.setBody("{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/destination_definitions/get_for_workspace"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/destination_definitions/get_for_workspace")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/destination_definitions/get_for_workspace")
.header("content-type", "application/json")
.body("{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
destinationDefinitionId: '',
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/destination_definitions/get_for_workspace');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/get_for_workspace',
headers: {'content-type': 'application/json'},
data: {destinationDefinitionId: '', workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/destination_definitions/get_for_workspace';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationDefinitionId":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/destination_definitions/get_for_workspace',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "destinationDefinitionId": "",\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/destination_definitions/get_for_workspace")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/destination_definitions/get_for_workspace',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({destinationDefinitionId: '', workspaceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/get_for_workspace',
headers: {'content-type': 'application/json'},
body: {destinationDefinitionId: '', workspaceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/destination_definitions/get_for_workspace');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
destinationDefinitionId: '',
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/get_for_workspace',
headers: {'content-type': 'application/json'},
data: {destinationDefinitionId: '', workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/destination_definitions/get_for_workspace';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationDefinitionId":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"destinationDefinitionId": @"",
@"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/destination_definitions/get_for_workspace"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/destination_definitions/get_for_workspace" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/destination_definitions/get_for_workspace",
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([
'destinationDefinitionId' => '',
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/destination_definitions/get_for_workspace', [
'body' => '{
"destinationDefinitionId": "",
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/destination_definitions/get_for_workspace');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'destinationDefinitionId' => '',
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'destinationDefinitionId' => '',
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/destination_definitions/get_for_workspace');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/destination_definitions/get_for_workspace' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationDefinitionId": "",
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/destination_definitions/get_for_workspace' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationDefinitionId": "",
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/destination_definitions/get_for_workspace", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/destination_definitions/get_for_workspace"
payload = {
"destinationDefinitionId": "",
"workspaceId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/destination_definitions/get_for_workspace"
payload <- "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/destination_definitions/get_for_workspace")
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 \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/destination_definitions/get_for_workspace') do |req|
req.body = "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/destination_definitions/get_for_workspace";
let payload = json!({
"destinationDefinitionId": "",
"workspaceId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/destination_definitions/get_for_workspace \
--header 'content-type: application/json' \
--data '{
"destinationDefinitionId": "",
"workspaceId": ""
}'
echo '{
"destinationDefinitionId": "",
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/destination_definitions/get_for_workspace \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "destinationDefinitionId": "",\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/destination_definitions/get_for_workspace
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"destinationDefinitionId": "",
"workspaceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/destination_definitions/get_for_workspace")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Get destinationDefinition
{{baseUrl}}/v1/destination_definitions/get
BODY json
{
"destinationDefinitionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/destination_definitions/get");
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 \"destinationDefinitionId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/destination_definitions/get" {:content-type :json
:form-params {:destinationDefinitionId ""}})
require "http/client"
url = "{{baseUrl}}/v1/destination_definitions/get"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"destinationDefinitionId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/destination_definitions/get"),
Content = new StringContent("{\n \"destinationDefinitionId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/destination_definitions/get");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"destinationDefinitionId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/destination_definitions/get"
payload := strings.NewReader("{\n \"destinationDefinitionId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/destination_definitions/get HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 35
{
"destinationDefinitionId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/destination_definitions/get")
.setHeader("content-type", "application/json")
.setBody("{\n \"destinationDefinitionId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/destination_definitions/get"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"destinationDefinitionId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"destinationDefinitionId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/destination_definitions/get")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/destination_definitions/get")
.header("content-type", "application/json")
.body("{\n \"destinationDefinitionId\": \"\"\n}")
.asString();
const data = JSON.stringify({
destinationDefinitionId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/destination_definitions/get');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/get',
headers: {'content-type': 'application/json'},
data: {destinationDefinitionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/destination_definitions/get';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationDefinitionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/destination_definitions/get',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "destinationDefinitionId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"destinationDefinitionId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/destination_definitions/get")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/destination_definitions/get',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({destinationDefinitionId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/get',
headers: {'content-type': 'application/json'},
body: {destinationDefinitionId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/destination_definitions/get');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
destinationDefinitionId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/get',
headers: {'content-type': 'application/json'},
data: {destinationDefinitionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/destination_definitions/get';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationDefinitionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"destinationDefinitionId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/destination_definitions/get"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/destination_definitions/get" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"destinationDefinitionId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/destination_definitions/get",
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([
'destinationDefinitionId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/destination_definitions/get', [
'body' => '{
"destinationDefinitionId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/destination_definitions/get');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'destinationDefinitionId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'destinationDefinitionId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/destination_definitions/get');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/destination_definitions/get' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationDefinitionId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/destination_definitions/get' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationDefinitionId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"destinationDefinitionId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/destination_definitions/get", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/destination_definitions/get"
payload = { "destinationDefinitionId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/destination_definitions/get"
payload <- "{\n \"destinationDefinitionId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/destination_definitions/get")
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 \"destinationDefinitionId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/destination_definitions/get') do |req|
req.body = "{\n \"destinationDefinitionId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/destination_definitions/get";
let payload = json!({"destinationDefinitionId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/destination_definitions/get \
--header 'content-type: application/json' \
--data '{
"destinationDefinitionId": ""
}'
echo '{
"destinationDefinitionId": ""
}' | \
http POST {{baseUrl}}/v1/destination_definitions/get \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "destinationDefinitionId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/destination_definitions/get
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["destinationDefinitionId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/destination_definitions/get")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
List all private, non-custom destinationDefinitions, and for each indicate whether the given workspace has a grant for using the definition. Used by admins to view and modify a given workspace's grants.
{{baseUrl}}/v1/destination_definitions/list_private
BODY json
{
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/destination_definitions/list_private");
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 \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/destination_definitions/list_private" {:content-type :json
:form-params {:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/destination_definitions/list_private"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/destination_definitions/list_private"),
Content = new StringContent("{\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/destination_definitions/list_private");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/destination_definitions/list_private"
payload := strings.NewReader("{\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/destination_definitions/list_private HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/destination_definitions/list_private")
.setHeader("content-type", "application/json")
.setBody("{\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/destination_definitions/list_private"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/destination_definitions/list_private")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/destination_definitions/list_private")
.header("content-type", "application/json")
.body("{\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/destination_definitions/list_private');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/list_private',
headers: {'content-type': 'application/json'},
data: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/destination_definitions/list_private';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/destination_definitions/list_private',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/destination_definitions/list_private")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/destination_definitions/list_private',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({workspaceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/list_private',
headers: {'content-type': 'application/json'},
body: {workspaceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/destination_definitions/list_private');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/list_private',
headers: {'content-type': 'application/json'},
data: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/destination_definitions/list_private';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/destination_definitions/list_private"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/destination_definitions/list_private" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/destination_definitions/list_private",
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([
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/destination_definitions/list_private', [
'body' => '{
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/destination_definitions/list_private');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/destination_definitions/list_private');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/destination_definitions/list_private' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/destination_definitions/list_private' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/destination_definitions/list_private", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/destination_definitions/list_private"
payload = { "workspaceId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/destination_definitions/list_private"
payload <- "{\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/destination_definitions/list_private")
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 \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/destination_definitions/list_private') do |req|
req.body = "{\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/destination_definitions/list_private";
let payload = json!({"workspaceId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/destination_definitions/list_private \
--header 'content-type: application/json' \
--data '{
"workspaceId": ""
}'
echo '{
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/destination_definitions/list_private \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/destination_definitions/list_private
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["workspaceId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/destination_definitions/list_private")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
List all the destinationDefinitions the current Airbyte deployment is configured to use
{{baseUrl}}/v1/destination_definitions/list
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/destination_definitions/list");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/destination_definitions/list")
require "http/client"
url = "{{baseUrl}}/v1/destination_definitions/list"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/destination_definitions/list"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/destination_definitions/list");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/destination_definitions/list"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/destination_definitions/list HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/destination_definitions/list")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/destination_definitions/list"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/destination_definitions/list")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/destination_definitions/list")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/destination_definitions/list');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/list'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/destination_definitions/list';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/destination_definitions/list',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/destination_definitions/list")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/destination_definitions/list',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/list'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/destination_definitions/list');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/list'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/destination_definitions/list';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/destination_definitions/list"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/destination_definitions/list" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/destination_definitions/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/destination_definitions/list');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/destination_definitions/list');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/destination_definitions/list');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/destination_definitions/list' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/destination_definitions/list' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/v1/destination_definitions/list")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/destination_definitions/list"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/destination_definitions/list"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/destination_definitions/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/v1/destination_definitions/list') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/destination_definitions/list";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/destination_definitions/list
http POST {{baseUrl}}/v1/destination_definitions/list
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/v1/destination_definitions/list
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/destination_definitions/list")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
List all the destinationDefinitions the given workspace is configured to use
{{baseUrl}}/v1/destination_definitions/list_for_workspace
BODY json
{
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/destination_definitions/list_for_workspace");
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 \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/destination_definitions/list_for_workspace" {:content-type :json
:form-params {:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/destination_definitions/list_for_workspace"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/destination_definitions/list_for_workspace"),
Content = new StringContent("{\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/destination_definitions/list_for_workspace");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/destination_definitions/list_for_workspace"
payload := strings.NewReader("{\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/destination_definitions/list_for_workspace HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/destination_definitions/list_for_workspace")
.setHeader("content-type", "application/json")
.setBody("{\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/destination_definitions/list_for_workspace"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/destination_definitions/list_for_workspace")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/destination_definitions/list_for_workspace")
.header("content-type", "application/json")
.body("{\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/destination_definitions/list_for_workspace');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/list_for_workspace',
headers: {'content-type': 'application/json'},
data: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/destination_definitions/list_for_workspace';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/destination_definitions/list_for_workspace',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/destination_definitions/list_for_workspace")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/destination_definitions/list_for_workspace',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({workspaceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/list_for_workspace',
headers: {'content-type': 'application/json'},
body: {workspaceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/destination_definitions/list_for_workspace');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/list_for_workspace',
headers: {'content-type': 'application/json'},
data: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/destination_definitions/list_for_workspace';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/destination_definitions/list_for_workspace"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/destination_definitions/list_for_workspace" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/destination_definitions/list_for_workspace",
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([
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/destination_definitions/list_for_workspace', [
'body' => '{
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/destination_definitions/list_for_workspace');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/destination_definitions/list_for_workspace');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/destination_definitions/list_for_workspace' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/destination_definitions/list_for_workspace' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/destination_definitions/list_for_workspace", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/destination_definitions/list_for_workspace"
payload = { "workspaceId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/destination_definitions/list_for_workspace"
payload <- "{\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/destination_definitions/list_for_workspace")
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 \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/destination_definitions/list_for_workspace') do |req|
req.body = "{\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/destination_definitions/list_for_workspace";
let payload = json!({"workspaceId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/destination_definitions/list_for_workspace \
--header 'content-type: application/json' \
--data '{
"workspaceId": ""
}'
echo '{
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/destination_definitions/list_for_workspace \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/destination_definitions/list_for_workspace
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["workspaceId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/destination_definitions/list_for_workspace")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
List the latest destinationDefinitions Airbyte supports
{{baseUrl}}/v1/destination_definitions/list_latest
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/destination_definitions/list_latest");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/destination_definitions/list_latest")
require "http/client"
url = "{{baseUrl}}/v1/destination_definitions/list_latest"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/destination_definitions/list_latest"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/destination_definitions/list_latest");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/destination_definitions/list_latest"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/destination_definitions/list_latest HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/destination_definitions/list_latest")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/destination_definitions/list_latest"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/destination_definitions/list_latest")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/destination_definitions/list_latest")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/destination_definitions/list_latest');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/list_latest'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/destination_definitions/list_latest';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/destination_definitions/list_latest',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/destination_definitions/list_latest")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/destination_definitions/list_latest',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/list_latest'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/destination_definitions/list_latest');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/list_latest'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/destination_definitions/list_latest';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/destination_definitions/list_latest"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/destination_definitions/list_latest" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/destination_definitions/list_latest",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/destination_definitions/list_latest');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/destination_definitions/list_latest');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/destination_definitions/list_latest');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/destination_definitions/list_latest' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/destination_definitions/list_latest' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/v1/destination_definitions/list_latest")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/destination_definitions/list_latest"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/destination_definitions/list_latest"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/destination_definitions/list_latest")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/v1/destination_definitions/list_latest') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/destination_definitions/list_latest";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/destination_definitions/list_latest
http POST {{baseUrl}}/v1/destination_definitions/list_latest
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/v1/destination_definitions/list_latest
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/destination_definitions/list_latest")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Update destinationDefinition
{{baseUrl}}/v1/destination_definitions/update
BODY json
{
"destinationDefinitionId": "",
"dockerImageTag": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/destination_definitions/update");
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 \"destinationDefinitionId\": \"\",\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/destination_definitions/update" {:content-type :json
:form-params {:destinationDefinitionId ""
:dockerImageTag ""
:resourceRequirements {:default {:cpu_limit ""
:cpu_request ""
:memory_limit ""
:memory_request ""}
:jobSpecific [{:jobType ""
:resourceRequirements {}}]}}})
require "http/client"
url = "{{baseUrl}}/v1/destination_definitions/update"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"destinationDefinitionId\": \"\",\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/destination_definitions/update"),
Content = new StringContent("{\n \"destinationDefinitionId\": \"\",\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/destination_definitions/update");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"destinationDefinitionId\": \"\",\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/destination_definitions/update"
payload := strings.NewReader("{\n \"destinationDefinitionId\": \"\",\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/destination_definitions/update HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 318
{
"destinationDefinitionId": "",
"dockerImageTag": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/destination_definitions/update")
.setHeader("content-type", "application/json")
.setBody("{\n \"destinationDefinitionId\": \"\",\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/destination_definitions/update"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"destinationDefinitionId\": \"\",\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"destinationDefinitionId\": \"\",\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/destination_definitions/update")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/destination_definitions/update")
.header("content-type", "application/json")
.body("{\n \"destinationDefinitionId\": \"\",\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n}")
.asString();
const data = JSON.stringify({
destinationDefinitionId: '',
dockerImageTag: '',
resourceRequirements: {
default: {
cpu_limit: '',
cpu_request: '',
memory_limit: '',
memory_request: ''
},
jobSpecific: [
{
jobType: '',
resourceRequirements: {}
}
]
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/destination_definitions/update');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/update',
headers: {'content-type': 'application/json'},
data: {
destinationDefinitionId: '',
dockerImageTag: '',
resourceRequirements: {
default: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
jobSpecific: [{jobType: '', resourceRequirements: {}}]
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/destination_definitions/update';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationDefinitionId":"","dockerImageTag":"","resourceRequirements":{"default":{"cpu_limit":"","cpu_request":"","memory_limit":"","memory_request":""},"jobSpecific":[{"jobType":"","resourceRequirements":{}}]}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/destination_definitions/update',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "destinationDefinitionId": "",\n "dockerImageTag": "",\n "resourceRequirements": {\n "default": {\n "cpu_limit": "",\n "cpu_request": "",\n "memory_limit": "",\n "memory_request": ""\n },\n "jobSpecific": [\n {\n "jobType": "",\n "resourceRequirements": {}\n }\n ]\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"destinationDefinitionId\": \"\",\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/destination_definitions/update")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/destination_definitions/update',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
destinationDefinitionId: '',
dockerImageTag: '',
resourceRequirements: {
default: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
jobSpecific: [{jobType: '', resourceRequirements: {}}]
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/update',
headers: {'content-type': 'application/json'},
body: {
destinationDefinitionId: '',
dockerImageTag: '',
resourceRequirements: {
default: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
jobSpecific: [{jobType: '', resourceRequirements: {}}]
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/destination_definitions/update');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
destinationDefinitionId: '',
dockerImageTag: '',
resourceRequirements: {
default: {
cpu_limit: '',
cpu_request: '',
memory_limit: '',
memory_request: ''
},
jobSpecific: [
{
jobType: '',
resourceRequirements: {}
}
]
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/update',
headers: {'content-type': 'application/json'},
data: {
destinationDefinitionId: '',
dockerImageTag: '',
resourceRequirements: {
default: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
jobSpecific: [{jobType: '', resourceRequirements: {}}]
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/destination_definitions/update';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationDefinitionId":"","dockerImageTag":"","resourceRequirements":{"default":{"cpu_limit":"","cpu_request":"","memory_limit":"","memory_request":""},"jobSpecific":[{"jobType":"","resourceRequirements":{}}]}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"destinationDefinitionId": @"",
@"dockerImageTag": @"",
@"resourceRequirements": @{ @"default": @{ @"cpu_limit": @"", @"cpu_request": @"", @"memory_limit": @"", @"memory_request": @"" }, @"jobSpecific": @[ @{ @"jobType": @"", @"resourceRequirements": @{ } } ] } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/destination_definitions/update"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/destination_definitions/update" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"destinationDefinitionId\": \"\",\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/destination_definitions/update",
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([
'destinationDefinitionId' => '',
'dockerImageTag' => '',
'resourceRequirements' => [
'default' => [
'cpu_limit' => '',
'cpu_request' => '',
'memory_limit' => '',
'memory_request' => ''
],
'jobSpecific' => [
[
'jobType' => '',
'resourceRequirements' => [
]
]
]
]
]),
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;
}
request('POST', '{{baseUrl}}/v1/destination_definitions/update', [
'body' => '{
"destinationDefinitionId": "",
"dockerImageTag": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/destination_definitions/update');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'destinationDefinitionId' => '',
'dockerImageTag' => '',
'resourceRequirements' => [
'default' => [
'cpu_limit' => '',
'cpu_request' => '',
'memory_limit' => '',
'memory_request' => ''
],
'jobSpecific' => [
[
'jobType' => '',
'resourceRequirements' => [
]
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'destinationDefinitionId' => '',
'dockerImageTag' => '',
'resourceRequirements' => [
'default' => [
'cpu_limit' => '',
'cpu_request' => '',
'memory_limit' => '',
'memory_request' => ''
],
'jobSpecific' => [
[
'jobType' => '',
'resourceRequirements' => [
]
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/destination_definitions/update');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/destination_definitions/update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationDefinitionId": "",
"dockerImageTag": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/destination_definitions/update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationDefinitionId": "",
"dockerImageTag": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"destinationDefinitionId\": \"\",\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/destination_definitions/update", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/destination_definitions/update"
payload = {
"destinationDefinitionId": "",
"dockerImageTag": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/destination_definitions/update"
payload <- "{\n \"destinationDefinitionId\": \"\",\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/destination_definitions/update")
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 \"destinationDefinitionId\": \"\",\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/destination_definitions/update') do |req|
req.body = "{\n \"destinationDefinitionId\": \"\",\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/destination_definitions/update";
let payload = json!({
"destinationDefinitionId": "",
"dockerImageTag": "",
"resourceRequirements": json!({
"default": json!({
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
}),
"jobSpecific": (
json!({
"jobType": "",
"resourceRequirements": json!({})
})
)
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/destination_definitions/update \
--header 'content-type: application/json' \
--data '{
"destinationDefinitionId": "",
"dockerImageTag": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
}
}'
echo '{
"destinationDefinitionId": "",
"dockerImageTag": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
}
}' | \
http POST {{baseUrl}}/v1/destination_definitions/update \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "destinationDefinitionId": "",\n "dockerImageTag": "",\n "resourceRequirements": {\n "default": {\n "cpu_limit": "",\n "cpu_request": "",\n "memory_limit": "",\n "memory_request": ""\n },\n "jobSpecific": [\n {\n "jobType": "",\n "resourceRequirements": {}\n }\n ]\n }\n}' \
--output-document \
- {{baseUrl}}/v1/destination_definitions/update
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"destinationDefinitionId": "",
"dockerImageTag": "",
"resourceRequirements": [
"default": [
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
],
"jobSpecific": [
[
"jobType": "",
"resourceRequirements": []
]
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/destination_definitions/update")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
grant a private, non-custom destinationDefinition to a given workspace
{{baseUrl}}/v1/destination_definitions/grant_definition
BODY json
{
"destinationDefinitionId": "",
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/destination_definitions/grant_definition");
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 \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/destination_definitions/grant_definition" {:content-type :json
:form-params {:destinationDefinitionId ""
:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/destination_definitions/grant_definition"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/destination_definitions/grant_definition"),
Content = new StringContent("{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/destination_definitions/grant_definition");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/destination_definitions/grant_definition"
payload := strings.NewReader("{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/destination_definitions/grant_definition HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 56
{
"destinationDefinitionId": "",
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/destination_definitions/grant_definition")
.setHeader("content-type", "application/json")
.setBody("{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/destination_definitions/grant_definition"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/destination_definitions/grant_definition")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/destination_definitions/grant_definition")
.header("content-type", "application/json")
.body("{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
destinationDefinitionId: '',
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/destination_definitions/grant_definition');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/grant_definition',
headers: {'content-type': 'application/json'},
data: {destinationDefinitionId: '', workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/destination_definitions/grant_definition';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationDefinitionId":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/destination_definitions/grant_definition',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "destinationDefinitionId": "",\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/destination_definitions/grant_definition")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/destination_definitions/grant_definition',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({destinationDefinitionId: '', workspaceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/grant_definition',
headers: {'content-type': 'application/json'},
body: {destinationDefinitionId: '', workspaceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/destination_definitions/grant_definition');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
destinationDefinitionId: '',
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/grant_definition',
headers: {'content-type': 'application/json'},
data: {destinationDefinitionId: '', workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/destination_definitions/grant_definition';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationDefinitionId":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"destinationDefinitionId": @"",
@"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/destination_definitions/grant_definition"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/destination_definitions/grant_definition" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/destination_definitions/grant_definition",
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([
'destinationDefinitionId' => '',
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/destination_definitions/grant_definition', [
'body' => '{
"destinationDefinitionId": "",
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/destination_definitions/grant_definition');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'destinationDefinitionId' => '',
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'destinationDefinitionId' => '',
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/destination_definitions/grant_definition');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/destination_definitions/grant_definition' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationDefinitionId": "",
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/destination_definitions/grant_definition' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationDefinitionId": "",
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/destination_definitions/grant_definition", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/destination_definitions/grant_definition"
payload = {
"destinationDefinitionId": "",
"workspaceId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/destination_definitions/grant_definition"
payload <- "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/destination_definitions/grant_definition")
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 \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/destination_definitions/grant_definition') do |req|
req.body = "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/destination_definitions/grant_definition";
let payload = json!({
"destinationDefinitionId": "",
"workspaceId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/destination_definitions/grant_definition \
--header 'content-type: application/json' \
--data '{
"destinationDefinitionId": "",
"workspaceId": ""
}'
echo '{
"destinationDefinitionId": "",
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/destination_definitions/grant_definition \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "destinationDefinitionId": "",\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/destination_definitions/grant_definition
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"destinationDefinitionId": "",
"workspaceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/destination_definitions/grant_definition")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
revoke a grant to a private, non-custom destinationDefinition from a given workspace
{{baseUrl}}/v1/destination_definitions/revoke_definition
BODY json
{
"destinationDefinitionId": "",
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/destination_definitions/revoke_definition");
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 \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/destination_definitions/revoke_definition" {:content-type :json
:form-params {:destinationDefinitionId ""
:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/destination_definitions/revoke_definition"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/destination_definitions/revoke_definition"),
Content = new StringContent("{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/destination_definitions/revoke_definition");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/destination_definitions/revoke_definition"
payload := strings.NewReader("{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/destination_definitions/revoke_definition HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 56
{
"destinationDefinitionId": "",
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/destination_definitions/revoke_definition")
.setHeader("content-type", "application/json")
.setBody("{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/destination_definitions/revoke_definition"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/destination_definitions/revoke_definition")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/destination_definitions/revoke_definition")
.header("content-type", "application/json")
.body("{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
destinationDefinitionId: '',
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/destination_definitions/revoke_definition');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/revoke_definition',
headers: {'content-type': 'application/json'},
data: {destinationDefinitionId: '', workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/destination_definitions/revoke_definition';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationDefinitionId":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/destination_definitions/revoke_definition',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "destinationDefinitionId": "",\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/destination_definitions/revoke_definition")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/destination_definitions/revoke_definition',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({destinationDefinitionId: '', workspaceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/revoke_definition',
headers: {'content-type': 'application/json'},
body: {destinationDefinitionId: '', workspaceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/destination_definitions/revoke_definition');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
destinationDefinitionId: '',
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definitions/revoke_definition',
headers: {'content-type': 'application/json'},
data: {destinationDefinitionId: '', workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/destination_definitions/revoke_definition';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationDefinitionId":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"destinationDefinitionId": @"",
@"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/destination_definitions/revoke_definition"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/destination_definitions/revoke_definition" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/destination_definitions/revoke_definition",
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([
'destinationDefinitionId' => '',
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/destination_definitions/revoke_definition', [
'body' => '{
"destinationDefinitionId": "",
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/destination_definitions/revoke_definition');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'destinationDefinitionId' => '',
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'destinationDefinitionId' => '',
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/destination_definitions/revoke_definition');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/destination_definitions/revoke_definition' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationDefinitionId": "",
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/destination_definitions/revoke_definition' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationDefinitionId": "",
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/destination_definitions/revoke_definition", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/destination_definitions/revoke_definition"
payload = {
"destinationDefinitionId": "",
"workspaceId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/destination_definitions/revoke_definition"
payload <- "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/destination_definitions/revoke_definition")
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 \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/destination_definitions/revoke_definition') do |req|
req.body = "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/destination_definitions/revoke_definition";
let payload = json!({
"destinationDefinitionId": "",
"workspaceId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/destination_definitions/revoke_definition \
--header 'content-type: application/json' \
--data '{
"destinationDefinitionId": "",
"workspaceId": ""
}'
echo '{
"destinationDefinitionId": "",
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/destination_definitions/revoke_definition \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "destinationDefinitionId": "",\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/destination_definitions/revoke_definition
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"destinationDefinitionId": "",
"workspaceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/destination_definitions/revoke_definition")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Get specification for a destinationDefinition
{{baseUrl}}/v1/destination_definition_specifications/get
BODY json
{
"destinationDefinitionId": "",
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/destination_definition_specifications/get");
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 \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/destination_definition_specifications/get" {:content-type :json
:form-params {:destinationDefinitionId ""
:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/destination_definition_specifications/get"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/destination_definition_specifications/get"),
Content = new StringContent("{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/destination_definition_specifications/get");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/destination_definition_specifications/get"
payload := strings.NewReader("{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/destination_definition_specifications/get HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 56
{
"destinationDefinitionId": "",
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/destination_definition_specifications/get")
.setHeader("content-type", "application/json")
.setBody("{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/destination_definition_specifications/get"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/destination_definition_specifications/get")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/destination_definition_specifications/get")
.header("content-type", "application/json")
.body("{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
destinationDefinitionId: '',
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/destination_definition_specifications/get');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definition_specifications/get',
headers: {'content-type': 'application/json'},
data: {destinationDefinitionId: '', workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/destination_definition_specifications/get';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationDefinitionId":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/destination_definition_specifications/get',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "destinationDefinitionId": "",\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/destination_definition_specifications/get")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/destination_definition_specifications/get',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({destinationDefinitionId: '', workspaceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definition_specifications/get',
headers: {'content-type': 'application/json'},
body: {destinationDefinitionId: '', workspaceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/destination_definition_specifications/get');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
destinationDefinitionId: '',
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_definition_specifications/get',
headers: {'content-type': 'application/json'},
data: {destinationDefinitionId: '', workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/destination_definition_specifications/get';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationDefinitionId":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"destinationDefinitionId": @"",
@"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/destination_definition_specifications/get"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/destination_definition_specifications/get" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/destination_definition_specifications/get",
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([
'destinationDefinitionId' => '',
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/destination_definition_specifications/get', [
'body' => '{
"destinationDefinitionId": "",
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/destination_definition_specifications/get');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'destinationDefinitionId' => '',
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'destinationDefinitionId' => '',
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/destination_definition_specifications/get');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/destination_definition_specifications/get' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationDefinitionId": "",
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/destination_definition_specifications/get' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationDefinitionId": "",
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/destination_definition_specifications/get", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/destination_definition_specifications/get"
payload = {
"destinationDefinitionId": "",
"workspaceId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/destination_definition_specifications/get"
payload <- "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/destination_definition_specifications/get")
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 \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/destination_definition_specifications/get') do |req|
req.body = "{\n \"destinationDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/destination_definition_specifications/get";
let payload = json!({
"destinationDefinitionId": "",
"workspaceId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/destination_definition_specifications/get \
--header 'content-type: application/json' \
--data '{
"destinationDefinitionId": "",
"workspaceId": ""
}'
echo '{
"destinationDefinitionId": "",
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/destination_definition_specifications/get \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "destinationDefinitionId": "",\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/destination_definition_specifications/get
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"destinationDefinitionId": "",
"workspaceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/destination_definition_specifications/get")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"connectionSpecification": {
"user": {
"type": "string"
}
}
}
POST
Given a destination connector definition ID, return the URL to the consent screen where to redirect the user to.
{{baseUrl}}/v1/destination_oauths/get_consent_url
BODY json
{
"destinationDefinitionId": "",
"destinationId": "",
"oAuthInputConfiguration": "",
"redirectUrl": "",
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/destination_oauths/get_consent_url");
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 \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/destination_oauths/get_consent_url" {:content-type :json
:form-params {:destinationDefinitionId ""
:destinationId ""
:oAuthInputConfiguration ""
:redirectUrl ""
:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/destination_oauths/get_consent_url"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/destination_oauths/get_consent_url"),
Content = new StringContent("{\n \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/destination_oauths/get_consent_url");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/destination_oauths/get_consent_url"
payload := strings.NewReader("{\n \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/destination_oauths/get_consent_url HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 133
{
"destinationDefinitionId": "",
"destinationId": "",
"oAuthInputConfiguration": "",
"redirectUrl": "",
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/destination_oauths/get_consent_url")
.setHeader("content-type", "application/json")
.setBody("{\n \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/destination_oauths/get_consent_url"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/destination_oauths/get_consent_url")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/destination_oauths/get_consent_url")
.header("content-type", "application/json")
.body("{\n \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
destinationDefinitionId: '',
destinationId: '',
oAuthInputConfiguration: '',
redirectUrl: '',
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/destination_oauths/get_consent_url');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_oauths/get_consent_url',
headers: {'content-type': 'application/json'},
data: {
destinationDefinitionId: '',
destinationId: '',
oAuthInputConfiguration: '',
redirectUrl: '',
workspaceId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/destination_oauths/get_consent_url';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationDefinitionId":"","destinationId":"","oAuthInputConfiguration":"","redirectUrl":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/destination_oauths/get_consent_url',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "destinationDefinitionId": "",\n "destinationId": "",\n "oAuthInputConfiguration": "",\n "redirectUrl": "",\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/destination_oauths/get_consent_url")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/destination_oauths/get_consent_url',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
destinationDefinitionId: '',
destinationId: '',
oAuthInputConfiguration: '',
redirectUrl: '',
workspaceId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_oauths/get_consent_url',
headers: {'content-type': 'application/json'},
body: {
destinationDefinitionId: '',
destinationId: '',
oAuthInputConfiguration: '',
redirectUrl: '',
workspaceId: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/destination_oauths/get_consent_url');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
destinationDefinitionId: '',
destinationId: '',
oAuthInputConfiguration: '',
redirectUrl: '',
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_oauths/get_consent_url',
headers: {'content-type': 'application/json'},
data: {
destinationDefinitionId: '',
destinationId: '',
oAuthInputConfiguration: '',
redirectUrl: '',
workspaceId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/destination_oauths/get_consent_url';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationDefinitionId":"","destinationId":"","oAuthInputConfiguration":"","redirectUrl":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"destinationDefinitionId": @"",
@"destinationId": @"",
@"oAuthInputConfiguration": @"",
@"redirectUrl": @"",
@"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/destination_oauths/get_consent_url"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/destination_oauths/get_consent_url" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/destination_oauths/get_consent_url",
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([
'destinationDefinitionId' => '',
'destinationId' => '',
'oAuthInputConfiguration' => '',
'redirectUrl' => '',
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/destination_oauths/get_consent_url', [
'body' => '{
"destinationDefinitionId": "",
"destinationId": "",
"oAuthInputConfiguration": "",
"redirectUrl": "",
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/destination_oauths/get_consent_url');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'destinationDefinitionId' => '',
'destinationId' => '',
'oAuthInputConfiguration' => '',
'redirectUrl' => '',
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'destinationDefinitionId' => '',
'destinationId' => '',
'oAuthInputConfiguration' => '',
'redirectUrl' => '',
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/destination_oauths/get_consent_url');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/destination_oauths/get_consent_url' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationDefinitionId": "",
"destinationId": "",
"oAuthInputConfiguration": "",
"redirectUrl": "",
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/destination_oauths/get_consent_url' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationDefinitionId": "",
"destinationId": "",
"oAuthInputConfiguration": "",
"redirectUrl": "",
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/destination_oauths/get_consent_url", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/destination_oauths/get_consent_url"
payload = {
"destinationDefinitionId": "",
"destinationId": "",
"oAuthInputConfiguration": "",
"redirectUrl": "",
"workspaceId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/destination_oauths/get_consent_url"
payload <- "{\n \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/destination_oauths/get_consent_url")
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 \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/destination_oauths/get_consent_url') do |req|
req.body = "{\n \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/destination_oauths/get_consent_url";
let payload = json!({
"destinationDefinitionId": "",
"destinationId": "",
"oAuthInputConfiguration": "",
"redirectUrl": "",
"workspaceId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/destination_oauths/get_consent_url \
--header 'content-type: application/json' \
--data '{
"destinationDefinitionId": "",
"destinationId": "",
"oAuthInputConfiguration": "",
"redirectUrl": "",
"workspaceId": ""
}'
echo '{
"destinationDefinitionId": "",
"destinationId": "",
"oAuthInputConfiguration": "",
"redirectUrl": "",
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/destination_oauths/get_consent_url \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "destinationDefinitionId": "",\n "destinationId": "",\n "oAuthInputConfiguration": "",\n "redirectUrl": "",\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/destination_oauths/get_consent_url
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"destinationDefinitionId": "",
"destinationId": "",
"oAuthInputConfiguration": "",
"redirectUrl": "",
"workspaceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/destination_oauths/get_consent_url")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Given a destination def ID generate an access-refresh token etc.
{{baseUrl}}/v1/destination_oauths/complete_oauth
BODY json
{
"destinationDefinitionId": "",
"destinationId": "",
"oAuthInputConfiguration": "",
"queryParams": {},
"redirectUrl": "",
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/destination_oauths/complete_oauth");
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 \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/destination_oauths/complete_oauth" {:content-type :json
:form-params {:destinationDefinitionId ""
:destinationId ""
:oAuthInputConfiguration ""
:queryParams {}
:redirectUrl ""
:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/destination_oauths/complete_oauth"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/destination_oauths/complete_oauth"),
Content = new StringContent("{\n \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/destination_oauths/complete_oauth");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/destination_oauths/complete_oauth"
payload := strings.NewReader("{\n \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/destination_oauths/complete_oauth HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 154
{
"destinationDefinitionId": "",
"destinationId": "",
"oAuthInputConfiguration": "",
"queryParams": {},
"redirectUrl": "",
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/destination_oauths/complete_oauth")
.setHeader("content-type", "application/json")
.setBody("{\n \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/destination_oauths/complete_oauth"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/destination_oauths/complete_oauth")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/destination_oauths/complete_oauth")
.header("content-type", "application/json")
.body("{\n \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
destinationDefinitionId: '',
destinationId: '',
oAuthInputConfiguration: '',
queryParams: {},
redirectUrl: '',
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/destination_oauths/complete_oauth');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_oauths/complete_oauth',
headers: {'content-type': 'application/json'},
data: {
destinationDefinitionId: '',
destinationId: '',
oAuthInputConfiguration: '',
queryParams: {},
redirectUrl: '',
workspaceId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/destination_oauths/complete_oauth';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationDefinitionId":"","destinationId":"","oAuthInputConfiguration":"","queryParams":{},"redirectUrl":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/destination_oauths/complete_oauth',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "destinationDefinitionId": "",\n "destinationId": "",\n "oAuthInputConfiguration": "",\n "queryParams": {},\n "redirectUrl": "",\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/destination_oauths/complete_oauth")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/destination_oauths/complete_oauth',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
destinationDefinitionId: '',
destinationId: '',
oAuthInputConfiguration: '',
queryParams: {},
redirectUrl: '',
workspaceId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_oauths/complete_oauth',
headers: {'content-type': 'application/json'},
body: {
destinationDefinitionId: '',
destinationId: '',
oAuthInputConfiguration: '',
queryParams: {},
redirectUrl: '',
workspaceId: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/destination_oauths/complete_oauth');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
destinationDefinitionId: '',
destinationId: '',
oAuthInputConfiguration: '',
queryParams: {},
redirectUrl: '',
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/destination_oauths/complete_oauth',
headers: {'content-type': 'application/json'},
data: {
destinationDefinitionId: '',
destinationId: '',
oAuthInputConfiguration: '',
queryParams: {},
redirectUrl: '',
workspaceId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/destination_oauths/complete_oauth';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationDefinitionId":"","destinationId":"","oAuthInputConfiguration":"","queryParams":{},"redirectUrl":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"destinationDefinitionId": @"",
@"destinationId": @"",
@"oAuthInputConfiguration": @"",
@"queryParams": @{ },
@"redirectUrl": @"",
@"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/destination_oauths/complete_oauth"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/destination_oauths/complete_oauth" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/destination_oauths/complete_oauth",
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([
'destinationDefinitionId' => '',
'destinationId' => '',
'oAuthInputConfiguration' => '',
'queryParams' => [
],
'redirectUrl' => '',
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/destination_oauths/complete_oauth', [
'body' => '{
"destinationDefinitionId": "",
"destinationId": "",
"oAuthInputConfiguration": "",
"queryParams": {},
"redirectUrl": "",
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/destination_oauths/complete_oauth');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'destinationDefinitionId' => '',
'destinationId' => '',
'oAuthInputConfiguration' => '',
'queryParams' => [
],
'redirectUrl' => '',
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'destinationDefinitionId' => '',
'destinationId' => '',
'oAuthInputConfiguration' => '',
'queryParams' => [
],
'redirectUrl' => '',
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/destination_oauths/complete_oauth');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/destination_oauths/complete_oauth' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationDefinitionId": "",
"destinationId": "",
"oAuthInputConfiguration": "",
"queryParams": {},
"redirectUrl": "",
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/destination_oauths/complete_oauth' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationDefinitionId": "",
"destinationId": "",
"oAuthInputConfiguration": "",
"queryParams": {},
"redirectUrl": "",
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/destination_oauths/complete_oauth", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/destination_oauths/complete_oauth"
payload = {
"destinationDefinitionId": "",
"destinationId": "",
"oAuthInputConfiguration": "",
"queryParams": {},
"redirectUrl": "",
"workspaceId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/destination_oauths/complete_oauth"
payload <- "{\n \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/destination_oauths/complete_oauth")
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 \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/destination_oauths/complete_oauth') do |req|
req.body = "{\n \"destinationDefinitionId\": \"\",\n \"destinationId\": \"\",\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/destination_oauths/complete_oauth";
let payload = json!({
"destinationDefinitionId": "",
"destinationId": "",
"oAuthInputConfiguration": "",
"queryParams": json!({}),
"redirectUrl": "",
"workspaceId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/destination_oauths/complete_oauth \
--header 'content-type: application/json' \
--data '{
"destinationDefinitionId": "",
"destinationId": "",
"oAuthInputConfiguration": "",
"queryParams": {},
"redirectUrl": "",
"workspaceId": ""
}'
echo '{
"destinationDefinitionId": "",
"destinationId": "",
"oAuthInputConfiguration": "",
"queryParams": {},
"redirectUrl": "",
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/destination_oauths/complete_oauth \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "destinationDefinitionId": "",\n "destinationId": "",\n "oAuthInputConfiguration": "",\n "queryParams": {},\n "redirectUrl": "",\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/destination_oauths/complete_oauth
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"destinationDefinitionId": "",
"destinationId": "",
"oAuthInputConfiguration": "",
"queryParams": [],
"redirectUrl": "",
"workspaceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/destination_oauths/complete_oauth")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Health Check
{{baseUrl}}/v1/health
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/health");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/health")
require "http/client"
url = "{{baseUrl}}/v1/health"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/health"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/health");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/health"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/health HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/health")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/health"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/health")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/health")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/v1/health');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1/health'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/health';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/health',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/health")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/health',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/v1/health'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/health');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/v1/health'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/health';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/health"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/health" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/health",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/health');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/health');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/health');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/health' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/health' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1/health")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/health"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/health"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/health")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/health') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/health";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/health
http GET {{baseUrl}}/v1/health
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1/health
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/health")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Cancels a job
{{baseUrl}}/v1/jobs/cancel
BODY json
{
"id": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/jobs/cancel");
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 \"id\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/jobs/cancel" {:content-type :json
:form-params {:id 0}})
require "http/client"
url = "{{baseUrl}}/v1/jobs/cancel"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"id\": 0\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/jobs/cancel"),
Content = new StringContent("{\n \"id\": 0\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/jobs/cancel");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"id\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/jobs/cancel"
payload := strings.NewReader("{\n \"id\": 0\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/jobs/cancel HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 13
{
"id": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/jobs/cancel")
.setHeader("content-type", "application/json")
.setBody("{\n \"id\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/jobs/cancel"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"id\": 0\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"id\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/jobs/cancel")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/jobs/cancel")
.header("content-type", "application/json")
.body("{\n \"id\": 0\n}")
.asString();
const data = JSON.stringify({
id: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/jobs/cancel');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/jobs/cancel',
headers: {'content-type': 'application/json'},
data: {id: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/jobs/cancel';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"id":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/jobs/cancel',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "id": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"id\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/jobs/cancel")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/jobs/cancel',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({id: 0}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/jobs/cancel',
headers: {'content-type': 'application/json'},
body: {id: 0},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/jobs/cancel');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
id: 0
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/jobs/cancel',
headers: {'content-type': 'application/json'},
data: {id: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/jobs/cancel';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"id":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"id": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/jobs/cancel"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/jobs/cancel" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"id\": 0\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/jobs/cancel",
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([
'id' => 0
]),
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;
}
request('POST', '{{baseUrl}}/v1/jobs/cancel', [
'body' => '{
"id": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/jobs/cancel');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'id' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'id' => 0
]));
$request->setRequestUrl('{{baseUrl}}/v1/jobs/cancel');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/jobs/cancel' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/jobs/cancel' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"id\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/jobs/cancel", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/jobs/cancel"
payload = { "id": 0 }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/jobs/cancel"
payload <- "{\n \"id\": 0\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/jobs/cancel")
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 \"id\": 0\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/jobs/cancel') do |req|
req.body = "{\n \"id\": 0\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/jobs/cancel";
let payload = json!({"id": 0});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/jobs/cancel \
--header 'content-type: application/json' \
--data '{
"id": 0
}'
echo '{
"id": 0
}' | \
http POST {{baseUrl}}/v1/jobs/cancel \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "id": 0\n}' \
--output-document \
- {{baseUrl}}/v1/jobs/cancel
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["id": 0] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/jobs/cancel")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Get information about a job excluding attempt info and logs
{{baseUrl}}/v1/jobs/get_light
BODY json
{
"id": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/jobs/get_light");
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 \"id\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/jobs/get_light" {:content-type :json
:form-params {:id 0}})
require "http/client"
url = "{{baseUrl}}/v1/jobs/get_light"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"id\": 0\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/jobs/get_light"),
Content = new StringContent("{\n \"id\": 0\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/jobs/get_light");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"id\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/jobs/get_light"
payload := strings.NewReader("{\n \"id\": 0\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/jobs/get_light HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 13
{
"id": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/jobs/get_light")
.setHeader("content-type", "application/json")
.setBody("{\n \"id\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/jobs/get_light"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"id\": 0\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"id\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/jobs/get_light")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/jobs/get_light")
.header("content-type", "application/json")
.body("{\n \"id\": 0\n}")
.asString();
const data = JSON.stringify({
id: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/jobs/get_light');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/jobs/get_light',
headers: {'content-type': 'application/json'},
data: {id: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/jobs/get_light';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"id":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/jobs/get_light',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "id": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"id\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/jobs/get_light")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/jobs/get_light',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({id: 0}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/jobs/get_light',
headers: {'content-type': 'application/json'},
body: {id: 0},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/jobs/get_light');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
id: 0
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/jobs/get_light',
headers: {'content-type': 'application/json'},
data: {id: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/jobs/get_light';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"id":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"id": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/jobs/get_light"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/jobs/get_light" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"id\": 0\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/jobs/get_light",
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([
'id' => 0
]),
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;
}
request('POST', '{{baseUrl}}/v1/jobs/get_light', [
'body' => '{
"id": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/jobs/get_light');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'id' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'id' => 0
]));
$request->setRequestUrl('{{baseUrl}}/v1/jobs/get_light');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/jobs/get_light' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/jobs/get_light' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"id\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/jobs/get_light", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/jobs/get_light"
payload = { "id": 0 }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/jobs/get_light"
payload <- "{\n \"id\": 0\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/jobs/get_light")
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 \"id\": 0\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/jobs/get_light') do |req|
req.body = "{\n \"id\": 0\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/jobs/get_light";
let payload = json!({"id": 0});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/jobs/get_light \
--header 'content-type: application/json' \
--data '{
"id": 0
}'
echo '{
"id": 0
}' | \
http POST {{baseUrl}}/v1/jobs/get_light \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "id": 0\n}' \
--output-document \
- {{baseUrl}}/v1/jobs/get_light
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["id": 0] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/jobs/get_light")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Get information about a job
{{baseUrl}}/v1/jobs/get
BODY json
{
"id": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/jobs/get");
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 \"id\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/jobs/get" {:content-type :json
:form-params {:id 0}})
require "http/client"
url = "{{baseUrl}}/v1/jobs/get"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"id\": 0\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/jobs/get"),
Content = new StringContent("{\n \"id\": 0\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/jobs/get");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"id\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/jobs/get"
payload := strings.NewReader("{\n \"id\": 0\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/jobs/get HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 13
{
"id": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/jobs/get")
.setHeader("content-type", "application/json")
.setBody("{\n \"id\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/jobs/get"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"id\": 0\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"id\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/jobs/get")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/jobs/get")
.header("content-type", "application/json")
.body("{\n \"id\": 0\n}")
.asString();
const data = JSON.stringify({
id: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/jobs/get');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/jobs/get',
headers: {'content-type': 'application/json'},
data: {id: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/jobs/get';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"id":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/jobs/get',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "id": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"id\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/jobs/get")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/jobs/get',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({id: 0}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/jobs/get',
headers: {'content-type': 'application/json'},
body: {id: 0},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/jobs/get');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
id: 0
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/jobs/get',
headers: {'content-type': 'application/json'},
data: {id: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/jobs/get';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"id":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"id": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/jobs/get"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/jobs/get" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"id\": 0\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/jobs/get",
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([
'id' => 0
]),
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;
}
request('POST', '{{baseUrl}}/v1/jobs/get', [
'body' => '{
"id": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/jobs/get');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'id' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'id' => 0
]));
$request->setRequestUrl('{{baseUrl}}/v1/jobs/get');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/jobs/get' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/jobs/get' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"id\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/jobs/get", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/jobs/get"
payload = { "id": 0 }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/jobs/get"
payload <- "{\n \"id\": 0\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/jobs/get")
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 \"id\": 0\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/jobs/get') do |req|
req.body = "{\n \"id\": 0\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/jobs/get";
let payload = json!({"id": 0});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/jobs/get \
--header 'content-type: application/json' \
--data '{
"id": 0
}'
echo '{
"id": 0
}' | \
http POST {{baseUrl}}/v1/jobs/get \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "id": 0\n}' \
--output-document \
- {{baseUrl}}/v1/jobs/get
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["id": 0] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/jobs/get")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Get normalization status to determine if we can bypass normalization phase
{{baseUrl}}/v1/jobs/get_normalization_status
BODY json
{
"id": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/jobs/get_normalization_status");
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 \"id\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/jobs/get_normalization_status" {:content-type :json
:form-params {:id 0}})
require "http/client"
url = "{{baseUrl}}/v1/jobs/get_normalization_status"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"id\": 0\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/jobs/get_normalization_status"),
Content = new StringContent("{\n \"id\": 0\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/jobs/get_normalization_status");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"id\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/jobs/get_normalization_status"
payload := strings.NewReader("{\n \"id\": 0\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/jobs/get_normalization_status HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 13
{
"id": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/jobs/get_normalization_status")
.setHeader("content-type", "application/json")
.setBody("{\n \"id\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/jobs/get_normalization_status"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"id\": 0\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"id\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/jobs/get_normalization_status")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/jobs/get_normalization_status")
.header("content-type", "application/json")
.body("{\n \"id\": 0\n}")
.asString();
const data = JSON.stringify({
id: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/jobs/get_normalization_status');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/jobs/get_normalization_status',
headers: {'content-type': 'application/json'},
data: {id: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/jobs/get_normalization_status';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"id":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/jobs/get_normalization_status',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "id": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"id\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/jobs/get_normalization_status")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/jobs/get_normalization_status',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({id: 0}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/jobs/get_normalization_status',
headers: {'content-type': 'application/json'},
body: {id: 0},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/jobs/get_normalization_status');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
id: 0
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/jobs/get_normalization_status',
headers: {'content-type': 'application/json'},
data: {id: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/jobs/get_normalization_status';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"id":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"id": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/jobs/get_normalization_status"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/jobs/get_normalization_status" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"id\": 0\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/jobs/get_normalization_status",
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([
'id' => 0
]),
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;
}
request('POST', '{{baseUrl}}/v1/jobs/get_normalization_status', [
'body' => '{
"id": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/jobs/get_normalization_status');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'id' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'id' => 0
]));
$request->setRequestUrl('{{baseUrl}}/v1/jobs/get_normalization_status');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/jobs/get_normalization_status' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/jobs/get_normalization_status' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"id\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/jobs/get_normalization_status", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/jobs/get_normalization_status"
payload = { "id": 0 }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/jobs/get_normalization_status"
payload <- "{\n \"id\": 0\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/jobs/get_normalization_status")
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 \"id\": 0\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/jobs/get_normalization_status') do |req|
req.body = "{\n \"id\": 0\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/jobs/get_normalization_status";
let payload = json!({"id": 0});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/jobs/get_normalization_status \
--header 'content-type: application/json' \
--data '{
"id": 0
}'
echo '{
"id": 0
}' | \
http POST {{baseUrl}}/v1/jobs/get_normalization_status \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "id": 0\n}' \
--output-document \
- {{baseUrl}}/v1/jobs/get_normalization_status
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["id": 0] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/jobs/get_normalization_status")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Gets all information needed to debug this job
{{baseUrl}}/v1/jobs/get_debug_info
BODY json
{
"id": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/jobs/get_debug_info");
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 \"id\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/jobs/get_debug_info" {:content-type :json
:form-params {:id 0}})
require "http/client"
url = "{{baseUrl}}/v1/jobs/get_debug_info"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"id\": 0\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/jobs/get_debug_info"),
Content = new StringContent("{\n \"id\": 0\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/jobs/get_debug_info");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"id\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/jobs/get_debug_info"
payload := strings.NewReader("{\n \"id\": 0\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/jobs/get_debug_info HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 13
{
"id": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/jobs/get_debug_info")
.setHeader("content-type", "application/json")
.setBody("{\n \"id\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/jobs/get_debug_info"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"id\": 0\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"id\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/jobs/get_debug_info")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/jobs/get_debug_info")
.header("content-type", "application/json")
.body("{\n \"id\": 0\n}")
.asString();
const data = JSON.stringify({
id: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/jobs/get_debug_info');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/jobs/get_debug_info',
headers: {'content-type': 'application/json'},
data: {id: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/jobs/get_debug_info';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"id":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/jobs/get_debug_info',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "id": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"id\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/jobs/get_debug_info")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/jobs/get_debug_info',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({id: 0}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/jobs/get_debug_info',
headers: {'content-type': 'application/json'},
body: {id: 0},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/jobs/get_debug_info');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
id: 0
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/jobs/get_debug_info',
headers: {'content-type': 'application/json'},
data: {id: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/jobs/get_debug_info';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"id":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"id": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/jobs/get_debug_info"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/jobs/get_debug_info" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"id\": 0\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/jobs/get_debug_info",
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([
'id' => 0
]),
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;
}
request('POST', '{{baseUrl}}/v1/jobs/get_debug_info', [
'body' => '{
"id": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/jobs/get_debug_info');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'id' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'id' => 0
]));
$request->setRequestUrl('{{baseUrl}}/v1/jobs/get_debug_info');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/jobs/get_debug_info' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/jobs/get_debug_info' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"id\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/jobs/get_debug_info", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/jobs/get_debug_info"
payload = { "id": 0 }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/jobs/get_debug_info"
payload <- "{\n \"id\": 0\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/jobs/get_debug_info")
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 \"id\": 0\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/jobs/get_debug_info') do |req|
req.body = "{\n \"id\": 0\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/jobs/get_debug_info";
let payload = json!({"id": 0});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/jobs/get_debug_info \
--header 'content-type: application/json' \
--data '{
"id": 0
}'
echo '{
"id": 0
}' | \
http POST {{baseUrl}}/v1/jobs/get_debug_info \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "id": 0\n}' \
--output-document \
- {{baseUrl}}/v1/jobs/get_debug_info
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["id": 0] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/jobs/get_debug_info")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Returns recent jobs for a connection. Jobs are returned in descending order by createdAt.
{{baseUrl}}/v1/jobs/list
BODY json
{
"configId": "",
"configTypes": [],
"includingJobId": 0,
"pagination": {
"pageSize": 0,
"rowOffset": 0
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/jobs/list");
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 \"configId\": \"\",\n \"configTypes\": [],\n \"includingJobId\": 0,\n \"pagination\": {\n \"pageSize\": 0,\n \"rowOffset\": 0\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/jobs/list" {:content-type :json
:form-params {:configId ""
:configTypes []
:includingJobId 0
:pagination {:pageSize 0
:rowOffset 0}}})
require "http/client"
url = "{{baseUrl}}/v1/jobs/list"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"configId\": \"\",\n \"configTypes\": [],\n \"includingJobId\": 0,\n \"pagination\": {\n \"pageSize\": 0,\n \"rowOffset\": 0\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/jobs/list"),
Content = new StringContent("{\n \"configId\": \"\",\n \"configTypes\": [],\n \"includingJobId\": 0,\n \"pagination\": {\n \"pageSize\": 0,\n \"rowOffset\": 0\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/jobs/list");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"configId\": \"\",\n \"configTypes\": [],\n \"includingJobId\": 0,\n \"pagination\": {\n \"pageSize\": 0,\n \"rowOffset\": 0\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/jobs/list"
payload := strings.NewReader("{\n \"configId\": \"\",\n \"configTypes\": [],\n \"includingJobId\": 0,\n \"pagination\": {\n \"pageSize\": 0,\n \"rowOffset\": 0\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/jobs/list HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 125
{
"configId": "",
"configTypes": [],
"includingJobId": 0,
"pagination": {
"pageSize": 0,
"rowOffset": 0
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/jobs/list")
.setHeader("content-type", "application/json")
.setBody("{\n \"configId\": \"\",\n \"configTypes\": [],\n \"includingJobId\": 0,\n \"pagination\": {\n \"pageSize\": 0,\n \"rowOffset\": 0\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/jobs/list"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"configId\": \"\",\n \"configTypes\": [],\n \"includingJobId\": 0,\n \"pagination\": {\n \"pageSize\": 0,\n \"rowOffset\": 0\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"configId\": \"\",\n \"configTypes\": [],\n \"includingJobId\": 0,\n \"pagination\": {\n \"pageSize\": 0,\n \"rowOffset\": 0\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/jobs/list")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/jobs/list")
.header("content-type", "application/json")
.body("{\n \"configId\": \"\",\n \"configTypes\": [],\n \"includingJobId\": 0,\n \"pagination\": {\n \"pageSize\": 0,\n \"rowOffset\": 0\n }\n}")
.asString();
const data = JSON.stringify({
configId: '',
configTypes: [],
includingJobId: 0,
pagination: {
pageSize: 0,
rowOffset: 0
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/jobs/list');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/jobs/list',
headers: {'content-type': 'application/json'},
data: {
configId: '',
configTypes: [],
includingJobId: 0,
pagination: {pageSize: 0, rowOffset: 0}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/jobs/list';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"configId":"","configTypes":[],"includingJobId":0,"pagination":{"pageSize":0,"rowOffset":0}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/jobs/list',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "configId": "",\n "configTypes": [],\n "includingJobId": 0,\n "pagination": {\n "pageSize": 0,\n "rowOffset": 0\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"configId\": \"\",\n \"configTypes\": [],\n \"includingJobId\": 0,\n \"pagination\": {\n \"pageSize\": 0,\n \"rowOffset\": 0\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/jobs/list")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/jobs/list',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
configId: '',
configTypes: [],
includingJobId: 0,
pagination: {pageSize: 0, rowOffset: 0}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/jobs/list',
headers: {'content-type': 'application/json'},
body: {
configId: '',
configTypes: [],
includingJobId: 0,
pagination: {pageSize: 0, rowOffset: 0}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/jobs/list');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
configId: '',
configTypes: [],
includingJobId: 0,
pagination: {
pageSize: 0,
rowOffset: 0
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/jobs/list',
headers: {'content-type': 'application/json'},
data: {
configId: '',
configTypes: [],
includingJobId: 0,
pagination: {pageSize: 0, rowOffset: 0}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/jobs/list';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"configId":"","configTypes":[],"includingJobId":0,"pagination":{"pageSize":0,"rowOffset":0}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"configId": @"",
@"configTypes": @[ ],
@"includingJobId": @0,
@"pagination": @{ @"pageSize": @0, @"rowOffset": @0 } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/jobs/list"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/jobs/list" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"configId\": \"\",\n \"configTypes\": [],\n \"includingJobId\": 0,\n \"pagination\": {\n \"pageSize\": 0,\n \"rowOffset\": 0\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/jobs/list",
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([
'configId' => '',
'configTypes' => [
],
'includingJobId' => 0,
'pagination' => [
'pageSize' => 0,
'rowOffset' => 0
]
]),
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;
}
request('POST', '{{baseUrl}}/v1/jobs/list', [
'body' => '{
"configId": "",
"configTypes": [],
"includingJobId": 0,
"pagination": {
"pageSize": 0,
"rowOffset": 0
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/jobs/list');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'configId' => '',
'configTypes' => [
],
'includingJobId' => 0,
'pagination' => [
'pageSize' => 0,
'rowOffset' => 0
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'configId' => '',
'configTypes' => [
],
'includingJobId' => 0,
'pagination' => [
'pageSize' => 0,
'rowOffset' => 0
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/jobs/list');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/jobs/list' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"configId": "",
"configTypes": [],
"includingJobId": 0,
"pagination": {
"pageSize": 0,
"rowOffset": 0
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/jobs/list' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"configId": "",
"configTypes": [],
"includingJobId": 0,
"pagination": {
"pageSize": 0,
"rowOffset": 0
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"configId\": \"\",\n \"configTypes\": [],\n \"includingJobId\": 0,\n \"pagination\": {\n \"pageSize\": 0,\n \"rowOffset\": 0\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/jobs/list", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/jobs/list"
payload = {
"configId": "",
"configTypes": [],
"includingJobId": 0,
"pagination": {
"pageSize": 0,
"rowOffset": 0
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/jobs/list"
payload <- "{\n \"configId\": \"\",\n \"configTypes\": [],\n \"includingJobId\": 0,\n \"pagination\": {\n \"pageSize\": 0,\n \"rowOffset\": 0\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/jobs/list")
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 \"configId\": \"\",\n \"configTypes\": [],\n \"includingJobId\": 0,\n \"pagination\": {\n \"pageSize\": 0,\n \"rowOffset\": 0\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/jobs/list') do |req|
req.body = "{\n \"configId\": \"\",\n \"configTypes\": [],\n \"includingJobId\": 0,\n \"pagination\": {\n \"pageSize\": 0,\n \"rowOffset\": 0\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/jobs/list";
let payload = json!({
"configId": "",
"configTypes": (),
"includingJobId": 0,
"pagination": json!({
"pageSize": 0,
"rowOffset": 0
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/jobs/list \
--header 'content-type: application/json' \
--data '{
"configId": "",
"configTypes": [],
"includingJobId": 0,
"pagination": {
"pageSize": 0,
"rowOffset": 0
}
}'
echo '{
"configId": "",
"configTypes": [],
"includingJobId": 0,
"pagination": {
"pageSize": 0,
"rowOffset": 0
}
}' | \
http POST {{baseUrl}}/v1/jobs/list \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "configId": "",\n "configTypes": [],\n "includingJobId": 0,\n "pagination": {\n "pageSize": 0,\n "rowOffset": 0\n }\n}' \
--output-document \
- {{baseUrl}}/v1/jobs/list
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"configId": "",
"configTypes": [],
"includingJobId": 0,
"pagination": [
"pageSize": 0,
"rowOffset": 0
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/jobs/list")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
getLastReplicationJob
{{baseUrl}}/v1/jobs/get_last_replication_job
BODY json
{
"connectionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/jobs/get_last_replication_job");
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 \"connectionId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/jobs/get_last_replication_job" {:content-type :json
:form-params {:connectionId ""}})
require "http/client"
url = "{{baseUrl}}/v1/jobs/get_last_replication_job"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"connectionId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/jobs/get_last_replication_job"),
Content = new StringContent("{\n \"connectionId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/jobs/get_last_replication_job");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"connectionId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/jobs/get_last_replication_job"
payload := strings.NewReader("{\n \"connectionId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/jobs/get_last_replication_job HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 24
{
"connectionId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/jobs/get_last_replication_job")
.setHeader("content-type", "application/json")
.setBody("{\n \"connectionId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/jobs/get_last_replication_job"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"connectionId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"connectionId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/jobs/get_last_replication_job")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/jobs/get_last_replication_job")
.header("content-type", "application/json")
.body("{\n \"connectionId\": \"\"\n}")
.asString();
const data = JSON.stringify({
connectionId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/jobs/get_last_replication_job');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/jobs/get_last_replication_job',
headers: {'content-type': 'application/json'},
data: {connectionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/jobs/get_last_replication_job';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/jobs/get_last_replication_job',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "connectionId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"connectionId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/jobs/get_last_replication_job")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/jobs/get_last_replication_job',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({connectionId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/jobs/get_last_replication_job',
headers: {'content-type': 'application/json'},
body: {connectionId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/jobs/get_last_replication_job');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
connectionId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/jobs/get_last_replication_job',
headers: {'content-type': 'application/json'},
data: {connectionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/jobs/get_last_replication_job';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"connectionId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/jobs/get_last_replication_job"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/jobs/get_last_replication_job" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"connectionId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/jobs/get_last_replication_job",
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([
'connectionId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/jobs/get_last_replication_job', [
'body' => '{
"connectionId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/jobs/get_last_replication_job');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'connectionId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'connectionId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/jobs/get_last_replication_job');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/jobs/get_last_replication_job' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/jobs/get_last_replication_job' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"connectionId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/jobs/get_last_replication_job", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/jobs/get_last_replication_job"
payload = { "connectionId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/jobs/get_last_replication_job"
payload <- "{\n \"connectionId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/jobs/get_last_replication_job")
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 \"connectionId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/jobs/get_last_replication_job') do |req|
req.body = "{\n \"connectionId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/jobs/get_last_replication_job";
let payload = json!({"connectionId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/jobs/get_last_replication_job \
--header 'content-type: application/json' \
--data '{
"connectionId": ""
}'
echo '{
"connectionId": ""
}' | \
http POST {{baseUrl}}/v1/jobs/get_last_replication_job \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "connectionId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/jobs/get_last_replication_job
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["connectionId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/jobs/get_last_replication_job")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Get logs
{{baseUrl}}/v1/logs/get
BODY json
{
"logType": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/logs/get");
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 \"logType\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/logs/get" {:content-type :json
:form-params {:logType ""}})
require "http/client"
url = "{{baseUrl}}/v1/logs/get"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"logType\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/logs/get"),
Content = new StringContent("{\n \"logType\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/logs/get");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"logType\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/logs/get"
payload := strings.NewReader("{\n \"logType\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/logs/get HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 19
{
"logType": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/logs/get")
.setHeader("content-type", "application/json")
.setBody("{\n \"logType\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/logs/get"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"logType\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"logType\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/logs/get")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/logs/get")
.header("content-type", "application/json")
.body("{\n \"logType\": \"\"\n}")
.asString();
const data = JSON.stringify({
logType: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/logs/get');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/logs/get',
headers: {'content-type': 'application/json'},
data: {logType: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/logs/get';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"logType":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/logs/get',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "logType": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"logType\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/logs/get")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/logs/get',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({logType: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/logs/get',
headers: {'content-type': 'application/json'},
body: {logType: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/logs/get');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
logType: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/logs/get',
headers: {'content-type': 'application/json'},
data: {logType: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/logs/get';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"logType":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"logType": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/logs/get"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/logs/get" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"logType\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/logs/get",
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([
'logType' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/logs/get', [
'body' => '{
"logType": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/logs/get');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'logType' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'logType' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/logs/get');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/logs/get' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"logType": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/logs/get' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"logType": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"logType\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/logs/get", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/logs/get"
payload = { "logType": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/logs/get"
payload <- "{\n \"logType\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/logs/get")
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 \"logType\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/logs/get') do |req|
req.body = "{\n \"logType\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/logs/get";
let payload = json!({"logType": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/logs/get \
--header 'content-type: application/json' \
--data '{
"logType": ""
}'
echo '{
"logType": ""
}' | \
http POST {{baseUrl}}/v1/logs/get \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "logType": ""\n}' \
--output-document \
- {{baseUrl}}/v1/logs/get
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["logType": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/logs/get")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Try sending a notifications
{{baseUrl}}/v1/notifications/try
BODY json
{
"customerioConfiguration": {},
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": {
"webhook": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/notifications/try");
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 \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/notifications/try" {:content-type :json
:form-params {:customerioConfiguration {}
:notificationType ""
:sendOnFailure false
:sendOnSuccess false
:slackConfiguration {:webhook ""}}})
require "http/client"
url = "{{baseUrl}}/v1/notifications/try"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/notifications/try"),
Content = new StringContent("{\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/notifications/try");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/notifications/try"
payload := strings.NewReader("{\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/notifications/try HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 162
{
"customerioConfiguration": {},
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": {
"webhook": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/notifications/try")
.setHeader("content-type", "application/json")
.setBody("{\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/notifications/try"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/notifications/try")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/notifications/try")
.header("content-type", "application/json")
.body("{\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
customerioConfiguration: {},
notificationType: '',
sendOnFailure: false,
sendOnSuccess: false,
slackConfiguration: {
webhook: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/notifications/try');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/notifications/try',
headers: {'content-type': 'application/json'},
data: {
customerioConfiguration: {},
notificationType: '',
sendOnFailure: false,
sendOnSuccess: false,
slackConfiguration: {webhook: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/notifications/try';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"customerioConfiguration":{},"notificationType":"","sendOnFailure":false,"sendOnSuccess":false,"slackConfiguration":{"webhook":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/notifications/try',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "customerioConfiguration": {},\n "notificationType": "",\n "sendOnFailure": false,\n "sendOnSuccess": false,\n "slackConfiguration": {\n "webhook": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/notifications/try")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/notifications/try',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
customerioConfiguration: {},
notificationType: '',
sendOnFailure: false,
sendOnSuccess: false,
slackConfiguration: {webhook: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/notifications/try',
headers: {'content-type': 'application/json'},
body: {
customerioConfiguration: {},
notificationType: '',
sendOnFailure: false,
sendOnSuccess: false,
slackConfiguration: {webhook: ''}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/notifications/try');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
customerioConfiguration: {},
notificationType: '',
sendOnFailure: false,
sendOnSuccess: false,
slackConfiguration: {
webhook: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/notifications/try',
headers: {'content-type': 'application/json'},
data: {
customerioConfiguration: {},
notificationType: '',
sendOnFailure: false,
sendOnSuccess: false,
slackConfiguration: {webhook: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/notifications/try';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"customerioConfiguration":{},"notificationType":"","sendOnFailure":false,"sendOnSuccess":false,"slackConfiguration":{"webhook":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"customerioConfiguration": @{ },
@"notificationType": @"",
@"sendOnFailure": @NO,
@"sendOnSuccess": @NO,
@"slackConfiguration": @{ @"webhook": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/notifications/try"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/notifications/try" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/notifications/try",
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([
'customerioConfiguration' => [
],
'notificationType' => '',
'sendOnFailure' => null,
'sendOnSuccess' => null,
'slackConfiguration' => [
'webhook' => ''
]
]),
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;
}
request('POST', '{{baseUrl}}/v1/notifications/try', [
'body' => '{
"customerioConfiguration": {},
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": {
"webhook": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/notifications/try');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'customerioConfiguration' => [
],
'notificationType' => '',
'sendOnFailure' => null,
'sendOnSuccess' => null,
'slackConfiguration' => [
'webhook' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'customerioConfiguration' => [
],
'notificationType' => '',
'sendOnFailure' => null,
'sendOnSuccess' => null,
'slackConfiguration' => [
'webhook' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/notifications/try');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/notifications/try' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"customerioConfiguration": {},
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": {
"webhook": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/notifications/try' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"customerioConfiguration": {},
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": {
"webhook": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/notifications/try", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/notifications/try"
payload = {
"customerioConfiguration": {},
"notificationType": "",
"sendOnFailure": False,
"sendOnSuccess": False,
"slackConfiguration": { "webhook": "" }
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/notifications/try"
payload <- "{\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/notifications/try")
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 \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/notifications/try') do |req|
req.body = "{\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/notifications/try";
let payload = json!({
"customerioConfiguration": json!({}),
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": json!({"webhook": ""})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/notifications/try \
--header 'content-type: application/json' \
--data '{
"customerioConfiguration": {},
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": {
"webhook": ""
}
}'
echo '{
"customerioConfiguration": {},
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": {
"webhook": ""
}
}' | \
http POST {{baseUrl}}/v1/notifications/try \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "customerioConfiguration": {},\n "notificationType": "",\n "sendOnFailure": false,\n "sendOnSuccess": false,\n "slackConfiguration": {\n "webhook": ""\n }\n}' \
--output-document \
- {{baseUrl}}/v1/notifications/try
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"customerioConfiguration": [],
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": ["webhook": ""]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/notifications/try")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Returns the openapi specification
{{baseUrl}}/v1/openapi
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/openapi");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/openapi")
require "http/client"
url = "{{baseUrl}}/v1/openapi"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/openapi"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/openapi");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/openapi"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/openapi HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/openapi")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/openapi"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/openapi")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/openapi")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/v1/openapi');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1/openapi'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/openapi';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/openapi',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/openapi")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/openapi',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/v1/openapi'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/openapi');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/v1/openapi'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/openapi';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/openapi"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/openapi" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/openapi",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/openapi');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/openapi');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/openapi');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/openapi' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/openapi' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1/openapi")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/openapi"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/openapi"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/openapi")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/openapi') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/openapi";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/openapi
http GET {{baseUrl}}/v1/openapi
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1/openapi
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/openapi")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Check if an operation to be created is valid
{{baseUrl}}/v1/operations/check
BODY json
{
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/operations/check");
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 \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/operations/check" {:content-type :json
:form-params {:dbt {:dbtArguments ""
:dockerImage ""
:gitRepoBranch ""
:gitRepoUrl ""}
:normalization {:option ""}
:operatorType ""
:webhook {:dbtCloud {:accountId 0
:jobId 0}
:executionBody ""
:executionUrl ""
:webhookConfigId ""
:webhookType ""}}})
require "http/client"
url = "{{baseUrl}}/v1/operations/check"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/operations/check"),
Content = new StringContent("{\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/operations/check");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/operations/check"
payload := strings.NewReader("{\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/operations/check HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 358
{
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/operations/check")
.setHeader("content-type", "application/json")
.setBody("{\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/operations/check"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/operations/check")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/operations/check")
.header("content-type", "application/json")
.body("{\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
dbt: {
dbtArguments: '',
dockerImage: '',
gitRepoBranch: '',
gitRepoUrl: ''
},
normalization: {
option: ''
},
operatorType: '',
webhook: {
dbtCloud: {
accountId: 0,
jobId: 0
},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/operations/check');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/operations/check',
headers: {'content-type': 'application/json'},
data: {
dbt: {dbtArguments: '', dockerImage: '', gitRepoBranch: '', gitRepoUrl: ''},
normalization: {option: ''},
operatorType: '',
webhook: {
dbtCloud: {accountId: 0, jobId: 0},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/operations/check';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"dbt":{"dbtArguments":"","dockerImage":"","gitRepoBranch":"","gitRepoUrl":""},"normalization":{"option":""},"operatorType":"","webhook":{"dbtCloud":{"accountId":0,"jobId":0},"executionBody":"","executionUrl":"","webhookConfigId":"","webhookType":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/operations/check',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "dbt": {\n "dbtArguments": "",\n "dockerImage": "",\n "gitRepoBranch": "",\n "gitRepoUrl": ""\n },\n "normalization": {\n "option": ""\n },\n "operatorType": "",\n "webhook": {\n "dbtCloud": {\n "accountId": 0,\n "jobId": 0\n },\n "executionBody": "",\n "executionUrl": "",\n "webhookConfigId": "",\n "webhookType": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/operations/check")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/operations/check',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
dbt: {dbtArguments: '', dockerImage: '', gitRepoBranch: '', gitRepoUrl: ''},
normalization: {option: ''},
operatorType: '',
webhook: {
dbtCloud: {accountId: 0, jobId: 0},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/operations/check',
headers: {'content-type': 'application/json'},
body: {
dbt: {dbtArguments: '', dockerImage: '', gitRepoBranch: '', gitRepoUrl: ''},
normalization: {option: ''},
operatorType: '',
webhook: {
dbtCloud: {accountId: 0, jobId: 0},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/operations/check');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
dbt: {
dbtArguments: '',
dockerImage: '',
gitRepoBranch: '',
gitRepoUrl: ''
},
normalization: {
option: ''
},
operatorType: '',
webhook: {
dbtCloud: {
accountId: 0,
jobId: 0
},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/operations/check',
headers: {'content-type': 'application/json'},
data: {
dbt: {dbtArguments: '', dockerImage: '', gitRepoBranch: '', gitRepoUrl: ''},
normalization: {option: ''},
operatorType: '',
webhook: {
dbtCloud: {accountId: 0, jobId: 0},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/operations/check';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"dbt":{"dbtArguments":"","dockerImage":"","gitRepoBranch":"","gitRepoUrl":""},"normalization":{"option":""},"operatorType":"","webhook":{"dbtCloud":{"accountId":0,"jobId":0},"executionBody":"","executionUrl":"","webhookConfigId":"","webhookType":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"dbt": @{ @"dbtArguments": @"", @"dockerImage": @"", @"gitRepoBranch": @"", @"gitRepoUrl": @"" },
@"normalization": @{ @"option": @"" },
@"operatorType": @"",
@"webhook": @{ @"dbtCloud": @{ @"accountId": @0, @"jobId": @0 }, @"executionBody": @"", @"executionUrl": @"", @"webhookConfigId": @"", @"webhookType": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/operations/check"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/operations/check" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/operations/check",
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([
'dbt' => [
'dbtArguments' => '',
'dockerImage' => '',
'gitRepoBranch' => '',
'gitRepoUrl' => ''
],
'normalization' => [
'option' => ''
],
'operatorType' => '',
'webhook' => [
'dbtCloud' => [
'accountId' => 0,
'jobId' => 0
],
'executionBody' => '',
'executionUrl' => '',
'webhookConfigId' => '',
'webhookType' => ''
]
]),
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;
}
request('POST', '{{baseUrl}}/v1/operations/check', [
'body' => '{
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/operations/check');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'dbt' => [
'dbtArguments' => '',
'dockerImage' => '',
'gitRepoBranch' => '',
'gitRepoUrl' => ''
],
'normalization' => [
'option' => ''
],
'operatorType' => '',
'webhook' => [
'dbtCloud' => [
'accountId' => 0,
'jobId' => 0
],
'executionBody' => '',
'executionUrl' => '',
'webhookConfigId' => '',
'webhookType' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'dbt' => [
'dbtArguments' => '',
'dockerImage' => '',
'gitRepoBranch' => '',
'gitRepoUrl' => ''
],
'normalization' => [
'option' => ''
],
'operatorType' => '',
'webhook' => [
'dbtCloud' => [
'accountId' => 0,
'jobId' => 0
],
'executionBody' => '',
'executionUrl' => '',
'webhookConfigId' => '',
'webhookType' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/operations/check');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/operations/check' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/operations/check' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/operations/check", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/operations/check"
payload = {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": { "option": "" },
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/operations/check"
payload <- "{\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/operations/check")
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 \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/operations/check') do |req|
req.body = "{\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/operations/check";
let payload = json!({
"dbt": json!({
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
}),
"normalization": json!({"option": ""}),
"operatorType": "",
"webhook": json!({
"dbtCloud": json!({
"accountId": 0,
"jobId": 0
}),
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/operations/check \
--header 'content-type: application/json' \
--data '{
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
}'
echo '{
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
}' | \
http POST {{baseUrl}}/v1/operations/check \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "dbt": {\n "dbtArguments": "",\n "dockerImage": "",\n "gitRepoBranch": "",\n "gitRepoUrl": ""\n },\n "normalization": {\n "option": ""\n },\n "operatorType": "",\n "webhook": {\n "dbtCloud": {\n "accountId": 0,\n "jobId": 0\n },\n "executionBody": "",\n "executionUrl": "",\n "webhookConfigId": "",\n "webhookType": ""\n }\n}' \
--output-document \
- {{baseUrl}}/v1/operations/check
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"dbt": [
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
],
"normalization": ["option": ""],
"operatorType": "",
"webhook": [
"dbtCloud": [
"accountId": 0,
"jobId": 0
],
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/operations/check")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Create an operation to be applied as part of a connection pipeline
{{baseUrl}}/v1/operations/create
BODY json
{
"name": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
},
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/operations/create");
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\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/operations/create" {:content-type :json
:form-params {:name ""
:operatorConfiguration {:dbt {:dbtArguments ""
:dockerImage ""
:gitRepoBranch ""
:gitRepoUrl ""}
:normalization {:option ""}
:operatorType ""
:webhook {:dbtCloud {:accountId 0
:jobId 0}
:executionBody ""
:executionUrl ""
:webhookConfigId ""
:webhookType ""}}
:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/operations/create"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/operations/create"),
Content = new StringContent("{\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/operations/create");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/operations/create"
payload := strings.NewReader("{\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/operations/create HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 466
{
"name": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
},
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/operations/create")
.setHeader("content-type", "application/json")
.setBody("{\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/operations/create"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/operations/create")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/operations/create")
.header("content-type", "application/json")
.body("{\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
name: '',
operatorConfiguration: {
dbt: {
dbtArguments: '',
dockerImage: '',
gitRepoBranch: '',
gitRepoUrl: ''
},
normalization: {
option: ''
},
operatorType: '',
webhook: {
dbtCloud: {
accountId: 0,
jobId: 0
},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
},
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/operations/create');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/operations/create',
headers: {'content-type': 'application/json'},
data: {
name: '',
operatorConfiguration: {
dbt: {dbtArguments: '', dockerImage: '', gitRepoBranch: '', gitRepoUrl: ''},
normalization: {option: ''},
operatorType: '',
webhook: {
dbtCloud: {accountId: 0, jobId: 0},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
},
workspaceId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/operations/create';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"name":"","operatorConfiguration":{"dbt":{"dbtArguments":"","dockerImage":"","gitRepoBranch":"","gitRepoUrl":""},"normalization":{"option":""},"operatorType":"","webhook":{"dbtCloud":{"accountId":0,"jobId":0},"executionBody":"","executionUrl":"","webhookConfigId":"","webhookType":""}},"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/operations/create',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "name": "",\n "operatorConfiguration": {\n "dbt": {\n "dbtArguments": "",\n "dockerImage": "",\n "gitRepoBranch": "",\n "gitRepoUrl": ""\n },\n "normalization": {\n "option": ""\n },\n "operatorType": "",\n "webhook": {\n "dbtCloud": {\n "accountId": 0,\n "jobId": 0\n },\n "executionBody": "",\n "executionUrl": "",\n "webhookConfigId": "",\n "webhookType": ""\n }\n },\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/operations/create")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/operations/create',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
name: '',
operatorConfiguration: {
dbt: {dbtArguments: '', dockerImage: '', gitRepoBranch: '', gitRepoUrl: ''},
normalization: {option: ''},
operatorType: '',
webhook: {
dbtCloud: {accountId: 0, jobId: 0},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
},
workspaceId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/operations/create',
headers: {'content-type': 'application/json'},
body: {
name: '',
operatorConfiguration: {
dbt: {dbtArguments: '', dockerImage: '', gitRepoBranch: '', gitRepoUrl: ''},
normalization: {option: ''},
operatorType: '',
webhook: {
dbtCloud: {accountId: 0, jobId: 0},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
},
workspaceId: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/operations/create');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
name: '',
operatorConfiguration: {
dbt: {
dbtArguments: '',
dockerImage: '',
gitRepoBranch: '',
gitRepoUrl: ''
},
normalization: {
option: ''
},
operatorType: '',
webhook: {
dbtCloud: {
accountId: 0,
jobId: 0
},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
},
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/operations/create',
headers: {'content-type': 'application/json'},
data: {
name: '',
operatorConfiguration: {
dbt: {dbtArguments: '', dockerImage: '', gitRepoBranch: '', gitRepoUrl: ''},
normalization: {option: ''},
operatorType: '',
webhook: {
dbtCloud: {accountId: 0, jobId: 0},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
},
workspaceId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/operations/create';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"name":"","operatorConfiguration":{"dbt":{"dbtArguments":"","dockerImage":"","gitRepoBranch":"","gitRepoUrl":""},"normalization":{"option":""},"operatorType":"","webhook":{"dbtCloud":{"accountId":0,"jobId":0},"executionBody":"","executionUrl":"","webhookConfigId":"","webhookType":""}},"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"name": @"",
@"operatorConfiguration": @{ @"dbt": @{ @"dbtArguments": @"", @"dockerImage": @"", @"gitRepoBranch": @"", @"gitRepoUrl": @"" }, @"normalization": @{ @"option": @"" }, @"operatorType": @"", @"webhook": @{ @"dbtCloud": @{ @"accountId": @0, @"jobId": @0 }, @"executionBody": @"", @"executionUrl": @"", @"webhookConfigId": @"", @"webhookType": @"" } },
@"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/operations/create"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/operations/create" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/operations/create",
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' => '',
'operatorConfiguration' => [
'dbt' => [
'dbtArguments' => '',
'dockerImage' => '',
'gitRepoBranch' => '',
'gitRepoUrl' => ''
],
'normalization' => [
'option' => ''
],
'operatorType' => '',
'webhook' => [
'dbtCloud' => [
'accountId' => 0,
'jobId' => 0
],
'executionBody' => '',
'executionUrl' => '',
'webhookConfigId' => '',
'webhookType' => ''
]
],
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/operations/create', [
'body' => '{
"name": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
},
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/operations/create');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'name' => '',
'operatorConfiguration' => [
'dbt' => [
'dbtArguments' => '',
'dockerImage' => '',
'gitRepoBranch' => '',
'gitRepoUrl' => ''
],
'normalization' => [
'option' => ''
],
'operatorType' => '',
'webhook' => [
'dbtCloud' => [
'accountId' => 0,
'jobId' => 0
],
'executionBody' => '',
'executionUrl' => '',
'webhookConfigId' => '',
'webhookType' => ''
]
],
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'name' => '',
'operatorConfiguration' => [
'dbt' => [
'dbtArguments' => '',
'dockerImage' => '',
'gitRepoBranch' => '',
'gitRepoUrl' => ''
],
'normalization' => [
'option' => ''
],
'operatorType' => '',
'webhook' => [
'dbtCloud' => [
'accountId' => 0,
'jobId' => 0
],
'executionBody' => '',
'executionUrl' => '',
'webhookConfigId' => '',
'webhookType' => ''
]
],
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/operations/create');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/operations/create' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
},
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/operations/create' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
},
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/operations/create", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/operations/create"
payload = {
"name": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": { "option": "" },
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
},
"workspaceId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/operations/create"
payload <- "{\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/operations/create")
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\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/operations/create') do |req|
req.body = "{\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/operations/create";
let payload = json!({
"name": "",
"operatorConfiguration": json!({
"dbt": json!({
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
}),
"normalization": json!({"option": ""}),
"operatorType": "",
"webhook": json!({
"dbtCloud": json!({
"accountId": 0,
"jobId": 0
}),
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
})
}),
"workspaceId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/operations/create \
--header 'content-type: application/json' \
--data '{
"name": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
},
"workspaceId": ""
}'
echo '{
"name": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
},
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/operations/create \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "name": "",\n "operatorConfiguration": {\n "dbt": {\n "dbtArguments": "",\n "dockerImage": "",\n "gitRepoBranch": "",\n "gitRepoUrl": ""\n },\n "normalization": {\n "option": ""\n },\n "operatorType": "",\n "webhook": {\n "dbtCloud": {\n "accountId": 0,\n "jobId": 0\n },\n "executionBody": "",\n "executionUrl": "",\n "webhookConfigId": "",\n "webhookType": ""\n }\n },\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/operations/create
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"name": "",
"operatorConfiguration": [
"dbt": [
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
],
"normalization": ["option": ""],
"operatorType": "",
"webhook": [
"dbtCloud": [
"accountId": 0,
"jobId": 0
],
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
]
],
"workspaceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/operations/create")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Delete an operation
{{baseUrl}}/v1/operations/delete
BODY json
{
"operationId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/operations/delete");
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 \"operationId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/operations/delete" {:content-type :json
:form-params {:operationId ""}})
require "http/client"
url = "{{baseUrl}}/v1/operations/delete"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"operationId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/operations/delete"),
Content = new StringContent("{\n \"operationId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/operations/delete");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"operationId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/operations/delete"
payload := strings.NewReader("{\n \"operationId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/operations/delete HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"operationId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/operations/delete")
.setHeader("content-type", "application/json")
.setBody("{\n \"operationId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/operations/delete"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"operationId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"operationId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/operations/delete")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/operations/delete")
.header("content-type", "application/json")
.body("{\n \"operationId\": \"\"\n}")
.asString();
const data = JSON.stringify({
operationId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/operations/delete');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/operations/delete',
headers: {'content-type': 'application/json'},
data: {operationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/operations/delete';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"operationId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/operations/delete',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "operationId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"operationId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/operations/delete")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/operations/delete',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({operationId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/operations/delete',
headers: {'content-type': 'application/json'},
body: {operationId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/operations/delete');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
operationId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/operations/delete',
headers: {'content-type': 'application/json'},
data: {operationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/operations/delete';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"operationId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"operationId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/operations/delete"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/operations/delete" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"operationId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/operations/delete",
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([
'operationId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/operations/delete', [
'body' => '{
"operationId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/operations/delete');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'operationId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'operationId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/operations/delete');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/operations/delete' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"operationId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/operations/delete' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"operationId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"operationId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/operations/delete", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/operations/delete"
payload = { "operationId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/operations/delete"
payload <- "{\n \"operationId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/operations/delete")
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 \"operationId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/operations/delete') do |req|
req.body = "{\n \"operationId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/operations/delete";
let payload = json!({"operationId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/operations/delete \
--header 'content-type: application/json' \
--data '{
"operationId": ""
}'
echo '{
"operationId": ""
}' | \
http POST {{baseUrl}}/v1/operations/delete \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "operationId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/operations/delete
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["operationId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/operations/delete")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Returns all operations for a connection.
{{baseUrl}}/v1/operations/list
BODY json
{
"connectionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/operations/list");
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 \"connectionId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/operations/list" {:content-type :json
:form-params {:connectionId ""}})
require "http/client"
url = "{{baseUrl}}/v1/operations/list"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"connectionId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/operations/list"),
Content = new StringContent("{\n \"connectionId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/operations/list");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"connectionId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/operations/list"
payload := strings.NewReader("{\n \"connectionId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/operations/list HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 24
{
"connectionId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/operations/list")
.setHeader("content-type", "application/json")
.setBody("{\n \"connectionId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/operations/list"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"connectionId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"connectionId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/operations/list")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/operations/list")
.header("content-type", "application/json")
.body("{\n \"connectionId\": \"\"\n}")
.asString();
const data = JSON.stringify({
connectionId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/operations/list');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/operations/list',
headers: {'content-type': 'application/json'},
data: {connectionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/operations/list';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/operations/list',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "connectionId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"connectionId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/operations/list")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/operations/list',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({connectionId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/operations/list',
headers: {'content-type': 'application/json'},
body: {connectionId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/operations/list');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
connectionId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/operations/list',
headers: {'content-type': 'application/json'},
data: {connectionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/operations/list';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"connectionId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/operations/list"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/operations/list" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"connectionId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/operations/list",
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([
'connectionId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/operations/list', [
'body' => '{
"connectionId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/operations/list');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'connectionId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'connectionId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/operations/list');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/operations/list' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/operations/list' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"connectionId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/operations/list", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/operations/list"
payload = { "connectionId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/operations/list"
payload <- "{\n \"connectionId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/operations/list")
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 \"connectionId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/operations/list') do |req|
req.body = "{\n \"connectionId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/operations/list";
let payload = json!({"connectionId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/operations/list \
--header 'content-type: application/json' \
--data '{
"connectionId": ""
}'
echo '{
"connectionId": ""
}' | \
http POST {{baseUrl}}/v1/operations/list \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "connectionId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/operations/list
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["connectionId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/operations/list")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Returns an operation
{{baseUrl}}/v1/operations/get
BODY json
{
"operationId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/operations/get");
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 \"operationId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/operations/get" {:content-type :json
:form-params {:operationId ""}})
require "http/client"
url = "{{baseUrl}}/v1/operations/get"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"operationId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/operations/get"),
Content = new StringContent("{\n \"operationId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/operations/get");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"operationId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/operations/get"
payload := strings.NewReader("{\n \"operationId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/operations/get HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"operationId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/operations/get")
.setHeader("content-type", "application/json")
.setBody("{\n \"operationId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/operations/get"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"operationId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"operationId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/operations/get")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/operations/get")
.header("content-type", "application/json")
.body("{\n \"operationId\": \"\"\n}")
.asString();
const data = JSON.stringify({
operationId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/operations/get');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/operations/get',
headers: {'content-type': 'application/json'},
data: {operationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/operations/get';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"operationId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/operations/get',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "operationId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"operationId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/operations/get")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/operations/get',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({operationId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/operations/get',
headers: {'content-type': 'application/json'},
body: {operationId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/operations/get');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
operationId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/operations/get',
headers: {'content-type': 'application/json'},
data: {operationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/operations/get';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"operationId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"operationId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/operations/get"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/operations/get" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"operationId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/operations/get",
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([
'operationId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/operations/get', [
'body' => '{
"operationId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/operations/get');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'operationId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'operationId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/operations/get');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/operations/get' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"operationId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/operations/get' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"operationId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"operationId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/operations/get", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/operations/get"
payload = { "operationId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/operations/get"
payload <- "{\n \"operationId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/operations/get")
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 \"operationId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/operations/get') do |req|
req.body = "{\n \"operationId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/operations/get";
let payload = json!({"operationId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/operations/get \
--header 'content-type: application/json' \
--data '{
"operationId": ""
}'
echo '{
"operationId": ""
}' | \
http POST {{baseUrl}}/v1/operations/get \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "operationId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/operations/get
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["operationId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/operations/get")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Update an operation
{{baseUrl}}/v1/operations/update
BODY json
{
"name": "",
"operationId": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/operations/update");
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\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/operations/update" {:content-type :json
:form-params {:name ""
:operationId ""
:operatorConfiguration {:dbt {:dbtArguments ""
:dockerImage ""
:gitRepoBranch ""
:gitRepoUrl ""}
:normalization {:option ""}
:operatorType ""
:webhook {:dbtCloud {:accountId 0
:jobId 0}
:executionBody ""
:executionUrl ""
:webhookConfigId ""
:webhookType ""}}}})
require "http/client"
url = "{{baseUrl}}/v1/operations/update"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/operations/update"),
Content = new StringContent("{\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/operations/update");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/operations/update"
payload := strings.NewReader("{\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/operations/update HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 466
{
"name": "",
"operationId": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/operations/update")
.setHeader("content-type", "application/json")
.setBody("{\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/operations/update"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/operations/update")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/operations/update")
.header("content-type", "application/json")
.body("{\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n }\n}")
.asString();
const data = JSON.stringify({
name: '',
operationId: '',
operatorConfiguration: {
dbt: {
dbtArguments: '',
dockerImage: '',
gitRepoBranch: '',
gitRepoUrl: ''
},
normalization: {
option: ''
},
operatorType: '',
webhook: {
dbtCloud: {
accountId: 0,
jobId: 0
},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/operations/update');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/operations/update',
headers: {'content-type': 'application/json'},
data: {
name: '',
operationId: '',
operatorConfiguration: {
dbt: {dbtArguments: '', dockerImage: '', gitRepoBranch: '', gitRepoUrl: ''},
normalization: {option: ''},
operatorType: '',
webhook: {
dbtCloud: {accountId: 0, jobId: 0},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/operations/update';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"name":"","operationId":"","operatorConfiguration":{"dbt":{"dbtArguments":"","dockerImage":"","gitRepoBranch":"","gitRepoUrl":""},"normalization":{"option":""},"operatorType":"","webhook":{"dbtCloud":{"accountId":0,"jobId":0},"executionBody":"","executionUrl":"","webhookConfigId":"","webhookType":""}}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/operations/update',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "name": "",\n "operationId": "",\n "operatorConfiguration": {\n "dbt": {\n "dbtArguments": "",\n "dockerImage": "",\n "gitRepoBranch": "",\n "gitRepoUrl": ""\n },\n "normalization": {\n "option": ""\n },\n "operatorType": "",\n "webhook": {\n "dbtCloud": {\n "accountId": 0,\n "jobId": 0\n },\n "executionBody": "",\n "executionUrl": "",\n "webhookConfigId": "",\n "webhookType": ""\n }\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/operations/update")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/operations/update',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
name: '',
operationId: '',
operatorConfiguration: {
dbt: {dbtArguments: '', dockerImage: '', gitRepoBranch: '', gitRepoUrl: ''},
normalization: {option: ''},
operatorType: '',
webhook: {
dbtCloud: {accountId: 0, jobId: 0},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/operations/update',
headers: {'content-type': 'application/json'},
body: {
name: '',
operationId: '',
operatorConfiguration: {
dbt: {dbtArguments: '', dockerImage: '', gitRepoBranch: '', gitRepoUrl: ''},
normalization: {option: ''},
operatorType: '',
webhook: {
dbtCloud: {accountId: 0, jobId: 0},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/operations/update');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
name: '',
operationId: '',
operatorConfiguration: {
dbt: {
dbtArguments: '',
dockerImage: '',
gitRepoBranch: '',
gitRepoUrl: ''
},
normalization: {
option: ''
},
operatorType: '',
webhook: {
dbtCloud: {
accountId: 0,
jobId: 0
},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/operations/update',
headers: {'content-type': 'application/json'},
data: {
name: '',
operationId: '',
operatorConfiguration: {
dbt: {dbtArguments: '', dockerImage: '', gitRepoBranch: '', gitRepoUrl: ''},
normalization: {option: ''},
operatorType: '',
webhook: {
dbtCloud: {accountId: 0, jobId: 0},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/operations/update';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"name":"","operationId":"","operatorConfiguration":{"dbt":{"dbtArguments":"","dockerImage":"","gitRepoBranch":"","gitRepoUrl":""},"normalization":{"option":""},"operatorType":"","webhook":{"dbtCloud":{"accountId":0,"jobId":0},"executionBody":"","executionUrl":"","webhookConfigId":"","webhookType":""}}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"name": @"",
@"operationId": @"",
@"operatorConfiguration": @{ @"dbt": @{ @"dbtArguments": @"", @"dockerImage": @"", @"gitRepoBranch": @"", @"gitRepoUrl": @"" }, @"normalization": @{ @"option": @"" }, @"operatorType": @"", @"webhook": @{ @"dbtCloud": @{ @"accountId": @0, @"jobId": @0 }, @"executionBody": @"", @"executionUrl": @"", @"webhookConfigId": @"", @"webhookType": @"" } } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/operations/update"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/operations/update" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/operations/update",
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' => '',
'operationId' => '',
'operatorConfiguration' => [
'dbt' => [
'dbtArguments' => '',
'dockerImage' => '',
'gitRepoBranch' => '',
'gitRepoUrl' => ''
],
'normalization' => [
'option' => ''
],
'operatorType' => '',
'webhook' => [
'dbtCloud' => [
'accountId' => 0,
'jobId' => 0
],
'executionBody' => '',
'executionUrl' => '',
'webhookConfigId' => '',
'webhookType' => ''
]
]
]),
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;
}
request('POST', '{{baseUrl}}/v1/operations/update', [
'body' => '{
"name": "",
"operationId": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/operations/update');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'name' => '',
'operationId' => '',
'operatorConfiguration' => [
'dbt' => [
'dbtArguments' => '',
'dockerImage' => '',
'gitRepoBranch' => '',
'gitRepoUrl' => ''
],
'normalization' => [
'option' => ''
],
'operatorType' => '',
'webhook' => [
'dbtCloud' => [
'accountId' => 0,
'jobId' => 0
],
'executionBody' => '',
'executionUrl' => '',
'webhookConfigId' => '',
'webhookType' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'name' => '',
'operationId' => '',
'operatorConfiguration' => [
'dbt' => [
'dbtArguments' => '',
'dockerImage' => '',
'gitRepoBranch' => '',
'gitRepoUrl' => ''
],
'normalization' => [
'option' => ''
],
'operatorType' => '',
'webhook' => [
'dbtCloud' => [
'accountId' => 0,
'jobId' => 0
],
'executionBody' => '',
'executionUrl' => '',
'webhookConfigId' => '',
'webhookType' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/operations/update');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/operations/update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": "",
"operationId": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/operations/update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": "",
"operationId": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/operations/update", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/operations/update"
payload = {
"name": "",
"operationId": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": { "option": "" },
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/operations/update"
payload <- "{\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/operations/update")
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\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/operations/update') do |req|
req.body = "{\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/operations/update";
let payload = json!({
"name": "",
"operationId": "",
"operatorConfiguration": json!({
"dbt": json!({
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
}),
"normalization": json!({"option": ""}),
"operatorType": "",
"webhook": json!({
"dbtCloud": json!({
"accountId": 0,
"jobId": 0
}),
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
})
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/operations/update \
--header 'content-type: application/json' \
--data '{
"name": "",
"operationId": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
}
}'
echo '{
"name": "",
"operationId": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
}
}' | \
http POST {{baseUrl}}/v1/operations/update \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "name": "",\n "operationId": "",\n "operatorConfiguration": {\n "dbt": {\n "dbtArguments": "",\n "dockerImage": "",\n "gitRepoBranch": "",\n "gitRepoUrl": ""\n },\n "normalization": {\n "option": ""\n },\n "operatorType": "",\n "webhook": {\n "dbtCloud": {\n "accountId": 0,\n "jobId": 0\n },\n "executionBody": "",\n "executionUrl": "",\n "webhookConfigId": "",\n "webhookType": ""\n }\n }\n}' \
--output-document \
- {{baseUrl}}/v1/operations/update
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"name": "",
"operationId": "",
"operatorConfiguration": [
"dbt": [
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
],
"normalization": ["option": ""],
"operatorType": "",
"webhook": [
"dbtCloud": [
"accountId": 0,
"jobId": 0
],
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/operations/update")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Run check connection for a given destination configuration
{{baseUrl}}/v1/scheduler/destinations/check_connection
BODY json
{
"connectionConfiguration": "",
"destinationDefinitionId": "",
"destinationId": "",
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/scheduler/destinations/check_connection");
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 \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/scheduler/destinations/check_connection" {:content-type :json
:form-params {:connectionConfiguration {:user "charles"}}})
require "http/client"
url = "{{baseUrl}}/v1/scheduler/destinations/check_connection"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/scheduler/destinations/check_connection"),
Content = new StringContent("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/scheduler/destinations/check_connection");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/scheduler/destinations/check_connection"
payload := strings.NewReader("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/scheduler/destinations/check_connection HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 60
{
"connectionConfiguration": {
"user": "charles"
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/scheduler/destinations/check_connection")
.setHeader("content-type", "application/json")
.setBody("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/scheduler/destinations/check_connection"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/scheduler/destinations/check_connection")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/scheduler/destinations/check_connection")
.header("content-type", "application/json")
.body("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
.asString();
const data = JSON.stringify({
connectionConfiguration: {
user: 'charles'
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/scheduler/destinations/check_connection');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/scheduler/destinations/check_connection',
headers: {'content-type': 'application/json'},
data: {connectionConfiguration: {user: 'charles'}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/scheduler/destinations/check_connection';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionConfiguration":{"user":"charles"}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/scheduler/destinations/check_connection',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "connectionConfiguration": {\n "user": "charles"\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/scheduler/destinations/check_connection")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/scheduler/destinations/check_connection',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({connectionConfiguration: {user: 'charles'}}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/scheduler/destinations/check_connection',
headers: {'content-type': 'application/json'},
body: {connectionConfiguration: {user: 'charles'}},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/scheduler/destinations/check_connection');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
connectionConfiguration: {
user: 'charles'
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/scheduler/destinations/check_connection',
headers: {'content-type': 'application/json'},
data: {connectionConfiguration: {user: 'charles'}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/scheduler/destinations/check_connection';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionConfiguration":{"user":"charles"}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"connectionConfiguration": @{ @"user": @"charles" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/scheduler/destinations/check_connection"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/scheduler/destinations/check_connection" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/scheduler/destinations/check_connection",
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([
'connectionConfiguration' => [
'user' => 'charles'
]
]),
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;
}
request('POST', '{{baseUrl}}/v1/scheduler/destinations/check_connection', [
'body' => '{
"connectionConfiguration": {
"user": "charles"
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/scheduler/destinations/check_connection');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'connectionConfiguration' => [
'user' => 'charles'
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'connectionConfiguration' => [
'user' => 'charles'
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/scheduler/destinations/check_connection');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/scheduler/destinations/check_connection' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionConfiguration": {
"user": "charles"
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/scheduler/destinations/check_connection' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionConfiguration": {
"user": "charles"
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/scheduler/destinations/check_connection", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/scheduler/destinations/check_connection"
payload = { "connectionConfiguration": { "user": "charles" } }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/scheduler/destinations/check_connection"
payload <- "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/scheduler/destinations/check_connection")
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 \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/scheduler/destinations/check_connection') do |req|
req.body = "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/scheduler/destinations/check_connection";
let payload = json!({"connectionConfiguration": json!({"user": "charles"})});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/scheduler/destinations/check_connection \
--header 'content-type: application/json' \
--data '{
"connectionConfiguration": {
"user": "charles"
}
}'
echo '{
"connectionConfiguration": {
"user": "charles"
}
}' | \
http POST {{baseUrl}}/v1/scheduler/destinations/check_connection \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "connectionConfiguration": {\n "user": "charles"\n }\n}' \
--output-document \
- {{baseUrl}}/v1/scheduler/destinations/check_connection
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["connectionConfiguration": ["user": "charles"]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/scheduler/destinations/check_connection")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Run check connection for a given source configuration
{{baseUrl}}/v1/scheduler/sources/check_connection
BODY json
{
"connectionConfiguration": "",
"sourceDefinitionId": "",
"sourceId": "",
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/scheduler/sources/check_connection");
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 \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/scheduler/sources/check_connection" {:content-type :json
:form-params {:connectionConfiguration {:user "charles"}}})
require "http/client"
url = "{{baseUrl}}/v1/scheduler/sources/check_connection"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/scheduler/sources/check_connection"),
Content = new StringContent("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/scheduler/sources/check_connection");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/scheduler/sources/check_connection"
payload := strings.NewReader("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/scheduler/sources/check_connection HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 60
{
"connectionConfiguration": {
"user": "charles"
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/scheduler/sources/check_connection")
.setHeader("content-type", "application/json")
.setBody("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/scheduler/sources/check_connection"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/scheduler/sources/check_connection")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/scheduler/sources/check_connection")
.header("content-type", "application/json")
.body("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
.asString();
const data = JSON.stringify({
connectionConfiguration: {
user: 'charles'
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/scheduler/sources/check_connection');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/scheduler/sources/check_connection',
headers: {'content-type': 'application/json'},
data: {connectionConfiguration: {user: 'charles'}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/scheduler/sources/check_connection';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionConfiguration":{"user":"charles"}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/scheduler/sources/check_connection',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "connectionConfiguration": {\n "user": "charles"\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/scheduler/sources/check_connection")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/scheduler/sources/check_connection',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({connectionConfiguration: {user: 'charles'}}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/scheduler/sources/check_connection',
headers: {'content-type': 'application/json'},
body: {connectionConfiguration: {user: 'charles'}},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/scheduler/sources/check_connection');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
connectionConfiguration: {
user: 'charles'
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/scheduler/sources/check_connection',
headers: {'content-type': 'application/json'},
data: {connectionConfiguration: {user: 'charles'}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/scheduler/sources/check_connection';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionConfiguration":{"user":"charles"}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"connectionConfiguration": @{ @"user": @"charles" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/scheduler/sources/check_connection"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/scheduler/sources/check_connection" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/scheduler/sources/check_connection",
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([
'connectionConfiguration' => [
'user' => 'charles'
]
]),
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;
}
request('POST', '{{baseUrl}}/v1/scheduler/sources/check_connection', [
'body' => '{
"connectionConfiguration": {
"user": "charles"
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/scheduler/sources/check_connection');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'connectionConfiguration' => [
'user' => 'charles'
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'connectionConfiguration' => [
'user' => 'charles'
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/scheduler/sources/check_connection');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/scheduler/sources/check_connection' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionConfiguration": {
"user": "charles"
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/scheduler/sources/check_connection' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionConfiguration": {
"user": "charles"
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/scheduler/sources/check_connection", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/scheduler/sources/check_connection"
payload = { "connectionConfiguration": { "user": "charles" } }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/scheduler/sources/check_connection"
payload <- "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/scheduler/sources/check_connection")
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 \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/scheduler/sources/check_connection') do |req|
req.body = "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/scheduler/sources/check_connection";
let payload = json!({"connectionConfiguration": json!({"user": "charles"})});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/scheduler/sources/check_connection \
--header 'content-type: application/json' \
--data '{
"connectionConfiguration": {
"user": "charles"
}
}'
echo '{
"connectionConfiguration": {
"user": "charles"
}
}' | \
http POST {{baseUrl}}/v1/scheduler/sources/check_connection \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "connectionConfiguration": {\n "user": "charles"\n }\n}' \
--output-document \
- {{baseUrl}}/v1/scheduler/sources/check_connection
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["connectionConfiguration": ["user": "charles"]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/scheduler/sources/check_connection")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Run discover schema for a given source a source configuration
{{baseUrl}}/v1/scheduler/sources/discover_schema
BODY json
{
"connectionConfiguration": "",
"sourceDefinitionId": "",
"sourceId": "",
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/scheduler/sources/discover_schema");
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 \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/scheduler/sources/discover_schema" {:content-type :json
:form-params {:connectionConfiguration {:user "charles"}}})
require "http/client"
url = "{{baseUrl}}/v1/scheduler/sources/discover_schema"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/scheduler/sources/discover_schema"),
Content = new StringContent("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/scheduler/sources/discover_schema");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/scheduler/sources/discover_schema"
payload := strings.NewReader("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/scheduler/sources/discover_schema HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 60
{
"connectionConfiguration": {
"user": "charles"
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/scheduler/sources/discover_schema")
.setHeader("content-type", "application/json")
.setBody("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/scheduler/sources/discover_schema"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/scheduler/sources/discover_schema")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/scheduler/sources/discover_schema")
.header("content-type", "application/json")
.body("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
.asString();
const data = JSON.stringify({
connectionConfiguration: {
user: 'charles'
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/scheduler/sources/discover_schema');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/scheduler/sources/discover_schema',
headers: {'content-type': 'application/json'},
data: {connectionConfiguration: {user: 'charles'}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/scheduler/sources/discover_schema';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionConfiguration":{"user":"charles"}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/scheduler/sources/discover_schema',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "connectionConfiguration": {\n "user": "charles"\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/scheduler/sources/discover_schema")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/scheduler/sources/discover_schema',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({connectionConfiguration: {user: 'charles'}}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/scheduler/sources/discover_schema',
headers: {'content-type': 'application/json'},
body: {connectionConfiguration: {user: 'charles'}},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/scheduler/sources/discover_schema');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
connectionConfiguration: {
user: 'charles'
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/scheduler/sources/discover_schema',
headers: {'content-type': 'application/json'},
data: {connectionConfiguration: {user: 'charles'}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/scheduler/sources/discover_schema';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionConfiguration":{"user":"charles"}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"connectionConfiguration": @{ @"user": @"charles" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/scheduler/sources/discover_schema"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/scheduler/sources/discover_schema" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/scheduler/sources/discover_schema",
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([
'connectionConfiguration' => [
'user' => 'charles'
]
]),
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;
}
request('POST', '{{baseUrl}}/v1/scheduler/sources/discover_schema', [
'body' => '{
"connectionConfiguration": {
"user": "charles"
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/scheduler/sources/discover_schema');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'connectionConfiguration' => [
'user' => 'charles'
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'connectionConfiguration' => [
'user' => 'charles'
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/scheduler/sources/discover_schema');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/scheduler/sources/discover_schema' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionConfiguration": {
"user": "charles"
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/scheduler/sources/discover_schema' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionConfiguration": {
"user": "charles"
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/scheduler/sources/discover_schema", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/scheduler/sources/discover_schema"
payload = { "connectionConfiguration": { "user": "charles" } }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/scheduler/sources/discover_schema"
payload <- "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/scheduler/sources/discover_schema")
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 \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/scheduler/sources/discover_schema') do |req|
req.body = "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/scheduler/sources/discover_schema";
let payload = json!({"connectionConfiguration": json!({"user": "charles"})});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/scheduler/sources/discover_schema \
--header 'content-type: application/json' \
--data '{
"connectionConfiguration": {
"user": "charles"
}
}'
echo '{
"connectionConfiguration": {
"user": "charles"
}
}' | \
http POST {{baseUrl}}/v1/scheduler/sources/discover_schema \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "connectionConfiguration": {\n "user": "charles"\n }\n}' \
--output-document \
- {{baseUrl}}/v1/scheduler/sources/discover_schema
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["connectionConfiguration": ["user": "charles"]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/scheduler/sources/discover_schema")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Check connection for a proposed update to a source
{{baseUrl}}/v1/sources/check_connection_for_update
BODY json
{
"connectionConfiguration": "",
"name": "",
"sourceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/sources/check_connection_for_update");
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 \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/sources/check_connection_for_update" {:content-type :json
:form-params {:connectionConfiguration {:user "charles"}}})
require "http/client"
url = "{{baseUrl}}/v1/sources/check_connection_for_update"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/sources/check_connection_for_update"),
Content = new StringContent("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/sources/check_connection_for_update");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/sources/check_connection_for_update"
payload := strings.NewReader("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/sources/check_connection_for_update HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 60
{
"connectionConfiguration": {
"user": "charles"
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/sources/check_connection_for_update")
.setHeader("content-type", "application/json")
.setBody("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/sources/check_connection_for_update"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/sources/check_connection_for_update")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/sources/check_connection_for_update")
.header("content-type", "application/json")
.body("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
.asString();
const data = JSON.stringify({
connectionConfiguration: {
user: 'charles'
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/sources/check_connection_for_update');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/check_connection_for_update',
headers: {'content-type': 'application/json'},
data: {connectionConfiguration: {user: 'charles'}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/sources/check_connection_for_update';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionConfiguration":{"user":"charles"}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/sources/check_connection_for_update',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "connectionConfiguration": {\n "user": "charles"\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/sources/check_connection_for_update")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/sources/check_connection_for_update',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({connectionConfiguration: {user: 'charles'}}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/check_connection_for_update',
headers: {'content-type': 'application/json'},
body: {connectionConfiguration: {user: 'charles'}},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/sources/check_connection_for_update');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
connectionConfiguration: {
user: 'charles'
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/check_connection_for_update',
headers: {'content-type': 'application/json'},
data: {connectionConfiguration: {user: 'charles'}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/sources/check_connection_for_update';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionConfiguration":{"user":"charles"}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"connectionConfiguration": @{ @"user": @"charles" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/sources/check_connection_for_update"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/sources/check_connection_for_update" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/sources/check_connection_for_update",
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([
'connectionConfiguration' => [
'user' => 'charles'
]
]),
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;
}
request('POST', '{{baseUrl}}/v1/sources/check_connection_for_update', [
'body' => '{
"connectionConfiguration": {
"user": "charles"
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/sources/check_connection_for_update');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'connectionConfiguration' => [
'user' => 'charles'
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'connectionConfiguration' => [
'user' => 'charles'
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/sources/check_connection_for_update');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/sources/check_connection_for_update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionConfiguration": {
"user": "charles"
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/sources/check_connection_for_update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionConfiguration": {
"user": "charles"
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/sources/check_connection_for_update", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/sources/check_connection_for_update"
payload = { "connectionConfiguration": { "user": "charles" } }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/sources/check_connection_for_update"
payload <- "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/sources/check_connection_for_update")
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 \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/sources/check_connection_for_update') do |req|
req.body = "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/sources/check_connection_for_update";
let payload = json!({"connectionConfiguration": json!({"user": "charles"})});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/sources/check_connection_for_update \
--header 'content-type: application/json' \
--data '{
"connectionConfiguration": {
"user": "charles"
}
}'
echo '{
"connectionConfiguration": {
"user": "charles"
}
}' | \
http POST {{baseUrl}}/v1/sources/check_connection_for_update \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "connectionConfiguration": {\n "user": "charles"\n }\n}' \
--output-document \
- {{baseUrl}}/v1/sources/check_connection_for_update
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["connectionConfiguration": ["user": "charles"]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/sources/check_connection_for_update")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Check connection to the source
{{baseUrl}}/v1/sources/check_connection
BODY json
{
"sourceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/sources/check_connection");
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 \"sourceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/sources/check_connection" {:content-type :json
:form-params {:sourceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/sources/check_connection"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"sourceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/sources/check_connection"),
Content = new StringContent("{\n \"sourceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/sources/check_connection");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"sourceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/sources/check_connection"
payload := strings.NewReader("{\n \"sourceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/sources/check_connection HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 20
{
"sourceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/sources/check_connection")
.setHeader("content-type", "application/json")
.setBody("{\n \"sourceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/sources/check_connection"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"sourceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"sourceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/sources/check_connection")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/sources/check_connection")
.header("content-type", "application/json")
.body("{\n \"sourceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
sourceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/sources/check_connection');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/check_connection',
headers: {'content-type': 'application/json'},
data: {sourceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/sources/check_connection';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sourceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/sources/check_connection',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "sourceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"sourceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/sources/check_connection")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/sources/check_connection',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({sourceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/check_connection',
headers: {'content-type': 'application/json'},
body: {sourceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/sources/check_connection');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
sourceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/check_connection',
headers: {'content-type': 'application/json'},
data: {sourceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/sources/check_connection';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sourceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"sourceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/sources/check_connection"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/sources/check_connection" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"sourceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/sources/check_connection",
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([
'sourceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/sources/check_connection', [
'body' => '{
"sourceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/sources/check_connection');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'sourceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'sourceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/sources/check_connection');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/sources/check_connection' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sourceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/sources/check_connection' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sourceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"sourceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/sources/check_connection", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/sources/check_connection"
payload = { "sourceId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/sources/check_connection"
payload <- "{\n \"sourceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/sources/check_connection")
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 \"sourceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/sources/check_connection') do |req|
req.body = "{\n \"sourceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/sources/check_connection";
let payload = json!({"sourceId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/sources/check_connection \
--header 'content-type: application/json' \
--data '{
"sourceId": ""
}'
echo '{
"sourceId": ""
}' | \
http POST {{baseUrl}}/v1/sources/check_connection \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "sourceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/sources/check_connection
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["sourceId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/sources/check_connection")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Clone source
{{baseUrl}}/v1/sources/clone
BODY json
{
"sourceCloneId": "",
"sourceConfiguration": {
"connectionConfiguration": "",
"name": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/sources/clone");
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 \"sourceCloneId\": \"\",\n \"sourceConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/sources/clone" {:content-type :json
:form-params {:sourceCloneId ""
:sourceConfiguration {:connectionConfiguration ""
:name ""}}})
require "http/client"
url = "{{baseUrl}}/v1/sources/clone"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"sourceCloneId\": \"\",\n \"sourceConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/sources/clone"),
Content = new StringContent("{\n \"sourceCloneId\": \"\",\n \"sourceConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/sources/clone");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"sourceCloneId\": \"\",\n \"sourceConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/sources/clone"
payload := strings.NewReader("{\n \"sourceCloneId\": \"\",\n \"sourceConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/sources/clone HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 107
{
"sourceCloneId": "",
"sourceConfiguration": {
"connectionConfiguration": "",
"name": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/sources/clone")
.setHeader("content-type", "application/json")
.setBody("{\n \"sourceCloneId\": \"\",\n \"sourceConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/sources/clone"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"sourceCloneId\": \"\",\n \"sourceConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"sourceCloneId\": \"\",\n \"sourceConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/sources/clone")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/sources/clone")
.header("content-type", "application/json")
.body("{\n \"sourceCloneId\": \"\",\n \"sourceConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
sourceCloneId: '',
sourceConfiguration: {
connectionConfiguration: '',
name: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/sources/clone');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/clone',
headers: {'content-type': 'application/json'},
data: {
sourceCloneId: '',
sourceConfiguration: {connectionConfiguration: '', name: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/sources/clone';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sourceCloneId":"","sourceConfiguration":{"connectionConfiguration":"","name":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/sources/clone',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "sourceCloneId": "",\n "sourceConfiguration": {\n "connectionConfiguration": "",\n "name": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"sourceCloneId\": \"\",\n \"sourceConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/sources/clone")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/sources/clone',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
sourceCloneId: '',
sourceConfiguration: {connectionConfiguration: '', name: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/clone',
headers: {'content-type': 'application/json'},
body: {
sourceCloneId: '',
sourceConfiguration: {connectionConfiguration: '', name: ''}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/sources/clone');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
sourceCloneId: '',
sourceConfiguration: {
connectionConfiguration: '',
name: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/clone',
headers: {'content-type': 'application/json'},
data: {
sourceCloneId: '',
sourceConfiguration: {connectionConfiguration: '', name: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/sources/clone';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sourceCloneId":"","sourceConfiguration":{"connectionConfiguration":"","name":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"sourceCloneId": @"",
@"sourceConfiguration": @{ @"connectionConfiguration": @"", @"name": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/sources/clone"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/sources/clone" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"sourceCloneId\": \"\",\n \"sourceConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/sources/clone",
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([
'sourceCloneId' => '',
'sourceConfiguration' => [
'connectionConfiguration' => '',
'name' => ''
]
]),
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;
}
request('POST', '{{baseUrl}}/v1/sources/clone', [
'body' => '{
"sourceCloneId": "",
"sourceConfiguration": {
"connectionConfiguration": "",
"name": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/sources/clone');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'sourceCloneId' => '',
'sourceConfiguration' => [
'connectionConfiguration' => '',
'name' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'sourceCloneId' => '',
'sourceConfiguration' => [
'connectionConfiguration' => '',
'name' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/sources/clone');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/sources/clone' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sourceCloneId": "",
"sourceConfiguration": {
"connectionConfiguration": "",
"name": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/sources/clone' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sourceCloneId": "",
"sourceConfiguration": {
"connectionConfiguration": "",
"name": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"sourceCloneId\": \"\",\n \"sourceConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/sources/clone", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/sources/clone"
payload = {
"sourceCloneId": "",
"sourceConfiguration": {
"connectionConfiguration": "",
"name": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/sources/clone"
payload <- "{\n \"sourceCloneId\": \"\",\n \"sourceConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/sources/clone")
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 \"sourceCloneId\": \"\",\n \"sourceConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/sources/clone') do |req|
req.body = "{\n \"sourceCloneId\": \"\",\n \"sourceConfiguration\": {\n \"connectionConfiguration\": \"\",\n \"name\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/sources/clone";
let payload = json!({
"sourceCloneId": "",
"sourceConfiguration": json!({
"connectionConfiguration": "",
"name": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/sources/clone \
--header 'content-type: application/json' \
--data '{
"sourceCloneId": "",
"sourceConfiguration": {
"connectionConfiguration": "",
"name": ""
}
}'
echo '{
"sourceCloneId": "",
"sourceConfiguration": {
"connectionConfiguration": "",
"name": ""
}
}' | \
http POST {{baseUrl}}/v1/sources/clone \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "sourceCloneId": "",\n "sourceConfiguration": {\n "connectionConfiguration": "",\n "name": ""\n }\n}' \
--output-document \
- {{baseUrl}}/v1/sources/clone
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"sourceCloneId": "",
"sourceConfiguration": [
"connectionConfiguration": "",
"name": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/sources/clone")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"connectionConfiguration": {
"user": "charles"
}
}
POST
Create a source
{{baseUrl}}/v1/sources/create
BODY json
{
"connectionConfiguration": "",
"name": "",
"sourceDefinitionId": "",
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/sources/create");
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 \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/sources/create" {:content-type :json
:form-params {:connectionConfiguration ""
:name ""
:sourceDefinitionId ""
:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/sources/create"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/sources/create"),
Content = new StringContent("{\n \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/sources/create");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/sources/create"
payload := strings.NewReader("{\n \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/sources/create HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 98
{
"connectionConfiguration": "",
"name": "",
"sourceDefinitionId": "",
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/sources/create")
.setHeader("content-type", "application/json")
.setBody("{\n \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/sources/create"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/sources/create")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/sources/create")
.header("content-type", "application/json")
.body("{\n \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
connectionConfiguration: '',
name: '',
sourceDefinitionId: '',
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/sources/create');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/create',
headers: {'content-type': 'application/json'},
data: {connectionConfiguration: '', name: '', sourceDefinitionId: '', workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/sources/create';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionConfiguration":"","name":"","sourceDefinitionId":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/sources/create',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "connectionConfiguration": "",\n "name": "",\n "sourceDefinitionId": "",\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/sources/create")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/sources/create',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({connectionConfiguration: '', name: '', sourceDefinitionId: '', workspaceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/create',
headers: {'content-type': 'application/json'},
body: {connectionConfiguration: '', name: '', sourceDefinitionId: '', workspaceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/sources/create');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
connectionConfiguration: '',
name: '',
sourceDefinitionId: '',
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/create',
headers: {'content-type': 'application/json'},
data: {connectionConfiguration: '', name: '', sourceDefinitionId: '', workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/sources/create';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionConfiguration":"","name":"","sourceDefinitionId":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"connectionConfiguration": @"",
@"name": @"",
@"sourceDefinitionId": @"",
@"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/sources/create"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/sources/create" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/sources/create",
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([
'connectionConfiguration' => '',
'name' => '',
'sourceDefinitionId' => '',
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/sources/create', [
'body' => '{
"connectionConfiguration": "",
"name": "",
"sourceDefinitionId": "",
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/sources/create');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'connectionConfiguration' => '',
'name' => '',
'sourceDefinitionId' => '',
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'connectionConfiguration' => '',
'name' => '',
'sourceDefinitionId' => '',
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/sources/create');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/sources/create' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionConfiguration": "",
"name": "",
"sourceDefinitionId": "",
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/sources/create' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionConfiguration": "",
"name": "",
"sourceDefinitionId": "",
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/sources/create", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/sources/create"
payload = {
"connectionConfiguration": "",
"name": "",
"sourceDefinitionId": "",
"workspaceId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/sources/create"
payload <- "{\n \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/sources/create")
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 \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/sources/create') do |req|
req.body = "{\n \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/sources/create";
let payload = json!({
"connectionConfiguration": "",
"name": "",
"sourceDefinitionId": "",
"workspaceId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/sources/create \
--header 'content-type: application/json' \
--data '{
"connectionConfiguration": "",
"name": "",
"sourceDefinitionId": "",
"workspaceId": ""
}'
echo '{
"connectionConfiguration": "",
"name": "",
"sourceDefinitionId": "",
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/sources/create \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "connectionConfiguration": "",\n "name": "",\n "sourceDefinitionId": "",\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/sources/create
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"connectionConfiguration": "",
"name": "",
"sourceDefinitionId": "",
"workspaceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/sources/create")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"connectionConfiguration": {
"user": "charles"
}
}
POST
Delete a source
{{baseUrl}}/v1/sources/delete
BODY json
{
"sourceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/sources/delete");
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 \"sourceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/sources/delete" {:content-type :json
:form-params {:sourceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/sources/delete"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"sourceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/sources/delete"),
Content = new StringContent("{\n \"sourceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/sources/delete");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"sourceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/sources/delete"
payload := strings.NewReader("{\n \"sourceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/sources/delete HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 20
{
"sourceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/sources/delete")
.setHeader("content-type", "application/json")
.setBody("{\n \"sourceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/sources/delete"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"sourceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"sourceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/sources/delete")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/sources/delete")
.header("content-type", "application/json")
.body("{\n \"sourceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
sourceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/sources/delete');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/delete',
headers: {'content-type': 'application/json'},
data: {sourceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/sources/delete';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sourceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/sources/delete',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "sourceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"sourceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/sources/delete")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/sources/delete',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({sourceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/delete',
headers: {'content-type': 'application/json'},
body: {sourceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/sources/delete');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
sourceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/delete',
headers: {'content-type': 'application/json'},
data: {sourceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/sources/delete';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sourceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"sourceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/sources/delete"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/sources/delete" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"sourceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/sources/delete",
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([
'sourceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/sources/delete', [
'body' => '{
"sourceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/sources/delete');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'sourceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'sourceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/sources/delete');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/sources/delete' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sourceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/sources/delete' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sourceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"sourceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/sources/delete", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/sources/delete"
payload = { "sourceId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/sources/delete"
payload <- "{\n \"sourceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/sources/delete")
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 \"sourceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/sources/delete') do |req|
req.body = "{\n \"sourceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/sources/delete";
let payload = json!({"sourceId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/sources/delete \
--header 'content-type: application/json' \
--data '{
"sourceId": ""
}'
echo '{
"sourceId": ""
}' | \
http POST {{baseUrl}}/v1/sources/delete \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "sourceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/sources/delete
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["sourceId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/sources/delete")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Discover the schema catalog of the source
{{baseUrl}}/v1/sources/discover_schema
BODY json
{
"connectionId": "",
"disable_cache": false,
"notifySchemaChange": false,
"sourceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/sources/discover_schema");
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 \"connectionId\": \"\",\n \"disable_cache\": false,\n \"notifySchemaChange\": false,\n \"sourceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/sources/discover_schema" {:content-type :json
:form-params {:connectionId ""
:disable_cache false
:notifySchemaChange false
:sourceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/sources/discover_schema"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"connectionId\": \"\",\n \"disable_cache\": false,\n \"notifySchemaChange\": false,\n \"sourceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/sources/discover_schema"),
Content = new StringContent("{\n \"connectionId\": \"\",\n \"disable_cache\": false,\n \"notifySchemaChange\": false,\n \"sourceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/sources/discover_schema");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"connectionId\": \"\",\n \"disable_cache\": false,\n \"notifySchemaChange\": false,\n \"sourceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/sources/discover_schema"
payload := strings.NewReader("{\n \"connectionId\": \"\",\n \"disable_cache\": false,\n \"notifySchemaChange\": false,\n \"sourceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/sources/discover_schema HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 99
{
"connectionId": "",
"disable_cache": false,
"notifySchemaChange": false,
"sourceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/sources/discover_schema")
.setHeader("content-type", "application/json")
.setBody("{\n \"connectionId\": \"\",\n \"disable_cache\": false,\n \"notifySchemaChange\": false,\n \"sourceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/sources/discover_schema"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"connectionId\": \"\",\n \"disable_cache\": false,\n \"notifySchemaChange\": false,\n \"sourceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"connectionId\": \"\",\n \"disable_cache\": false,\n \"notifySchemaChange\": false,\n \"sourceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/sources/discover_schema")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/sources/discover_schema")
.header("content-type", "application/json")
.body("{\n \"connectionId\": \"\",\n \"disable_cache\": false,\n \"notifySchemaChange\": false,\n \"sourceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
connectionId: '',
disable_cache: false,
notifySchemaChange: false,
sourceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/sources/discover_schema');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/discover_schema',
headers: {'content-type': 'application/json'},
data: {
connectionId: '',
disable_cache: false,
notifySchemaChange: false,
sourceId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/sources/discover_schema';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionId":"","disable_cache":false,"notifySchemaChange":false,"sourceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/sources/discover_schema',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "connectionId": "",\n "disable_cache": false,\n "notifySchemaChange": false,\n "sourceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"connectionId\": \"\",\n \"disable_cache\": false,\n \"notifySchemaChange\": false,\n \"sourceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/sources/discover_schema")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/sources/discover_schema',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
connectionId: '',
disable_cache: false,
notifySchemaChange: false,
sourceId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/discover_schema',
headers: {'content-type': 'application/json'},
body: {
connectionId: '',
disable_cache: false,
notifySchemaChange: false,
sourceId: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/sources/discover_schema');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
connectionId: '',
disable_cache: false,
notifySchemaChange: false,
sourceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/discover_schema',
headers: {'content-type': 'application/json'},
data: {
connectionId: '',
disable_cache: false,
notifySchemaChange: false,
sourceId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/sources/discover_schema';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionId":"","disable_cache":false,"notifySchemaChange":false,"sourceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"connectionId": @"",
@"disable_cache": @NO,
@"notifySchemaChange": @NO,
@"sourceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/sources/discover_schema"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/sources/discover_schema" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"connectionId\": \"\",\n \"disable_cache\": false,\n \"notifySchemaChange\": false,\n \"sourceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/sources/discover_schema",
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([
'connectionId' => '',
'disable_cache' => null,
'notifySchemaChange' => null,
'sourceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/sources/discover_schema', [
'body' => '{
"connectionId": "",
"disable_cache": false,
"notifySchemaChange": false,
"sourceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/sources/discover_schema');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'connectionId' => '',
'disable_cache' => null,
'notifySchemaChange' => null,
'sourceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'connectionId' => '',
'disable_cache' => null,
'notifySchemaChange' => null,
'sourceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/sources/discover_schema');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/sources/discover_schema' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionId": "",
"disable_cache": false,
"notifySchemaChange": false,
"sourceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/sources/discover_schema' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionId": "",
"disable_cache": false,
"notifySchemaChange": false,
"sourceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"connectionId\": \"\",\n \"disable_cache\": false,\n \"notifySchemaChange\": false,\n \"sourceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/sources/discover_schema", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/sources/discover_schema"
payload = {
"connectionId": "",
"disable_cache": False,
"notifySchemaChange": False,
"sourceId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/sources/discover_schema"
payload <- "{\n \"connectionId\": \"\",\n \"disable_cache\": false,\n \"notifySchemaChange\": false,\n \"sourceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/sources/discover_schema")
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 \"connectionId\": \"\",\n \"disable_cache\": false,\n \"notifySchemaChange\": false,\n \"sourceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/sources/discover_schema') do |req|
req.body = "{\n \"connectionId\": \"\",\n \"disable_cache\": false,\n \"notifySchemaChange\": false,\n \"sourceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/sources/discover_schema";
let payload = json!({
"connectionId": "",
"disable_cache": false,
"notifySchemaChange": false,
"sourceId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/sources/discover_schema \
--header 'content-type: application/json' \
--data '{
"connectionId": "",
"disable_cache": false,
"notifySchemaChange": false,
"sourceId": ""
}'
echo '{
"connectionId": "",
"disable_cache": false,
"notifySchemaChange": false,
"sourceId": ""
}' | \
http POST {{baseUrl}}/v1/sources/discover_schema \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "connectionId": "",\n "disable_cache": false,\n "notifySchemaChange": false,\n "sourceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/sources/discover_schema
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"connectionId": "",
"disable_cache": false,
"notifySchemaChange": false,
"sourceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/sources/discover_schema")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Get most recent ActorCatalog for source
{{baseUrl}}/v1/sources/most_recent_source_actor_catalog
BODY json
{
"sourceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/sources/most_recent_source_actor_catalog");
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 \"sourceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/sources/most_recent_source_actor_catalog" {:content-type :json
:form-params {:sourceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/sources/most_recent_source_actor_catalog"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"sourceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/sources/most_recent_source_actor_catalog"),
Content = new StringContent("{\n \"sourceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/sources/most_recent_source_actor_catalog");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"sourceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/sources/most_recent_source_actor_catalog"
payload := strings.NewReader("{\n \"sourceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/sources/most_recent_source_actor_catalog HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 20
{
"sourceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/sources/most_recent_source_actor_catalog")
.setHeader("content-type", "application/json")
.setBody("{\n \"sourceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/sources/most_recent_source_actor_catalog"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"sourceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"sourceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/sources/most_recent_source_actor_catalog")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/sources/most_recent_source_actor_catalog")
.header("content-type", "application/json")
.body("{\n \"sourceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
sourceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/sources/most_recent_source_actor_catalog');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/most_recent_source_actor_catalog',
headers: {'content-type': 'application/json'},
data: {sourceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/sources/most_recent_source_actor_catalog';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sourceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/sources/most_recent_source_actor_catalog',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "sourceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"sourceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/sources/most_recent_source_actor_catalog")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/sources/most_recent_source_actor_catalog',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({sourceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/most_recent_source_actor_catalog',
headers: {'content-type': 'application/json'},
body: {sourceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/sources/most_recent_source_actor_catalog');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
sourceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/most_recent_source_actor_catalog',
headers: {'content-type': 'application/json'},
data: {sourceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/sources/most_recent_source_actor_catalog';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sourceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"sourceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/sources/most_recent_source_actor_catalog"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/sources/most_recent_source_actor_catalog" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"sourceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/sources/most_recent_source_actor_catalog",
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([
'sourceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/sources/most_recent_source_actor_catalog', [
'body' => '{
"sourceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/sources/most_recent_source_actor_catalog');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'sourceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'sourceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/sources/most_recent_source_actor_catalog');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/sources/most_recent_source_actor_catalog' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sourceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/sources/most_recent_source_actor_catalog' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sourceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"sourceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/sources/most_recent_source_actor_catalog", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/sources/most_recent_source_actor_catalog"
payload = { "sourceId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/sources/most_recent_source_actor_catalog"
payload <- "{\n \"sourceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/sources/most_recent_source_actor_catalog")
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 \"sourceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/sources/most_recent_source_actor_catalog') do |req|
req.body = "{\n \"sourceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/sources/most_recent_source_actor_catalog";
let payload = json!({"sourceId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/sources/most_recent_source_actor_catalog \
--header 'content-type: application/json' \
--data '{
"sourceId": ""
}'
echo '{
"sourceId": ""
}' | \
http POST {{baseUrl}}/v1/sources/most_recent_source_actor_catalog \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "sourceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/sources/most_recent_source_actor_catalog
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["sourceId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/sources/most_recent_source_actor_catalog")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Get source (POST)
{{baseUrl}}/v1/sources/get
BODY json
{
"sourceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/sources/get");
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 \"sourceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/sources/get" {:content-type :json
:form-params {:sourceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/sources/get"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"sourceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/sources/get"),
Content = new StringContent("{\n \"sourceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/sources/get");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"sourceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/sources/get"
payload := strings.NewReader("{\n \"sourceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/sources/get HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 20
{
"sourceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/sources/get")
.setHeader("content-type", "application/json")
.setBody("{\n \"sourceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/sources/get"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"sourceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"sourceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/sources/get")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/sources/get")
.header("content-type", "application/json")
.body("{\n \"sourceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
sourceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/sources/get');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/get',
headers: {'content-type': 'application/json'},
data: {sourceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/sources/get';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sourceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/sources/get',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "sourceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"sourceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/sources/get")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/sources/get',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({sourceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/get',
headers: {'content-type': 'application/json'},
body: {sourceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/sources/get');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
sourceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/get',
headers: {'content-type': 'application/json'},
data: {sourceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/sources/get';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sourceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"sourceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/sources/get"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/sources/get" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"sourceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/sources/get",
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([
'sourceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/sources/get', [
'body' => '{
"sourceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/sources/get');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'sourceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'sourceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/sources/get');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/sources/get' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sourceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/sources/get' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sourceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"sourceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/sources/get", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/sources/get"
payload = { "sourceId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/sources/get"
payload <- "{\n \"sourceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/sources/get")
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 \"sourceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/sources/get') do |req|
req.body = "{\n \"sourceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/sources/get";
let payload = json!({"sourceId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/sources/get \
--header 'content-type: application/json' \
--data '{
"sourceId": ""
}'
echo '{
"sourceId": ""
}' | \
http POST {{baseUrl}}/v1/sources/get \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "sourceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/sources/get
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["sourceId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/sources/get")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"connectionConfiguration": {
"user": "charles"
}
}
POST
List sources for workspace
{{baseUrl}}/v1/sources/list
BODY json
{
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/sources/list");
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 \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/sources/list" {:content-type :json
:form-params {:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/sources/list"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/sources/list"),
Content = new StringContent("{\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/sources/list");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/sources/list"
payload := strings.NewReader("{\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/sources/list HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/sources/list")
.setHeader("content-type", "application/json")
.setBody("{\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/sources/list"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/sources/list")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/sources/list")
.header("content-type", "application/json")
.body("{\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/sources/list');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/list',
headers: {'content-type': 'application/json'},
data: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/sources/list';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/sources/list',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/sources/list")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/sources/list',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({workspaceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/list',
headers: {'content-type': 'application/json'},
body: {workspaceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/sources/list');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/list',
headers: {'content-type': 'application/json'},
data: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/sources/list';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/sources/list"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/sources/list" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/sources/list",
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([
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/sources/list', [
'body' => '{
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/sources/list');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/sources/list');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/sources/list' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/sources/list' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/sources/list", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/sources/list"
payload = { "workspaceId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/sources/list"
payload <- "{\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/sources/list")
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 \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/sources/list') do |req|
req.body = "{\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/sources/list";
let payload = json!({"workspaceId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/sources/list \
--header 'content-type: application/json' \
--data '{
"workspaceId": ""
}'
echo '{
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/sources/list \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/sources/list
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["workspaceId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/sources/list")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Search sources
{{baseUrl}}/v1/sources/search
BODY json
{
"connectionConfiguration": "",
"name": "",
"sourceDefinitionId": "",
"sourceId": "",
"sourceName": "",
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/sources/search");
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 \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/sources/search" {:content-type :json
:form-params {:connectionConfiguration {:user "charles"}}})
require "http/client"
url = "{{baseUrl}}/v1/sources/search"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/sources/search"),
Content = new StringContent("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/sources/search");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/sources/search"
payload := strings.NewReader("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/sources/search HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 60
{
"connectionConfiguration": {
"user": "charles"
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/sources/search")
.setHeader("content-type", "application/json")
.setBody("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/sources/search"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/sources/search")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/sources/search")
.header("content-type", "application/json")
.body("{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
.asString();
const data = JSON.stringify({
connectionConfiguration: {
user: 'charles'
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/sources/search');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/search',
headers: {'content-type': 'application/json'},
data: {connectionConfiguration: {user: 'charles'}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/sources/search';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionConfiguration":{"user":"charles"}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/sources/search',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "connectionConfiguration": {\n "user": "charles"\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/sources/search")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/sources/search',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({connectionConfiguration: {user: 'charles'}}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/search',
headers: {'content-type': 'application/json'},
body: {connectionConfiguration: {user: 'charles'}},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/sources/search');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
connectionConfiguration: {
user: 'charles'
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/search',
headers: {'content-type': 'application/json'},
data: {connectionConfiguration: {user: 'charles'}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/sources/search';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionConfiguration":{"user":"charles"}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"connectionConfiguration": @{ @"user": @"charles" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/sources/search"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/sources/search" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/sources/search",
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([
'connectionConfiguration' => [
'user' => 'charles'
]
]),
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;
}
request('POST', '{{baseUrl}}/v1/sources/search', [
'body' => '{
"connectionConfiguration": {
"user": "charles"
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/sources/search');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'connectionConfiguration' => [
'user' => 'charles'
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'connectionConfiguration' => [
'user' => 'charles'
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/sources/search');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/sources/search' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionConfiguration": {
"user": "charles"
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/sources/search' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionConfiguration": {
"user": "charles"
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/sources/search", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/sources/search"
payload = { "connectionConfiguration": { "user": "charles" } }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/sources/search"
payload <- "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/sources/search")
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 \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/sources/search') do |req|
req.body = "{\n \"connectionConfiguration\": {\n \"user\": \"charles\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/sources/search";
let payload = json!({"connectionConfiguration": json!({"user": "charles"})});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/sources/search \
--header 'content-type: application/json' \
--data '{
"connectionConfiguration": {
"user": "charles"
}
}'
echo '{
"connectionConfiguration": {
"user": "charles"
}
}' | \
http POST {{baseUrl}}/v1/sources/search \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "connectionConfiguration": {\n "user": "charles"\n }\n}' \
--output-document \
- {{baseUrl}}/v1/sources/search
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["connectionConfiguration": ["user": "charles"]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/sources/search")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Should only called from worker, to write result from discover activity back to DB.
{{baseUrl}}/v1/sources/write_discover_catalog_result
BODY json
{
"catalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
},
"configurationHash": "",
"connectorVersion": "",
"sourceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/sources/write_discover_catalog_result");
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 \"catalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n },\n \"configurationHash\": \"\",\n \"connectorVersion\": \"\",\n \"sourceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/sources/write_discover_catalog_result" {:content-type :json
:form-params {:catalog {:streams [{:config {:aliasName ""
:cursorField []
:destinationSyncMode ""
:fieldSelectionEnabled false
:primaryKey []
:selected false
:selectedFields [{:fieldPath []}]
:suggested false
:syncMode ""}
:stream {:defaultCursorField []
:jsonSchema {}
:name ""
:namespace ""
:sourceDefinedCursor false
:sourceDefinedPrimaryKey []
:supportedSyncModes []}}]}
:configurationHash ""
:connectorVersion ""
:sourceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/sources/write_discover_catalog_result"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"catalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n },\n \"configurationHash\": \"\",\n \"connectorVersion\": \"\",\n \"sourceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/sources/write_discover_catalog_result"),
Content = new StringContent("{\n \"catalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n },\n \"configurationHash\": \"\",\n \"connectorVersion\": \"\",\n \"sourceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/sources/write_discover_catalog_result");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"catalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n },\n \"configurationHash\": \"\",\n \"connectorVersion\": \"\",\n \"sourceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/sources/write_discover_catalog_result"
payload := strings.NewReader("{\n \"catalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n },\n \"configurationHash\": \"\",\n \"connectorVersion\": \"\",\n \"sourceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/sources/write_discover_catalog_result HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 770
{
"catalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
},
"configurationHash": "",
"connectorVersion": "",
"sourceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/sources/write_discover_catalog_result")
.setHeader("content-type", "application/json")
.setBody("{\n \"catalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n },\n \"configurationHash\": \"\",\n \"connectorVersion\": \"\",\n \"sourceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/sources/write_discover_catalog_result"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"catalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n },\n \"configurationHash\": \"\",\n \"connectorVersion\": \"\",\n \"sourceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"catalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n },\n \"configurationHash\": \"\",\n \"connectorVersion\": \"\",\n \"sourceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/sources/write_discover_catalog_result")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/sources/write_discover_catalog_result")
.header("content-type", "application/json")
.body("{\n \"catalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n },\n \"configurationHash\": \"\",\n \"connectorVersion\": \"\",\n \"sourceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
catalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [
{
fieldPath: []
}
],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
},
configurationHash: '',
connectorVersion: '',
sourceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/sources/write_discover_catalog_result');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/write_discover_catalog_result',
headers: {'content-type': 'application/json'},
data: {
catalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [{fieldPath: []}],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
},
configurationHash: '',
connectorVersion: '',
sourceId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/sources/write_discover_catalog_result';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"catalog":{"streams":[{"config":{"aliasName":"","cursorField":[],"destinationSyncMode":"","fieldSelectionEnabled":false,"primaryKey":[],"selected":false,"selectedFields":[{"fieldPath":[]}],"suggested":false,"syncMode":""},"stream":{"defaultCursorField":[],"jsonSchema":{},"name":"","namespace":"","sourceDefinedCursor":false,"sourceDefinedPrimaryKey":[],"supportedSyncModes":[]}}]},"configurationHash":"","connectorVersion":"","sourceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/sources/write_discover_catalog_result',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "catalog": {\n "streams": [\n {\n "config": {\n "aliasName": "",\n "cursorField": [],\n "destinationSyncMode": "",\n "fieldSelectionEnabled": false,\n "primaryKey": [],\n "selected": false,\n "selectedFields": [\n {\n "fieldPath": []\n }\n ],\n "suggested": false,\n "syncMode": ""\n },\n "stream": {\n "defaultCursorField": [],\n "jsonSchema": {},\n "name": "",\n "namespace": "",\n "sourceDefinedCursor": false,\n "sourceDefinedPrimaryKey": [],\n "supportedSyncModes": []\n }\n }\n ]\n },\n "configurationHash": "",\n "connectorVersion": "",\n "sourceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"catalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n },\n \"configurationHash\": \"\",\n \"connectorVersion\": \"\",\n \"sourceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/sources/write_discover_catalog_result")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/sources/write_discover_catalog_result',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
catalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [{fieldPath: []}],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
},
configurationHash: '',
connectorVersion: '',
sourceId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/write_discover_catalog_result',
headers: {'content-type': 'application/json'},
body: {
catalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [{fieldPath: []}],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
},
configurationHash: '',
connectorVersion: '',
sourceId: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/sources/write_discover_catalog_result');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
catalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [
{
fieldPath: []
}
],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
},
configurationHash: '',
connectorVersion: '',
sourceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/write_discover_catalog_result',
headers: {'content-type': 'application/json'},
data: {
catalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [{fieldPath: []}],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
},
configurationHash: '',
connectorVersion: '',
sourceId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/sources/write_discover_catalog_result';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"catalog":{"streams":[{"config":{"aliasName":"","cursorField":[],"destinationSyncMode":"","fieldSelectionEnabled":false,"primaryKey":[],"selected":false,"selectedFields":[{"fieldPath":[]}],"suggested":false,"syncMode":""},"stream":{"defaultCursorField":[],"jsonSchema":{},"name":"","namespace":"","sourceDefinedCursor":false,"sourceDefinedPrimaryKey":[],"supportedSyncModes":[]}}]},"configurationHash":"","connectorVersion":"","sourceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"catalog": @{ @"streams": @[ @{ @"config": @{ @"aliasName": @"", @"cursorField": @[ ], @"destinationSyncMode": @"", @"fieldSelectionEnabled": @NO, @"primaryKey": @[ ], @"selected": @NO, @"selectedFields": @[ @{ @"fieldPath": @[ ] } ], @"suggested": @NO, @"syncMode": @"" }, @"stream": @{ @"defaultCursorField": @[ ], @"jsonSchema": @{ }, @"name": @"", @"namespace": @"", @"sourceDefinedCursor": @NO, @"sourceDefinedPrimaryKey": @[ ], @"supportedSyncModes": @[ ] } } ] },
@"configurationHash": @"",
@"connectorVersion": @"",
@"sourceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/sources/write_discover_catalog_result"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/sources/write_discover_catalog_result" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"catalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n },\n \"configurationHash\": \"\",\n \"connectorVersion\": \"\",\n \"sourceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/sources/write_discover_catalog_result",
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([
'catalog' => [
'streams' => [
[
'config' => [
'aliasName' => '',
'cursorField' => [
],
'destinationSyncMode' => '',
'fieldSelectionEnabled' => null,
'primaryKey' => [
],
'selected' => null,
'selectedFields' => [
[
'fieldPath' => [
]
]
],
'suggested' => null,
'syncMode' => ''
],
'stream' => [
'defaultCursorField' => [
],
'jsonSchema' => [
],
'name' => '',
'namespace' => '',
'sourceDefinedCursor' => null,
'sourceDefinedPrimaryKey' => [
],
'supportedSyncModes' => [
]
]
]
]
],
'configurationHash' => '',
'connectorVersion' => '',
'sourceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/sources/write_discover_catalog_result', [
'body' => '{
"catalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
},
"configurationHash": "",
"connectorVersion": "",
"sourceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/sources/write_discover_catalog_result');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'catalog' => [
'streams' => [
[
'config' => [
'aliasName' => '',
'cursorField' => [
],
'destinationSyncMode' => '',
'fieldSelectionEnabled' => null,
'primaryKey' => [
],
'selected' => null,
'selectedFields' => [
[
'fieldPath' => [
]
]
],
'suggested' => null,
'syncMode' => ''
],
'stream' => [
'defaultCursorField' => [
],
'jsonSchema' => [
],
'name' => '',
'namespace' => '',
'sourceDefinedCursor' => null,
'sourceDefinedPrimaryKey' => [
],
'supportedSyncModes' => [
]
]
]
]
],
'configurationHash' => '',
'connectorVersion' => '',
'sourceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'catalog' => [
'streams' => [
[
'config' => [
'aliasName' => '',
'cursorField' => [
],
'destinationSyncMode' => '',
'fieldSelectionEnabled' => null,
'primaryKey' => [
],
'selected' => null,
'selectedFields' => [
[
'fieldPath' => [
]
]
],
'suggested' => null,
'syncMode' => ''
],
'stream' => [
'defaultCursorField' => [
],
'jsonSchema' => [
],
'name' => '',
'namespace' => '',
'sourceDefinedCursor' => null,
'sourceDefinedPrimaryKey' => [
],
'supportedSyncModes' => [
]
]
]
]
],
'configurationHash' => '',
'connectorVersion' => '',
'sourceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/sources/write_discover_catalog_result');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/sources/write_discover_catalog_result' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"catalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
},
"configurationHash": "",
"connectorVersion": "",
"sourceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/sources/write_discover_catalog_result' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"catalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
},
"configurationHash": "",
"connectorVersion": "",
"sourceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"catalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n },\n \"configurationHash\": \"\",\n \"connectorVersion\": \"\",\n \"sourceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/sources/write_discover_catalog_result", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/sources/write_discover_catalog_result"
payload = {
"catalog": { "streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": False,
"primaryKey": [],
"selected": False,
"selectedFields": [{ "fieldPath": [] }],
"suggested": False,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": False,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
] },
"configurationHash": "",
"connectorVersion": "",
"sourceId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/sources/write_discover_catalog_result"
payload <- "{\n \"catalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n },\n \"configurationHash\": \"\",\n \"connectorVersion\": \"\",\n \"sourceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/sources/write_discover_catalog_result")
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 \"catalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n },\n \"configurationHash\": \"\",\n \"connectorVersion\": \"\",\n \"sourceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/sources/write_discover_catalog_result') do |req|
req.body = "{\n \"catalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n },\n \"configurationHash\": \"\",\n \"connectorVersion\": \"\",\n \"sourceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/sources/write_discover_catalog_result";
let payload = json!({
"catalog": json!({"streams": (
json!({
"config": json!({
"aliasName": "",
"cursorField": (),
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": (),
"selected": false,
"selectedFields": (json!({"fieldPath": ()})),
"suggested": false,
"syncMode": ""
}),
"stream": json!({
"defaultCursorField": (),
"jsonSchema": json!({}),
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": (),
"supportedSyncModes": ()
})
})
)}),
"configurationHash": "",
"connectorVersion": "",
"sourceId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/sources/write_discover_catalog_result \
--header 'content-type: application/json' \
--data '{
"catalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
},
"configurationHash": "",
"connectorVersion": "",
"sourceId": ""
}'
echo '{
"catalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
},
"configurationHash": "",
"connectorVersion": "",
"sourceId": ""
}' | \
http POST {{baseUrl}}/v1/sources/write_discover_catalog_result \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "catalog": {\n "streams": [\n {\n "config": {\n "aliasName": "",\n "cursorField": [],\n "destinationSyncMode": "",\n "fieldSelectionEnabled": false,\n "primaryKey": [],\n "selected": false,\n "selectedFields": [\n {\n "fieldPath": []\n }\n ],\n "suggested": false,\n "syncMode": ""\n },\n "stream": {\n "defaultCursorField": [],\n "jsonSchema": {},\n "name": "",\n "namespace": "",\n "sourceDefinedCursor": false,\n "sourceDefinedPrimaryKey": [],\n "supportedSyncModes": []\n }\n }\n ]\n },\n "configurationHash": "",\n "connectorVersion": "",\n "sourceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/sources/write_discover_catalog_result
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"catalog": ["streams": [
[
"config": [
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [["fieldPath": []]],
"suggested": false,
"syncMode": ""
],
"stream": [
"defaultCursorField": [],
"jsonSchema": [],
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
]
]
]],
"configurationHash": "",
"connectorVersion": "",
"sourceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/sources/write_discover_catalog_result")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Update a source
{{baseUrl}}/v1/sources/update
BODY json
{
"connectionConfiguration": "",
"name": "",
"sourceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/sources/update");
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 \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/sources/update" {:content-type :json
:form-params {:connectionConfiguration ""
:name ""
:sourceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/sources/update"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/sources/update"),
Content = new StringContent("{\n \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/sources/update");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/sources/update"
payload := strings.NewReader("{\n \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/sources/update HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 67
{
"connectionConfiguration": "",
"name": "",
"sourceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/sources/update")
.setHeader("content-type", "application/json")
.setBody("{\n \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/sources/update"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/sources/update")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/sources/update")
.header("content-type", "application/json")
.body("{\n \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
connectionConfiguration: '',
name: '',
sourceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/sources/update');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/update',
headers: {'content-type': 'application/json'},
data: {connectionConfiguration: '', name: '', sourceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/sources/update';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionConfiguration":"","name":"","sourceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/sources/update',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "connectionConfiguration": "",\n "name": "",\n "sourceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/sources/update")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/sources/update',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({connectionConfiguration: '', name: '', sourceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/update',
headers: {'content-type': 'application/json'},
body: {connectionConfiguration: '', name: '', sourceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/sources/update');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
connectionConfiguration: '',
name: '',
sourceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/sources/update',
headers: {'content-type': 'application/json'},
data: {connectionConfiguration: '', name: '', sourceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/sources/update';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionConfiguration":"","name":"","sourceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"connectionConfiguration": @"",
@"name": @"",
@"sourceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/sources/update"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/sources/update" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/sources/update",
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([
'connectionConfiguration' => '',
'name' => '',
'sourceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/sources/update', [
'body' => '{
"connectionConfiguration": "",
"name": "",
"sourceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/sources/update');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'connectionConfiguration' => '',
'name' => '',
'sourceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'connectionConfiguration' => '',
'name' => '',
'sourceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/sources/update');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/sources/update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionConfiguration": "",
"name": "",
"sourceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/sources/update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionConfiguration": "",
"name": "",
"sourceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/sources/update", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/sources/update"
payload = {
"connectionConfiguration": "",
"name": "",
"sourceId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/sources/update"
payload <- "{\n \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/sources/update")
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 \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/sources/update') do |req|
req.body = "{\n \"connectionConfiguration\": \"\",\n \"name\": \"\",\n \"sourceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/sources/update";
let payload = json!({
"connectionConfiguration": "",
"name": "",
"sourceId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/sources/update \
--header 'content-type: application/json' \
--data '{
"connectionConfiguration": "",
"name": "",
"sourceId": ""
}'
echo '{
"connectionConfiguration": "",
"name": "",
"sourceId": ""
}' | \
http POST {{baseUrl}}/v1/sources/update \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "connectionConfiguration": "",\n "name": "",\n "sourceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/sources/update
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"connectionConfiguration": "",
"name": "",
"sourceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/sources/update")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"connectionConfiguration": {
"user": "charles"
}
}
POST
Creates a custom sourceDefinition for the given workspace
{{baseUrl}}/v1/source_definitions/create_custom
BODY json
{
"sourceDefinition": {
"dockerImageTag": "",
"dockerRepository": "",
"documentationUrl": "",
"icon": "",
"name": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
}
},
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/source_definitions/create_custom");
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 \"sourceDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/source_definitions/create_custom" {:content-type :json
:form-params {:sourceDefinition {:dockerImageTag ""
:dockerRepository ""
:documentationUrl ""
:icon ""
:name ""
:resourceRequirements {:default {:cpu_limit ""
:cpu_request ""
:memory_limit ""
:memory_request ""}
:jobSpecific [{:jobType ""
:resourceRequirements {}}]}}
:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/source_definitions/create_custom"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"sourceDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/source_definitions/create_custom"),
Content = new StringContent("{\n \"sourceDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/source_definitions/create_custom");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"sourceDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/source_definitions/create_custom"
payload := strings.NewReader("{\n \"sourceDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/source_definitions/create_custom HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 452
{
"sourceDefinition": {
"dockerImageTag": "",
"dockerRepository": "",
"documentationUrl": "",
"icon": "",
"name": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
}
},
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/source_definitions/create_custom")
.setHeader("content-type", "application/json")
.setBody("{\n \"sourceDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/source_definitions/create_custom"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"sourceDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"sourceDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/source_definitions/create_custom")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/source_definitions/create_custom")
.header("content-type", "application/json")
.body("{\n \"sourceDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
sourceDefinition: {
dockerImageTag: '',
dockerRepository: '',
documentationUrl: '',
icon: '',
name: '',
resourceRequirements: {
default: {
cpu_limit: '',
cpu_request: '',
memory_limit: '',
memory_request: ''
},
jobSpecific: [
{
jobType: '',
resourceRequirements: {}
}
]
}
},
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/source_definitions/create_custom');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/create_custom',
headers: {'content-type': 'application/json'},
data: {
sourceDefinition: {
dockerImageTag: '',
dockerRepository: '',
documentationUrl: '',
icon: '',
name: '',
resourceRequirements: {
default: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
jobSpecific: [{jobType: '', resourceRequirements: {}}]
}
},
workspaceId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/source_definitions/create_custom';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sourceDefinition":{"dockerImageTag":"","dockerRepository":"","documentationUrl":"","icon":"","name":"","resourceRequirements":{"default":{"cpu_limit":"","cpu_request":"","memory_limit":"","memory_request":""},"jobSpecific":[{"jobType":"","resourceRequirements":{}}]}},"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/source_definitions/create_custom',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "sourceDefinition": {\n "dockerImageTag": "",\n "dockerRepository": "",\n "documentationUrl": "",\n "icon": "",\n "name": "",\n "resourceRequirements": {\n "default": {\n "cpu_limit": "",\n "cpu_request": "",\n "memory_limit": "",\n "memory_request": ""\n },\n "jobSpecific": [\n {\n "jobType": "",\n "resourceRequirements": {}\n }\n ]\n }\n },\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"sourceDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/source_definitions/create_custom")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/source_definitions/create_custom',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
sourceDefinition: {
dockerImageTag: '',
dockerRepository: '',
documentationUrl: '',
icon: '',
name: '',
resourceRequirements: {
default: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
jobSpecific: [{jobType: '', resourceRequirements: {}}]
}
},
workspaceId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/create_custom',
headers: {'content-type': 'application/json'},
body: {
sourceDefinition: {
dockerImageTag: '',
dockerRepository: '',
documentationUrl: '',
icon: '',
name: '',
resourceRequirements: {
default: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
jobSpecific: [{jobType: '', resourceRequirements: {}}]
}
},
workspaceId: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/source_definitions/create_custom');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
sourceDefinition: {
dockerImageTag: '',
dockerRepository: '',
documentationUrl: '',
icon: '',
name: '',
resourceRequirements: {
default: {
cpu_limit: '',
cpu_request: '',
memory_limit: '',
memory_request: ''
},
jobSpecific: [
{
jobType: '',
resourceRequirements: {}
}
]
}
},
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/create_custom',
headers: {'content-type': 'application/json'},
data: {
sourceDefinition: {
dockerImageTag: '',
dockerRepository: '',
documentationUrl: '',
icon: '',
name: '',
resourceRequirements: {
default: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
jobSpecific: [{jobType: '', resourceRequirements: {}}]
}
},
workspaceId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/source_definitions/create_custom';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sourceDefinition":{"dockerImageTag":"","dockerRepository":"","documentationUrl":"","icon":"","name":"","resourceRequirements":{"default":{"cpu_limit":"","cpu_request":"","memory_limit":"","memory_request":""},"jobSpecific":[{"jobType":"","resourceRequirements":{}}]}},"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"sourceDefinition": @{ @"dockerImageTag": @"", @"dockerRepository": @"", @"documentationUrl": @"", @"icon": @"", @"name": @"", @"resourceRequirements": @{ @"default": @{ @"cpu_limit": @"", @"cpu_request": @"", @"memory_limit": @"", @"memory_request": @"" }, @"jobSpecific": @[ @{ @"jobType": @"", @"resourceRequirements": @{ } } ] } },
@"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/source_definitions/create_custom"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/source_definitions/create_custom" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"sourceDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/source_definitions/create_custom",
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([
'sourceDefinition' => [
'dockerImageTag' => '',
'dockerRepository' => '',
'documentationUrl' => '',
'icon' => '',
'name' => '',
'resourceRequirements' => [
'default' => [
'cpu_limit' => '',
'cpu_request' => '',
'memory_limit' => '',
'memory_request' => ''
],
'jobSpecific' => [
[
'jobType' => '',
'resourceRequirements' => [
]
]
]
]
],
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/source_definitions/create_custom', [
'body' => '{
"sourceDefinition": {
"dockerImageTag": "",
"dockerRepository": "",
"documentationUrl": "",
"icon": "",
"name": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
}
},
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/source_definitions/create_custom');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'sourceDefinition' => [
'dockerImageTag' => '',
'dockerRepository' => '',
'documentationUrl' => '',
'icon' => '',
'name' => '',
'resourceRequirements' => [
'default' => [
'cpu_limit' => '',
'cpu_request' => '',
'memory_limit' => '',
'memory_request' => ''
],
'jobSpecific' => [
[
'jobType' => '',
'resourceRequirements' => [
]
]
]
]
],
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'sourceDefinition' => [
'dockerImageTag' => '',
'dockerRepository' => '',
'documentationUrl' => '',
'icon' => '',
'name' => '',
'resourceRequirements' => [
'default' => [
'cpu_limit' => '',
'cpu_request' => '',
'memory_limit' => '',
'memory_request' => ''
],
'jobSpecific' => [
[
'jobType' => '',
'resourceRequirements' => [
]
]
]
]
],
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/source_definitions/create_custom');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/source_definitions/create_custom' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sourceDefinition": {
"dockerImageTag": "",
"dockerRepository": "",
"documentationUrl": "",
"icon": "",
"name": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
}
},
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/source_definitions/create_custom' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sourceDefinition": {
"dockerImageTag": "",
"dockerRepository": "",
"documentationUrl": "",
"icon": "",
"name": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
}
},
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"sourceDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/source_definitions/create_custom", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/source_definitions/create_custom"
payload = {
"sourceDefinition": {
"dockerImageTag": "",
"dockerRepository": "",
"documentationUrl": "",
"icon": "",
"name": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
}
},
"workspaceId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/source_definitions/create_custom"
payload <- "{\n \"sourceDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/source_definitions/create_custom")
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 \"sourceDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/source_definitions/create_custom') do |req|
req.body = "{\n \"sourceDefinition\": {\n \"dockerImageTag\": \"\",\n \"dockerRepository\": \"\",\n \"documentationUrl\": \"\",\n \"icon\": \"\",\n \"name\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n }\n },\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/source_definitions/create_custom";
let payload = json!({
"sourceDefinition": json!({
"dockerImageTag": "",
"dockerRepository": "",
"documentationUrl": "",
"icon": "",
"name": "",
"resourceRequirements": json!({
"default": json!({
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
}),
"jobSpecific": (
json!({
"jobType": "",
"resourceRequirements": json!({})
})
)
})
}),
"workspaceId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/source_definitions/create_custom \
--header 'content-type: application/json' \
--data '{
"sourceDefinition": {
"dockerImageTag": "",
"dockerRepository": "",
"documentationUrl": "",
"icon": "",
"name": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
}
},
"workspaceId": ""
}'
echo '{
"sourceDefinition": {
"dockerImageTag": "",
"dockerRepository": "",
"documentationUrl": "",
"icon": "",
"name": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
}
},
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/source_definitions/create_custom \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "sourceDefinition": {\n "dockerImageTag": "",\n "dockerRepository": "",\n "documentationUrl": "",\n "icon": "",\n "name": "",\n "resourceRequirements": {\n "default": {\n "cpu_limit": "",\n "cpu_request": "",\n "memory_limit": "",\n "memory_request": ""\n },\n "jobSpecific": [\n {\n "jobType": "",\n "resourceRequirements": {}\n }\n ]\n }\n },\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/source_definitions/create_custom
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"sourceDefinition": [
"dockerImageTag": "",
"dockerRepository": "",
"documentationUrl": "",
"icon": "",
"name": "",
"resourceRequirements": [
"default": [
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
],
"jobSpecific": [
[
"jobType": "",
"resourceRequirements": []
]
]
]
],
"workspaceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/source_definitions/create_custom")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Delete a source definition
{{baseUrl}}/v1/source_definitions/delete
BODY json
{
"sourceDefinitionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/source_definitions/delete");
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 \"sourceDefinitionId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/source_definitions/delete" {:content-type :json
:form-params {:sourceDefinitionId ""}})
require "http/client"
url = "{{baseUrl}}/v1/source_definitions/delete"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"sourceDefinitionId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/source_definitions/delete"),
Content = new StringContent("{\n \"sourceDefinitionId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/source_definitions/delete");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"sourceDefinitionId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/source_definitions/delete"
payload := strings.NewReader("{\n \"sourceDefinitionId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/source_definitions/delete HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 30
{
"sourceDefinitionId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/source_definitions/delete")
.setHeader("content-type", "application/json")
.setBody("{\n \"sourceDefinitionId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/source_definitions/delete"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"sourceDefinitionId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"sourceDefinitionId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/source_definitions/delete")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/source_definitions/delete")
.header("content-type", "application/json")
.body("{\n \"sourceDefinitionId\": \"\"\n}")
.asString();
const data = JSON.stringify({
sourceDefinitionId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/source_definitions/delete');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/delete',
headers: {'content-type': 'application/json'},
data: {sourceDefinitionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/source_definitions/delete';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sourceDefinitionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/source_definitions/delete',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "sourceDefinitionId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"sourceDefinitionId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/source_definitions/delete")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/source_definitions/delete',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({sourceDefinitionId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/delete',
headers: {'content-type': 'application/json'},
body: {sourceDefinitionId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/source_definitions/delete');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
sourceDefinitionId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/delete',
headers: {'content-type': 'application/json'},
data: {sourceDefinitionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/source_definitions/delete';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sourceDefinitionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"sourceDefinitionId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/source_definitions/delete"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/source_definitions/delete" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"sourceDefinitionId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/source_definitions/delete",
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([
'sourceDefinitionId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/source_definitions/delete', [
'body' => '{
"sourceDefinitionId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/source_definitions/delete');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'sourceDefinitionId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'sourceDefinitionId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/source_definitions/delete');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/source_definitions/delete' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sourceDefinitionId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/source_definitions/delete' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sourceDefinitionId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"sourceDefinitionId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/source_definitions/delete", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/source_definitions/delete"
payload = { "sourceDefinitionId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/source_definitions/delete"
payload <- "{\n \"sourceDefinitionId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/source_definitions/delete")
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 \"sourceDefinitionId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/source_definitions/delete') do |req|
req.body = "{\n \"sourceDefinitionId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/source_definitions/delete";
let payload = json!({"sourceDefinitionId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/source_definitions/delete \
--header 'content-type: application/json' \
--data '{
"sourceDefinitionId": ""
}'
echo '{
"sourceDefinitionId": ""
}' | \
http POST {{baseUrl}}/v1/source_definitions/delete \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "sourceDefinitionId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/source_definitions/delete
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["sourceDefinitionId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/source_definitions/delete")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Get a sourceDefinition that is configured for the given workspace
{{baseUrl}}/v1/source_definitions/get_for_workspace
BODY json
{
"sourceDefinitionId": "",
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/source_definitions/get_for_workspace");
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 \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/source_definitions/get_for_workspace" {:content-type :json
:form-params {:sourceDefinitionId ""
:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/source_definitions/get_for_workspace"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/source_definitions/get_for_workspace"),
Content = new StringContent("{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/source_definitions/get_for_workspace");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/source_definitions/get_for_workspace"
payload := strings.NewReader("{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/source_definitions/get_for_workspace HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 51
{
"sourceDefinitionId": "",
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/source_definitions/get_for_workspace")
.setHeader("content-type", "application/json")
.setBody("{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/source_definitions/get_for_workspace"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/source_definitions/get_for_workspace")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/source_definitions/get_for_workspace")
.header("content-type", "application/json")
.body("{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
sourceDefinitionId: '',
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/source_definitions/get_for_workspace');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/get_for_workspace',
headers: {'content-type': 'application/json'},
data: {sourceDefinitionId: '', workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/source_definitions/get_for_workspace';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sourceDefinitionId":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/source_definitions/get_for_workspace',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "sourceDefinitionId": "",\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/source_definitions/get_for_workspace")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/source_definitions/get_for_workspace',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({sourceDefinitionId: '', workspaceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/get_for_workspace',
headers: {'content-type': 'application/json'},
body: {sourceDefinitionId: '', workspaceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/source_definitions/get_for_workspace');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
sourceDefinitionId: '',
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/get_for_workspace',
headers: {'content-type': 'application/json'},
data: {sourceDefinitionId: '', workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/source_definitions/get_for_workspace';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sourceDefinitionId":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"sourceDefinitionId": @"",
@"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/source_definitions/get_for_workspace"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/source_definitions/get_for_workspace" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/source_definitions/get_for_workspace",
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([
'sourceDefinitionId' => '',
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/source_definitions/get_for_workspace', [
'body' => '{
"sourceDefinitionId": "",
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/source_definitions/get_for_workspace');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'sourceDefinitionId' => '',
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'sourceDefinitionId' => '',
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/source_definitions/get_for_workspace');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/source_definitions/get_for_workspace' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sourceDefinitionId": "",
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/source_definitions/get_for_workspace' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sourceDefinitionId": "",
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/source_definitions/get_for_workspace", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/source_definitions/get_for_workspace"
payload = {
"sourceDefinitionId": "",
"workspaceId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/source_definitions/get_for_workspace"
payload <- "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/source_definitions/get_for_workspace")
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 \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/source_definitions/get_for_workspace') do |req|
req.body = "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/source_definitions/get_for_workspace";
let payload = json!({
"sourceDefinitionId": "",
"workspaceId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/source_definitions/get_for_workspace \
--header 'content-type: application/json' \
--data '{
"sourceDefinitionId": "",
"workspaceId": ""
}'
echo '{
"sourceDefinitionId": "",
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/source_definitions/get_for_workspace \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "sourceDefinitionId": "",\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/source_definitions/get_for_workspace
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"sourceDefinitionId": "",
"workspaceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/source_definitions/get_for_workspace")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Get source
{{baseUrl}}/v1/source_definitions/get
BODY json
{
"sourceDefinitionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/source_definitions/get");
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 \"sourceDefinitionId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/source_definitions/get" {:content-type :json
:form-params {:sourceDefinitionId ""}})
require "http/client"
url = "{{baseUrl}}/v1/source_definitions/get"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"sourceDefinitionId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/source_definitions/get"),
Content = new StringContent("{\n \"sourceDefinitionId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/source_definitions/get");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"sourceDefinitionId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/source_definitions/get"
payload := strings.NewReader("{\n \"sourceDefinitionId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/source_definitions/get HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 30
{
"sourceDefinitionId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/source_definitions/get")
.setHeader("content-type", "application/json")
.setBody("{\n \"sourceDefinitionId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/source_definitions/get"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"sourceDefinitionId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"sourceDefinitionId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/source_definitions/get")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/source_definitions/get")
.header("content-type", "application/json")
.body("{\n \"sourceDefinitionId\": \"\"\n}")
.asString();
const data = JSON.stringify({
sourceDefinitionId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/source_definitions/get');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/get',
headers: {'content-type': 'application/json'},
data: {sourceDefinitionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/source_definitions/get';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sourceDefinitionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/source_definitions/get',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "sourceDefinitionId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"sourceDefinitionId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/source_definitions/get")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/source_definitions/get',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({sourceDefinitionId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/get',
headers: {'content-type': 'application/json'},
body: {sourceDefinitionId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/source_definitions/get');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
sourceDefinitionId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/get',
headers: {'content-type': 'application/json'},
data: {sourceDefinitionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/source_definitions/get';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sourceDefinitionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"sourceDefinitionId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/source_definitions/get"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/source_definitions/get" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"sourceDefinitionId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/source_definitions/get",
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([
'sourceDefinitionId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/source_definitions/get', [
'body' => '{
"sourceDefinitionId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/source_definitions/get');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'sourceDefinitionId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'sourceDefinitionId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/source_definitions/get');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/source_definitions/get' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sourceDefinitionId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/source_definitions/get' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sourceDefinitionId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"sourceDefinitionId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/source_definitions/get", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/source_definitions/get"
payload = { "sourceDefinitionId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/source_definitions/get"
payload <- "{\n \"sourceDefinitionId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/source_definitions/get")
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 \"sourceDefinitionId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/source_definitions/get') do |req|
req.body = "{\n \"sourceDefinitionId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/source_definitions/get";
let payload = json!({"sourceDefinitionId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/source_definitions/get \
--header 'content-type: application/json' \
--data '{
"sourceDefinitionId": ""
}'
echo '{
"sourceDefinitionId": ""
}' | \
http POST {{baseUrl}}/v1/source_definitions/get \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "sourceDefinitionId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/source_definitions/get
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["sourceDefinitionId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/source_definitions/get")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
List all private, non-custom sourceDefinitions, and for each indicate whether the given workspace has a grant for using the definition. Used by admins to view and modify a given workspace's grants.
{{baseUrl}}/v1/source_definitions/list_private
BODY json
{
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/source_definitions/list_private");
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 \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/source_definitions/list_private" {:content-type :json
:form-params {:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/source_definitions/list_private"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/source_definitions/list_private"),
Content = new StringContent("{\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/source_definitions/list_private");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/source_definitions/list_private"
payload := strings.NewReader("{\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/source_definitions/list_private HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/source_definitions/list_private")
.setHeader("content-type", "application/json")
.setBody("{\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/source_definitions/list_private"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/source_definitions/list_private")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/source_definitions/list_private")
.header("content-type", "application/json")
.body("{\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/source_definitions/list_private');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/list_private',
headers: {'content-type': 'application/json'},
data: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/source_definitions/list_private';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/source_definitions/list_private',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/source_definitions/list_private")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/source_definitions/list_private',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({workspaceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/list_private',
headers: {'content-type': 'application/json'},
body: {workspaceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/source_definitions/list_private');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/list_private',
headers: {'content-type': 'application/json'},
data: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/source_definitions/list_private';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/source_definitions/list_private"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/source_definitions/list_private" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/source_definitions/list_private",
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([
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/source_definitions/list_private', [
'body' => '{
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/source_definitions/list_private');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/source_definitions/list_private');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/source_definitions/list_private' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/source_definitions/list_private' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/source_definitions/list_private", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/source_definitions/list_private"
payload = { "workspaceId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/source_definitions/list_private"
payload <- "{\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/source_definitions/list_private")
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 \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/source_definitions/list_private') do |req|
req.body = "{\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/source_definitions/list_private";
let payload = json!({"workspaceId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/source_definitions/list_private \
--header 'content-type: application/json' \
--data '{
"workspaceId": ""
}'
echo '{
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/source_definitions/list_private \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/source_definitions/list_private
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["workspaceId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/source_definitions/list_private")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
List all the sourceDefinitions the current Airbyte deployment is configured to use
{{baseUrl}}/v1/source_definitions/list
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/source_definitions/list");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/source_definitions/list")
require "http/client"
url = "{{baseUrl}}/v1/source_definitions/list"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/source_definitions/list"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/source_definitions/list");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/source_definitions/list"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/source_definitions/list HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/source_definitions/list")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/source_definitions/list"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/source_definitions/list")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/source_definitions/list")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/source_definitions/list');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/v1/source_definitions/list'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/source_definitions/list';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/source_definitions/list',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/source_definitions/list")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/source_definitions/list',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'POST', url: '{{baseUrl}}/v1/source_definitions/list'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/source_definitions/list');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'POST', url: '{{baseUrl}}/v1/source_definitions/list'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/source_definitions/list';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/source_definitions/list"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/source_definitions/list" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/source_definitions/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/source_definitions/list');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/source_definitions/list');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/source_definitions/list');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/source_definitions/list' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/source_definitions/list' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/v1/source_definitions/list")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/source_definitions/list"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/source_definitions/list"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/source_definitions/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/v1/source_definitions/list') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/source_definitions/list";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/source_definitions/list
http POST {{baseUrl}}/v1/source_definitions/list
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/v1/source_definitions/list
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/source_definitions/list")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
List all the sourceDefinitions the given workspace is configured to use
{{baseUrl}}/v1/source_definitions/list_for_workspace
BODY json
{
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/source_definitions/list_for_workspace");
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 \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/source_definitions/list_for_workspace" {:content-type :json
:form-params {:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/source_definitions/list_for_workspace"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/source_definitions/list_for_workspace"),
Content = new StringContent("{\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/source_definitions/list_for_workspace");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/source_definitions/list_for_workspace"
payload := strings.NewReader("{\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/source_definitions/list_for_workspace HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/source_definitions/list_for_workspace")
.setHeader("content-type", "application/json")
.setBody("{\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/source_definitions/list_for_workspace"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/source_definitions/list_for_workspace")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/source_definitions/list_for_workspace")
.header("content-type", "application/json")
.body("{\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/source_definitions/list_for_workspace');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/list_for_workspace',
headers: {'content-type': 'application/json'},
data: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/source_definitions/list_for_workspace';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/source_definitions/list_for_workspace',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/source_definitions/list_for_workspace")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/source_definitions/list_for_workspace',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({workspaceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/list_for_workspace',
headers: {'content-type': 'application/json'},
body: {workspaceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/source_definitions/list_for_workspace');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/list_for_workspace',
headers: {'content-type': 'application/json'},
data: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/source_definitions/list_for_workspace';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/source_definitions/list_for_workspace"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/source_definitions/list_for_workspace" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/source_definitions/list_for_workspace",
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([
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/source_definitions/list_for_workspace', [
'body' => '{
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/source_definitions/list_for_workspace');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/source_definitions/list_for_workspace');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/source_definitions/list_for_workspace' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/source_definitions/list_for_workspace' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/source_definitions/list_for_workspace", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/source_definitions/list_for_workspace"
payload = { "workspaceId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/source_definitions/list_for_workspace"
payload <- "{\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/source_definitions/list_for_workspace")
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 \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/source_definitions/list_for_workspace') do |req|
req.body = "{\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/source_definitions/list_for_workspace";
let payload = json!({"workspaceId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/source_definitions/list_for_workspace \
--header 'content-type: application/json' \
--data '{
"workspaceId": ""
}'
echo '{
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/source_definitions/list_for_workspace \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/source_definitions/list_for_workspace
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["workspaceId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/source_definitions/list_for_workspace")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
List the latest sourceDefinitions Airbyte supports
{{baseUrl}}/v1/source_definitions/list_latest
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/source_definitions/list_latest");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/source_definitions/list_latest")
require "http/client"
url = "{{baseUrl}}/v1/source_definitions/list_latest"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/source_definitions/list_latest"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/source_definitions/list_latest");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/source_definitions/list_latest"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/source_definitions/list_latest HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/source_definitions/list_latest")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/source_definitions/list_latest"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/source_definitions/list_latest")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/source_definitions/list_latest")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/source_definitions/list_latest');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/list_latest'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/source_definitions/list_latest';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/source_definitions/list_latest',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/source_definitions/list_latest")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/source_definitions/list_latest',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/list_latest'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/source_definitions/list_latest');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/list_latest'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/source_definitions/list_latest';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/source_definitions/list_latest"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/source_definitions/list_latest" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/source_definitions/list_latest",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/source_definitions/list_latest');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/source_definitions/list_latest');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/source_definitions/list_latest');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/source_definitions/list_latest' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/source_definitions/list_latest' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/v1/source_definitions/list_latest")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/source_definitions/list_latest"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/source_definitions/list_latest"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/source_definitions/list_latest")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/v1/source_definitions/list_latest') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/source_definitions/list_latest";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/source_definitions/list_latest
http POST {{baseUrl}}/v1/source_definitions/list_latest
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/v1/source_definitions/list_latest
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/source_definitions/list_latest")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Update a sourceDefinition
{{baseUrl}}/v1/source_definitions/update
BODY json
{
"dockerImageTag": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
},
"sourceDefinitionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/source_definitions/update");
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 \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n },\n \"sourceDefinitionId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/source_definitions/update" {:content-type :json
:form-params {:dockerImageTag ""
:resourceRequirements {:default {:cpu_limit ""
:cpu_request ""
:memory_limit ""
:memory_request ""}
:jobSpecific [{:jobType ""
:resourceRequirements {}}]}
:sourceDefinitionId ""}})
require "http/client"
url = "{{baseUrl}}/v1/source_definitions/update"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n },\n \"sourceDefinitionId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/source_definitions/update"),
Content = new StringContent("{\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n },\n \"sourceDefinitionId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/source_definitions/update");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n },\n \"sourceDefinitionId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/source_definitions/update"
payload := strings.NewReader("{\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n },\n \"sourceDefinitionId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/source_definitions/update HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 313
{
"dockerImageTag": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
},
"sourceDefinitionId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/source_definitions/update")
.setHeader("content-type", "application/json")
.setBody("{\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n },\n \"sourceDefinitionId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/source_definitions/update"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n },\n \"sourceDefinitionId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n },\n \"sourceDefinitionId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/source_definitions/update")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/source_definitions/update")
.header("content-type", "application/json")
.body("{\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n },\n \"sourceDefinitionId\": \"\"\n}")
.asString();
const data = JSON.stringify({
dockerImageTag: '',
resourceRequirements: {
default: {
cpu_limit: '',
cpu_request: '',
memory_limit: '',
memory_request: ''
},
jobSpecific: [
{
jobType: '',
resourceRequirements: {}
}
]
},
sourceDefinitionId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/source_definitions/update');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/update',
headers: {'content-type': 'application/json'},
data: {
dockerImageTag: '',
resourceRequirements: {
default: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
jobSpecific: [{jobType: '', resourceRequirements: {}}]
},
sourceDefinitionId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/source_definitions/update';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"dockerImageTag":"","resourceRequirements":{"default":{"cpu_limit":"","cpu_request":"","memory_limit":"","memory_request":""},"jobSpecific":[{"jobType":"","resourceRequirements":{}}]},"sourceDefinitionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/source_definitions/update',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "dockerImageTag": "",\n "resourceRequirements": {\n "default": {\n "cpu_limit": "",\n "cpu_request": "",\n "memory_limit": "",\n "memory_request": ""\n },\n "jobSpecific": [\n {\n "jobType": "",\n "resourceRequirements": {}\n }\n ]\n },\n "sourceDefinitionId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n },\n \"sourceDefinitionId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/source_definitions/update")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/source_definitions/update',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
dockerImageTag: '',
resourceRequirements: {
default: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
jobSpecific: [{jobType: '', resourceRequirements: {}}]
},
sourceDefinitionId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/update',
headers: {'content-type': 'application/json'},
body: {
dockerImageTag: '',
resourceRequirements: {
default: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
jobSpecific: [{jobType: '', resourceRequirements: {}}]
},
sourceDefinitionId: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/source_definitions/update');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
dockerImageTag: '',
resourceRequirements: {
default: {
cpu_limit: '',
cpu_request: '',
memory_limit: '',
memory_request: ''
},
jobSpecific: [
{
jobType: '',
resourceRequirements: {}
}
]
},
sourceDefinitionId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/update',
headers: {'content-type': 'application/json'},
data: {
dockerImageTag: '',
resourceRequirements: {
default: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
jobSpecific: [{jobType: '', resourceRequirements: {}}]
},
sourceDefinitionId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/source_definitions/update';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"dockerImageTag":"","resourceRequirements":{"default":{"cpu_limit":"","cpu_request":"","memory_limit":"","memory_request":""},"jobSpecific":[{"jobType":"","resourceRequirements":{}}]},"sourceDefinitionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"dockerImageTag": @"",
@"resourceRequirements": @{ @"default": @{ @"cpu_limit": @"", @"cpu_request": @"", @"memory_limit": @"", @"memory_request": @"" }, @"jobSpecific": @[ @{ @"jobType": @"", @"resourceRequirements": @{ } } ] },
@"sourceDefinitionId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/source_definitions/update"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/source_definitions/update" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n },\n \"sourceDefinitionId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/source_definitions/update",
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([
'dockerImageTag' => '',
'resourceRequirements' => [
'default' => [
'cpu_limit' => '',
'cpu_request' => '',
'memory_limit' => '',
'memory_request' => ''
],
'jobSpecific' => [
[
'jobType' => '',
'resourceRequirements' => [
]
]
]
],
'sourceDefinitionId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/source_definitions/update', [
'body' => '{
"dockerImageTag": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
},
"sourceDefinitionId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/source_definitions/update');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'dockerImageTag' => '',
'resourceRequirements' => [
'default' => [
'cpu_limit' => '',
'cpu_request' => '',
'memory_limit' => '',
'memory_request' => ''
],
'jobSpecific' => [
[
'jobType' => '',
'resourceRequirements' => [
]
]
]
],
'sourceDefinitionId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'dockerImageTag' => '',
'resourceRequirements' => [
'default' => [
'cpu_limit' => '',
'cpu_request' => '',
'memory_limit' => '',
'memory_request' => ''
],
'jobSpecific' => [
[
'jobType' => '',
'resourceRequirements' => [
]
]
]
],
'sourceDefinitionId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/source_definitions/update');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/source_definitions/update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"dockerImageTag": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
},
"sourceDefinitionId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/source_definitions/update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"dockerImageTag": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
},
"sourceDefinitionId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n },\n \"sourceDefinitionId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/source_definitions/update", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/source_definitions/update"
payload = {
"dockerImageTag": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
},
"sourceDefinitionId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/source_definitions/update"
payload <- "{\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n },\n \"sourceDefinitionId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/source_definitions/update")
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 \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n },\n \"sourceDefinitionId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/source_definitions/update') do |req|
req.body = "{\n \"dockerImageTag\": \"\",\n \"resourceRequirements\": {\n \"default\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"jobSpecific\": [\n {\n \"jobType\": \"\",\n \"resourceRequirements\": {}\n }\n ]\n },\n \"sourceDefinitionId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/source_definitions/update";
let payload = json!({
"dockerImageTag": "",
"resourceRequirements": json!({
"default": json!({
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
}),
"jobSpecific": (
json!({
"jobType": "",
"resourceRequirements": json!({})
})
)
}),
"sourceDefinitionId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/source_definitions/update \
--header 'content-type: application/json' \
--data '{
"dockerImageTag": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
},
"sourceDefinitionId": ""
}'
echo '{
"dockerImageTag": "",
"resourceRequirements": {
"default": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"jobSpecific": [
{
"jobType": "",
"resourceRequirements": {}
}
]
},
"sourceDefinitionId": ""
}' | \
http POST {{baseUrl}}/v1/source_definitions/update \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "dockerImageTag": "",\n "resourceRequirements": {\n "default": {\n "cpu_limit": "",\n "cpu_request": "",\n "memory_limit": "",\n "memory_request": ""\n },\n "jobSpecific": [\n {\n "jobType": "",\n "resourceRequirements": {}\n }\n ]\n },\n "sourceDefinitionId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/source_definitions/update
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"dockerImageTag": "",
"resourceRequirements": [
"default": [
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
],
"jobSpecific": [
[
"jobType": "",
"resourceRequirements": []
]
]
],
"sourceDefinitionId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/source_definitions/update")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
grant a private, non-custom sourceDefinition to a given workspace
{{baseUrl}}/v1/source_definitions/grant_definition
BODY json
{
"sourceDefinitionId": "",
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/source_definitions/grant_definition");
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 \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/source_definitions/grant_definition" {:content-type :json
:form-params {:sourceDefinitionId ""
:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/source_definitions/grant_definition"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/source_definitions/grant_definition"),
Content = new StringContent("{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/source_definitions/grant_definition");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/source_definitions/grant_definition"
payload := strings.NewReader("{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/source_definitions/grant_definition HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 51
{
"sourceDefinitionId": "",
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/source_definitions/grant_definition")
.setHeader("content-type", "application/json")
.setBody("{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/source_definitions/grant_definition"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/source_definitions/grant_definition")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/source_definitions/grant_definition")
.header("content-type", "application/json")
.body("{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
sourceDefinitionId: '',
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/source_definitions/grant_definition');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/grant_definition',
headers: {'content-type': 'application/json'},
data: {sourceDefinitionId: '', workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/source_definitions/grant_definition';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sourceDefinitionId":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/source_definitions/grant_definition',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "sourceDefinitionId": "",\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/source_definitions/grant_definition")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/source_definitions/grant_definition',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({sourceDefinitionId: '', workspaceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/grant_definition',
headers: {'content-type': 'application/json'},
body: {sourceDefinitionId: '', workspaceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/source_definitions/grant_definition');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
sourceDefinitionId: '',
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/grant_definition',
headers: {'content-type': 'application/json'},
data: {sourceDefinitionId: '', workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/source_definitions/grant_definition';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sourceDefinitionId":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"sourceDefinitionId": @"",
@"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/source_definitions/grant_definition"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/source_definitions/grant_definition" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/source_definitions/grant_definition",
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([
'sourceDefinitionId' => '',
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/source_definitions/grant_definition', [
'body' => '{
"sourceDefinitionId": "",
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/source_definitions/grant_definition');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'sourceDefinitionId' => '',
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'sourceDefinitionId' => '',
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/source_definitions/grant_definition');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/source_definitions/grant_definition' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sourceDefinitionId": "",
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/source_definitions/grant_definition' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sourceDefinitionId": "",
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/source_definitions/grant_definition", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/source_definitions/grant_definition"
payload = {
"sourceDefinitionId": "",
"workspaceId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/source_definitions/grant_definition"
payload <- "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/source_definitions/grant_definition")
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 \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/source_definitions/grant_definition') do |req|
req.body = "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/source_definitions/grant_definition";
let payload = json!({
"sourceDefinitionId": "",
"workspaceId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/source_definitions/grant_definition \
--header 'content-type: application/json' \
--data '{
"sourceDefinitionId": "",
"workspaceId": ""
}'
echo '{
"sourceDefinitionId": "",
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/source_definitions/grant_definition \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "sourceDefinitionId": "",\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/source_definitions/grant_definition
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"sourceDefinitionId": "",
"workspaceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/source_definitions/grant_definition")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
revoke a grant to a private, non-custom sourceDefinition from a given workspace
{{baseUrl}}/v1/source_definitions/revoke_definition
BODY json
{
"sourceDefinitionId": "",
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/source_definitions/revoke_definition");
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 \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/source_definitions/revoke_definition" {:content-type :json
:form-params {:sourceDefinitionId ""
:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/source_definitions/revoke_definition"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/source_definitions/revoke_definition"),
Content = new StringContent("{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/source_definitions/revoke_definition");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/source_definitions/revoke_definition"
payload := strings.NewReader("{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/source_definitions/revoke_definition HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 51
{
"sourceDefinitionId": "",
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/source_definitions/revoke_definition")
.setHeader("content-type", "application/json")
.setBody("{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/source_definitions/revoke_definition"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/source_definitions/revoke_definition")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/source_definitions/revoke_definition")
.header("content-type", "application/json")
.body("{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
sourceDefinitionId: '',
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/source_definitions/revoke_definition');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/revoke_definition',
headers: {'content-type': 'application/json'},
data: {sourceDefinitionId: '', workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/source_definitions/revoke_definition';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sourceDefinitionId":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/source_definitions/revoke_definition',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "sourceDefinitionId": "",\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/source_definitions/revoke_definition")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/source_definitions/revoke_definition',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({sourceDefinitionId: '', workspaceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/revoke_definition',
headers: {'content-type': 'application/json'},
body: {sourceDefinitionId: '', workspaceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/source_definitions/revoke_definition');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
sourceDefinitionId: '',
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definitions/revoke_definition',
headers: {'content-type': 'application/json'},
data: {sourceDefinitionId: '', workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/source_definitions/revoke_definition';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sourceDefinitionId":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"sourceDefinitionId": @"",
@"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/source_definitions/revoke_definition"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/source_definitions/revoke_definition" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/source_definitions/revoke_definition",
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([
'sourceDefinitionId' => '',
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/source_definitions/revoke_definition', [
'body' => '{
"sourceDefinitionId": "",
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/source_definitions/revoke_definition');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'sourceDefinitionId' => '',
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'sourceDefinitionId' => '',
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/source_definitions/revoke_definition');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/source_definitions/revoke_definition' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sourceDefinitionId": "",
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/source_definitions/revoke_definition' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sourceDefinitionId": "",
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/source_definitions/revoke_definition", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/source_definitions/revoke_definition"
payload = {
"sourceDefinitionId": "",
"workspaceId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/source_definitions/revoke_definition"
payload <- "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/source_definitions/revoke_definition")
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 \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/source_definitions/revoke_definition') do |req|
req.body = "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/source_definitions/revoke_definition";
let payload = json!({
"sourceDefinitionId": "",
"workspaceId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/source_definitions/revoke_definition \
--header 'content-type: application/json' \
--data '{
"sourceDefinitionId": "",
"workspaceId": ""
}'
echo '{
"sourceDefinitionId": "",
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/source_definitions/revoke_definition \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "sourceDefinitionId": "",\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/source_definitions/revoke_definition
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"sourceDefinitionId": "",
"workspaceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/source_definitions/revoke_definition")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Get specification for a SourceDefinition.
{{baseUrl}}/v1/source_definition_specifications/get
BODY json
{
"sourceDefinitionId": "",
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/source_definition_specifications/get");
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 \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/source_definition_specifications/get" {:content-type :json
:form-params {:sourceDefinitionId ""
:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/source_definition_specifications/get"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/source_definition_specifications/get"),
Content = new StringContent("{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/source_definition_specifications/get");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/source_definition_specifications/get"
payload := strings.NewReader("{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/source_definition_specifications/get HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 51
{
"sourceDefinitionId": "",
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/source_definition_specifications/get")
.setHeader("content-type", "application/json")
.setBody("{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/source_definition_specifications/get"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/source_definition_specifications/get")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/source_definition_specifications/get")
.header("content-type", "application/json")
.body("{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
sourceDefinitionId: '',
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/source_definition_specifications/get');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definition_specifications/get',
headers: {'content-type': 'application/json'},
data: {sourceDefinitionId: '', workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/source_definition_specifications/get';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sourceDefinitionId":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/source_definition_specifications/get',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "sourceDefinitionId": "",\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/source_definition_specifications/get")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/source_definition_specifications/get',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({sourceDefinitionId: '', workspaceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definition_specifications/get',
headers: {'content-type': 'application/json'},
body: {sourceDefinitionId: '', workspaceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/source_definition_specifications/get');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
sourceDefinitionId: '',
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_definition_specifications/get',
headers: {'content-type': 'application/json'},
data: {sourceDefinitionId: '', workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/source_definition_specifications/get';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sourceDefinitionId":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"sourceDefinitionId": @"",
@"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/source_definition_specifications/get"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/source_definition_specifications/get" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/source_definition_specifications/get",
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([
'sourceDefinitionId' => '',
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/source_definition_specifications/get', [
'body' => '{
"sourceDefinitionId": "",
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/source_definition_specifications/get');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'sourceDefinitionId' => '',
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'sourceDefinitionId' => '',
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/source_definition_specifications/get');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/source_definition_specifications/get' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sourceDefinitionId": "",
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/source_definition_specifications/get' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sourceDefinitionId": "",
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/source_definition_specifications/get", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/source_definition_specifications/get"
payload = {
"sourceDefinitionId": "",
"workspaceId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/source_definition_specifications/get"
payload <- "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/source_definition_specifications/get")
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 \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/source_definition_specifications/get') do |req|
req.body = "{\n \"sourceDefinitionId\": \"\",\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/source_definition_specifications/get";
let payload = json!({
"sourceDefinitionId": "",
"workspaceId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/source_definition_specifications/get \
--header 'content-type: application/json' \
--data '{
"sourceDefinitionId": "",
"workspaceId": ""
}'
echo '{
"sourceDefinitionId": "",
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/source_definition_specifications/get \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "sourceDefinitionId": "",\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/source_definition_specifications/get
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"sourceDefinitionId": "",
"workspaceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/source_definition_specifications/get")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"connectionSpecification": {
"user": {
"type": "string"
}
}
}
POST
Given a source connector definition ID, return the URL to the consent screen where to redirect the user to.
{{baseUrl}}/v1/source_oauths/get_consent_url
BODY json
{
"oAuthInputConfiguration": "",
"redirectUrl": "",
"sourceDefinitionId": "",
"sourceId": "",
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/source_oauths/get_consent_url");
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 \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/source_oauths/get_consent_url" {:content-type :json
:form-params {:oAuthInputConfiguration ""
:redirectUrl ""
:sourceDefinitionId ""
:sourceId ""
:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/source_oauths/get_consent_url"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/source_oauths/get_consent_url"),
Content = new StringContent("{\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/source_oauths/get_consent_url");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/source_oauths/get_consent_url"
payload := strings.NewReader("{\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/source_oauths/get_consent_url HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 123
{
"oAuthInputConfiguration": "",
"redirectUrl": "",
"sourceDefinitionId": "",
"sourceId": "",
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/source_oauths/get_consent_url")
.setHeader("content-type", "application/json")
.setBody("{\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/source_oauths/get_consent_url"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/source_oauths/get_consent_url")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/source_oauths/get_consent_url")
.header("content-type", "application/json")
.body("{\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
oAuthInputConfiguration: '',
redirectUrl: '',
sourceDefinitionId: '',
sourceId: '',
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/source_oauths/get_consent_url');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_oauths/get_consent_url',
headers: {'content-type': 'application/json'},
data: {
oAuthInputConfiguration: '',
redirectUrl: '',
sourceDefinitionId: '',
sourceId: '',
workspaceId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/source_oauths/get_consent_url';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"oAuthInputConfiguration":"","redirectUrl":"","sourceDefinitionId":"","sourceId":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/source_oauths/get_consent_url',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "oAuthInputConfiguration": "",\n "redirectUrl": "",\n "sourceDefinitionId": "",\n "sourceId": "",\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/source_oauths/get_consent_url")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/source_oauths/get_consent_url',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
oAuthInputConfiguration: '',
redirectUrl: '',
sourceDefinitionId: '',
sourceId: '',
workspaceId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_oauths/get_consent_url',
headers: {'content-type': 'application/json'},
body: {
oAuthInputConfiguration: '',
redirectUrl: '',
sourceDefinitionId: '',
sourceId: '',
workspaceId: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/source_oauths/get_consent_url');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
oAuthInputConfiguration: '',
redirectUrl: '',
sourceDefinitionId: '',
sourceId: '',
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_oauths/get_consent_url',
headers: {'content-type': 'application/json'},
data: {
oAuthInputConfiguration: '',
redirectUrl: '',
sourceDefinitionId: '',
sourceId: '',
workspaceId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/source_oauths/get_consent_url';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"oAuthInputConfiguration":"","redirectUrl":"","sourceDefinitionId":"","sourceId":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"oAuthInputConfiguration": @"",
@"redirectUrl": @"",
@"sourceDefinitionId": @"",
@"sourceId": @"",
@"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/source_oauths/get_consent_url"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/source_oauths/get_consent_url" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/source_oauths/get_consent_url",
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([
'oAuthInputConfiguration' => '',
'redirectUrl' => '',
'sourceDefinitionId' => '',
'sourceId' => '',
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/source_oauths/get_consent_url', [
'body' => '{
"oAuthInputConfiguration": "",
"redirectUrl": "",
"sourceDefinitionId": "",
"sourceId": "",
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/source_oauths/get_consent_url');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'oAuthInputConfiguration' => '',
'redirectUrl' => '',
'sourceDefinitionId' => '',
'sourceId' => '',
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'oAuthInputConfiguration' => '',
'redirectUrl' => '',
'sourceDefinitionId' => '',
'sourceId' => '',
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/source_oauths/get_consent_url');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/source_oauths/get_consent_url' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"oAuthInputConfiguration": "",
"redirectUrl": "",
"sourceDefinitionId": "",
"sourceId": "",
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/source_oauths/get_consent_url' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"oAuthInputConfiguration": "",
"redirectUrl": "",
"sourceDefinitionId": "",
"sourceId": "",
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/source_oauths/get_consent_url", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/source_oauths/get_consent_url"
payload = {
"oAuthInputConfiguration": "",
"redirectUrl": "",
"sourceDefinitionId": "",
"sourceId": "",
"workspaceId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/source_oauths/get_consent_url"
payload <- "{\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/source_oauths/get_consent_url")
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 \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/source_oauths/get_consent_url') do |req|
req.body = "{\n \"oAuthInputConfiguration\": \"\",\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/source_oauths/get_consent_url";
let payload = json!({
"oAuthInputConfiguration": "",
"redirectUrl": "",
"sourceDefinitionId": "",
"sourceId": "",
"workspaceId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/source_oauths/get_consent_url \
--header 'content-type: application/json' \
--data '{
"oAuthInputConfiguration": "",
"redirectUrl": "",
"sourceDefinitionId": "",
"sourceId": "",
"workspaceId": ""
}'
echo '{
"oAuthInputConfiguration": "",
"redirectUrl": "",
"sourceDefinitionId": "",
"sourceId": "",
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/source_oauths/get_consent_url \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "oAuthInputConfiguration": "",\n "redirectUrl": "",\n "sourceDefinitionId": "",\n "sourceId": "",\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/source_oauths/get_consent_url
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"oAuthInputConfiguration": "",
"redirectUrl": "",
"sourceDefinitionId": "",
"sourceId": "",
"workspaceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/source_oauths/get_consent_url")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Given a source def ID generate an access-refresh token etc.
{{baseUrl}}/v1/source_oauths/complete_oauth
BODY json
{
"oAuthInputConfiguration": "",
"queryParams": {},
"redirectUrl": "",
"sourceDefinitionId": "",
"sourceId": "",
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/source_oauths/complete_oauth");
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 \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/source_oauths/complete_oauth" {:content-type :json
:form-params {:oAuthInputConfiguration ""
:queryParams {}
:redirectUrl ""
:sourceDefinitionId ""
:sourceId ""
:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/source_oauths/complete_oauth"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/source_oauths/complete_oauth"),
Content = new StringContent("{\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/source_oauths/complete_oauth");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/source_oauths/complete_oauth"
payload := strings.NewReader("{\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/source_oauths/complete_oauth HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 144
{
"oAuthInputConfiguration": "",
"queryParams": {},
"redirectUrl": "",
"sourceDefinitionId": "",
"sourceId": "",
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/source_oauths/complete_oauth")
.setHeader("content-type", "application/json")
.setBody("{\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/source_oauths/complete_oauth"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/source_oauths/complete_oauth")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/source_oauths/complete_oauth")
.header("content-type", "application/json")
.body("{\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
oAuthInputConfiguration: '',
queryParams: {},
redirectUrl: '',
sourceDefinitionId: '',
sourceId: '',
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/source_oauths/complete_oauth');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_oauths/complete_oauth',
headers: {'content-type': 'application/json'},
data: {
oAuthInputConfiguration: '',
queryParams: {},
redirectUrl: '',
sourceDefinitionId: '',
sourceId: '',
workspaceId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/source_oauths/complete_oauth';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"oAuthInputConfiguration":"","queryParams":{},"redirectUrl":"","sourceDefinitionId":"","sourceId":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/source_oauths/complete_oauth',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "oAuthInputConfiguration": "",\n "queryParams": {},\n "redirectUrl": "",\n "sourceDefinitionId": "",\n "sourceId": "",\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/source_oauths/complete_oauth")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/source_oauths/complete_oauth',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
oAuthInputConfiguration: '',
queryParams: {},
redirectUrl: '',
sourceDefinitionId: '',
sourceId: '',
workspaceId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_oauths/complete_oauth',
headers: {'content-type': 'application/json'},
body: {
oAuthInputConfiguration: '',
queryParams: {},
redirectUrl: '',
sourceDefinitionId: '',
sourceId: '',
workspaceId: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/source_oauths/complete_oauth');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
oAuthInputConfiguration: '',
queryParams: {},
redirectUrl: '',
sourceDefinitionId: '',
sourceId: '',
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/source_oauths/complete_oauth',
headers: {'content-type': 'application/json'},
data: {
oAuthInputConfiguration: '',
queryParams: {},
redirectUrl: '',
sourceDefinitionId: '',
sourceId: '',
workspaceId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/source_oauths/complete_oauth';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"oAuthInputConfiguration":"","queryParams":{},"redirectUrl":"","sourceDefinitionId":"","sourceId":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"oAuthInputConfiguration": @"",
@"queryParams": @{ },
@"redirectUrl": @"",
@"sourceDefinitionId": @"",
@"sourceId": @"",
@"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/source_oauths/complete_oauth"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/source_oauths/complete_oauth" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/source_oauths/complete_oauth",
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([
'oAuthInputConfiguration' => '',
'queryParams' => [
],
'redirectUrl' => '',
'sourceDefinitionId' => '',
'sourceId' => '',
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/source_oauths/complete_oauth', [
'body' => '{
"oAuthInputConfiguration": "",
"queryParams": {},
"redirectUrl": "",
"sourceDefinitionId": "",
"sourceId": "",
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/source_oauths/complete_oauth');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'oAuthInputConfiguration' => '',
'queryParams' => [
],
'redirectUrl' => '',
'sourceDefinitionId' => '',
'sourceId' => '',
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'oAuthInputConfiguration' => '',
'queryParams' => [
],
'redirectUrl' => '',
'sourceDefinitionId' => '',
'sourceId' => '',
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/source_oauths/complete_oauth');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/source_oauths/complete_oauth' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"oAuthInputConfiguration": "",
"queryParams": {},
"redirectUrl": "",
"sourceDefinitionId": "",
"sourceId": "",
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/source_oauths/complete_oauth' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"oAuthInputConfiguration": "",
"queryParams": {},
"redirectUrl": "",
"sourceDefinitionId": "",
"sourceId": "",
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/source_oauths/complete_oauth", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/source_oauths/complete_oauth"
payload = {
"oAuthInputConfiguration": "",
"queryParams": {},
"redirectUrl": "",
"sourceDefinitionId": "",
"sourceId": "",
"workspaceId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/source_oauths/complete_oauth"
payload <- "{\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/source_oauths/complete_oauth")
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 \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/source_oauths/complete_oauth') do |req|
req.body = "{\n \"oAuthInputConfiguration\": \"\",\n \"queryParams\": {},\n \"redirectUrl\": \"\",\n \"sourceDefinitionId\": \"\",\n \"sourceId\": \"\",\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/source_oauths/complete_oauth";
let payload = json!({
"oAuthInputConfiguration": "",
"queryParams": json!({}),
"redirectUrl": "",
"sourceDefinitionId": "",
"sourceId": "",
"workspaceId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/source_oauths/complete_oauth \
--header 'content-type: application/json' \
--data '{
"oAuthInputConfiguration": "",
"queryParams": {},
"redirectUrl": "",
"sourceDefinitionId": "",
"sourceId": "",
"workspaceId": ""
}'
echo '{
"oAuthInputConfiguration": "",
"queryParams": {},
"redirectUrl": "",
"sourceDefinitionId": "",
"sourceId": "",
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/source_oauths/complete_oauth \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "oAuthInputConfiguration": "",\n "queryParams": {},\n "redirectUrl": "",\n "sourceDefinitionId": "",\n "sourceId": "",\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/source_oauths/complete_oauth
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"oAuthInputConfiguration": "",
"queryParams": [],
"redirectUrl": "",
"sourceDefinitionId": "",
"sourceId": "",
"workspaceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/source_oauths/complete_oauth")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Create or update the state for a connection.
{{baseUrl}}/v1/state/create_or_update
BODY json
{
"connectionId": "",
"connectionState": {
"connectionId": "",
"globalState": {
"shared_state": {},
"streamStates": [
{
"streamDescriptor": {
"name": "",
"namespace": ""
},
"streamState": {}
}
]
},
"state": {},
"stateType": "",
"streamState": [
{}
]
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/state/create_or_update");
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 \"connectionId\": \"\",\n \"connectionState\": {\n \"connectionId\": \"\",\n \"globalState\": {\n \"shared_state\": {},\n \"streamStates\": [\n {\n \"streamDescriptor\": {\n \"name\": \"\",\n \"namespace\": \"\"\n },\n \"streamState\": {}\n }\n ]\n },\n \"state\": {},\n \"stateType\": \"\",\n \"streamState\": [\n {}\n ]\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/state/create_or_update" {:content-type :json
:form-params {:connectionId ""
:connectionState {:connectionId ""
:globalState {:shared_state {}
:streamStates [{:streamDescriptor {:name ""
:namespace ""}
:streamState {}}]}
:state {}
:stateType ""
:streamState [{}]}}})
require "http/client"
url = "{{baseUrl}}/v1/state/create_or_update"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"connectionId\": \"\",\n \"connectionState\": {\n \"connectionId\": \"\",\n \"globalState\": {\n \"shared_state\": {},\n \"streamStates\": [\n {\n \"streamDescriptor\": {\n \"name\": \"\",\n \"namespace\": \"\"\n },\n \"streamState\": {}\n }\n ]\n },\n \"state\": {},\n \"stateType\": \"\",\n \"streamState\": [\n {}\n ]\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/state/create_or_update"),
Content = new StringContent("{\n \"connectionId\": \"\",\n \"connectionState\": {\n \"connectionId\": \"\",\n \"globalState\": {\n \"shared_state\": {},\n \"streamStates\": [\n {\n \"streamDescriptor\": {\n \"name\": \"\",\n \"namespace\": \"\"\n },\n \"streamState\": {}\n }\n ]\n },\n \"state\": {},\n \"stateType\": \"\",\n \"streamState\": [\n {}\n ]\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/state/create_or_update");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"connectionId\": \"\",\n \"connectionState\": {\n \"connectionId\": \"\",\n \"globalState\": {\n \"shared_state\": {},\n \"streamStates\": [\n {\n \"streamDescriptor\": {\n \"name\": \"\",\n \"namespace\": \"\"\n },\n \"streamState\": {}\n }\n ]\n },\n \"state\": {},\n \"stateType\": \"\",\n \"streamState\": [\n {}\n ]\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/state/create_or_update"
payload := strings.NewReader("{\n \"connectionId\": \"\",\n \"connectionState\": {\n \"connectionId\": \"\",\n \"globalState\": {\n \"shared_state\": {},\n \"streamStates\": [\n {\n \"streamDescriptor\": {\n \"name\": \"\",\n \"namespace\": \"\"\n },\n \"streamState\": {}\n }\n ]\n },\n \"state\": {},\n \"stateType\": \"\",\n \"streamState\": [\n {}\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/state/create_or_update HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 381
{
"connectionId": "",
"connectionState": {
"connectionId": "",
"globalState": {
"shared_state": {},
"streamStates": [
{
"streamDescriptor": {
"name": "",
"namespace": ""
},
"streamState": {}
}
]
},
"state": {},
"stateType": "",
"streamState": [
{}
]
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/state/create_or_update")
.setHeader("content-type", "application/json")
.setBody("{\n \"connectionId\": \"\",\n \"connectionState\": {\n \"connectionId\": \"\",\n \"globalState\": {\n \"shared_state\": {},\n \"streamStates\": [\n {\n \"streamDescriptor\": {\n \"name\": \"\",\n \"namespace\": \"\"\n },\n \"streamState\": {}\n }\n ]\n },\n \"state\": {},\n \"stateType\": \"\",\n \"streamState\": [\n {}\n ]\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/state/create_or_update"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"connectionId\": \"\",\n \"connectionState\": {\n \"connectionId\": \"\",\n \"globalState\": {\n \"shared_state\": {},\n \"streamStates\": [\n {\n \"streamDescriptor\": {\n \"name\": \"\",\n \"namespace\": \"\"\n },\n \"streamState\": {}\n }\n ]\n },\n \"state\": {},\n \"stateType\": \"\",\n \"streamState\": [\n {}\n ]\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"connectionId\": \"\",\n \"connectionState\": {\n \"connectionId\": \"\",\n \"globalState\": {\n \"shared_state\": {},\n \"streamStates\": [\n {\n \"streamDescriptor\": {\n \"name\": \"\",\n \"namespace\": \"\"\n },\n \"streamState\": {}\n }\n ]\n },\n \"state\": {},\n \"stateType\": \"\",\n \"streamState\": [\n {}\n ]\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/state/create_or_update")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/state/create_or_update")
.header("content-type", "application/json")
.body("{\n \"connectionId\": \"\",\n \"connectionState\": {\n \"connectionId\": \"\",\n \"globalState\": {\n \"shared_state\": {},\n \"streamStates\": [\n {\n \"streamDescriptor\": {\n \"name\": \"\",\n \"namespace\": \"\"\n },\n \"streamState\": {}\n }\n ]\n },\n \"state\": {},\n \"stateType\": \"\",\n \"streamState\": [\n {}\n ]\n }\n}")
.asString();
const data = JSON.stringify({
connectionId: '',
connectionState: {
connectionId: '',
globalState: {
shared_state: {},
streamStates: [
{
streamDescriptor: {
name: '',
namespace: ''
},
streamState: {}
}
]
},
state: {},
stateType: '',
streamState: [
{}
]
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/state/create_or_update');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/state/create_or_update',
headers: {'content-type': 'application/json'},
data: {
connectionId: '',
connectionState: {
connectionId: '',
globalState: {
shared_state: {},
streamStates: [{streamDescriptor: {name: '', namespace: ''}, streamState: {}}]
},
state: {},
stateType: '',
streamState: [{}]
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/state/create_or_update';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionId":"","connectionState":{"connectionId":"","globalState":{"shared_state":{},"streamStates":[{"streamDescriptor":{"name":"","namespace":""},"streamState":{}}]},"state":{},"stateType":"","streamState":[{}]}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/state/create_or_update',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "connectionId": "",\n "connectionState": {\n "connectionId": "",\n "globalState": {\n "shared_state": {},\n "streamStates": [\n {\n "streamDescriptor": {\n "name": "",\n "namespace": ""\n },\n "streamState": {}\n }\n ]\n },\n "state": {},\n "stateType": "",\n "streamState": [\n {}\n ]\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"connectionId\": \"\",\n \"connectionState\": {\n \"connectionId\": \"\",\n \"globalState\": {\n \"shared_state\": {},\n \"streamStates\": [\n {\n \"streamDescriptor\": {\n \"name\": \"\",\n \"namespace\": \"\"\n },\n \"streamState\": {}\n }\n ]\n },\n \"state\": {},\n \"stateType\": \"\",\n \"streamState\": [\n {}\n ]\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/state/create_or_update")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/state/create_or_update',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
connectionId: '',
connectionState: {
connectionId: '',
globalState: {
shared_state: {},
streamStates: [{streamDescriptor: {name: '', namespace: ''}, streamState: {}}]
},
state: {},
stateType: '',
streamState: [{}]
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/state/create_or_update',
headers: {'content-type': 'application/json'},
body: {
connectionId: '',
connectionState: {
connectionId: '',
globalState: {
shared_state: {},
streamStates: [{streamDescriptor: {name: '', namespace: ''}, streamState: {}}]
},
state: {},
stateType: '',
streamState: [{}]
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/state/create_or_update');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
connectionId: '',
connectionState: {
connectionId: '',
globalState: {
shared_state: {},
streamStates: [
{
streamDescriptor: {
name: '',
namespace: ''
},
streamState: {}
}
]
},
state: {},
stateType: '',
streamState: [
{}
]
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/state/create_or_update',
headers: {'content-type': 'application/json'},
data: {
connectionId: '',
connectionState: {
connectionId: '',
globalState: {
shared_state: {},
streamStates: [{streamDescriptor: {name: '', namespace: ''}, streamState: {}}]
},
state: {},
stateType: '',
streamState: [{}]
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/state/create_or_update';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionId":"","connectionState":{"connectionId":"","globalState":{"shared_state":{},"streamStates":[{"streamDescriptor":{"name":"","namespace":""},"streamState":{}}]},"state":{},"stateType":"","streamState":[{}]}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"connectionId": @"",
@"connectionState": @{ @"connectionId": @"", @"globalState": @{ @"shared_state": @{ }, @"streamStates": @[ @{ @"streamDescriptor": @{ @"name": @"", @"namespace": @"" }, @"streamState": @{ } } ] }, @"state": @{ }, @"stateType": @"", @"streamState": @[ @{ } ] } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/state/create_or_update"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/state/create_or_update" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"connectionId\": \"\",\n \"connectionState\": {\n \"connectionId\": \"\",\n \"globalState\": {\n \"shared_state\": {},\n \"streamStates\": [\n {\n \"streamDescriptor\": {\n \"name\": \"\",\n \"namespace\": \"\"\n },\n \"streamState\": {}\n }\n ]\n },\n \"state\": {},\n \"stateType\": \"\",\n \"streamState\": [\n {}\n ]\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/state/create_or_update",
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([
'connectionId' => '',
'connectionState' => [
'connectionId' => '',
'globalState' => [
'shared_state' => [
],
'streamStates' => [
[
'streamDescriptor' => [
'name' => '',
'namespace' => ''
],
'streamState' => [
]
]
]
],
'state' => [
],
'stateType' => '',
'streamState' => [
[
]
]
]
]),
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;
}
request('POST', '{{baseUrl}}/v1/state/create_or_update', [
'body' => '{
"connectionId": "",
"connectionState": {
"connectionId": "",
"globalState": {
"shared_state": {},
"streamStates": [
{
"streamDescriptor": {
"name": "",
"namespace": ""
},
"streamState": {}
}
]
},
"state": {},
"stateType": "",
"streamState": [
{}
]
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/state/create_or_update');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'connectionId' => '',
'connectionState' => [
'connectionId' => '',
'globalState' => [
'shared_state' => [
],
'streamStates' => [
[
'streamDescriptor' => [
'name' => '',
'namespace' => ''
],
'streamState' => [
]
]
]
],
'state' => [
],
'stateType' => '',
'streamState' => [
[
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'connectionId' => '',
'connectionState' => [
'connectionId' => '',
'globalState' => [
'shared_state' => [
],
'streamStates' => [
[
'streamDescriptor' => [
'name' => '',
'namespace' => ''
],
'streamState' => [
]
]
]
],
'state' => [
],
'stateType' => '',
'streamState' => [
[
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/state/create_or_update');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/state/create_or_update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionId": "",
"connectionState": {
"connectionId": "",
"globalState": {
"shared_state": {},
"streamStates": [
{
"streamDescriptor": {
"name": "",
"namespace": ""
},
"streamState": {}
}
]
},
"state": {},
"stateType": "",
"streamState": [
{}
]
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/state/create_or_update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionId": "",
"connectionState": {
"connectionId": "",
"globalState": {
"shared_state": {},
"streamStates": [
{
"streamDescriptor": {
"name": "",
"namespace": ""
},
"streamState": {}
}
]
},
"state": {},
"stateType": "",
"streamState": [
{}
]
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"connectionId\": \"\",\n \"connectionState\": {\n \"connectionId\": \"\",\n \"globalState\": {\n \"shared_state\": {},\n \"streamStates\": [\n {\n \"streamDescriptor\": {\n \"name\": \"\",\n \"namespace\": \"\"\n },\n \"streamState\": {}\n }\n ]\n },\n \"state\": {},\n \"stateType\": \"\",\n \"streamState\": [\n {}\n ]\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/state/create_or_update", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/state/create_or_update"
payload = {
"connectionId": "",
"connectionState": {
"connectionId": "",
"globalState": {
"shared_state": {},
"streamStates": [
{
"streamDescriptor": {
"name": "",
"namespace": ""
},
"streamState": {}
}
]
},
"state": {},
"stateType": "",
"streamState": [{}]
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/state/create_or_update"
payload <- "{\n \"connectionId\": \"\",\n \"connectionState\": {\n \"connectionId\": \"\",\n \"globalState\": {\n \"shared_state\": {},\n \"streamStates\": [\n {\n \"streamDescriptor\": {\n \"name\": \"\",\n \"namespace\": \"\"\n },\n \"streamState\": {}\n }\n ]\n },\n \"state\": {},\n \"stateType\": \"\",\n \"streamState\": [\n {}\n ]\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/state/create_or_update")
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 \"connectionId\": \"\",\n \"connectionState\": {\n \"connectionId\": \"\",\n \"globalState\": {\n \"shared_state\": {},\n \"streamStates\": [\n {\n \"streamDescriptor\": {\n \"name\": \"\",\n \"namespace\": \"\"\n },\n \"streamState\": {}\n }\n ]\n },\n \"state\": {},\n \"stateType\": \"\",\n \"streamState\": [\n {}\n ]\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/state/create_or_update') do |req|
req.body = "{\n \"connectionId\": \"\",\n \"connectionState\": {\n \"connectionId\": \"\",\n \"globalState\": {\n \"shared_state\": {},\n \"streamStates\": [\n {\n \"streamDescriptor\": {\n \"name\": \"\",\n \"namespace\": \"\"\n },\n \"streamState\": {}\n }\n ]\n },\n \"state\": {},\n \"stateType\": \"\",\n \"streamState\": [\n {}\n ]\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/state/create_or_update";
let payload = json!({
"connectionId": "",
"connectionState": json!({
"connectionId": "",
"globalState": json!({
"shared_state": json!({}),
"streamStates": (
json!({
"streamDescriptor": json!({
"name": "",
"namespace": ""
}),
"streamState": json!({})
})
)
}),
"state": json!({}),
"stateType": "",
"streamState": (json!({}))
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/state/create_or_update \
--header 'content-type: application/json' \
--data '{
"connectionId": "",
"connectionState": {
"connectionId": "",
"globalState": {
"shared_state": {},
"streamStates": [
{
"streamDescriptor": {
"name": "",
"namespace": ""
},
"streamState": {}
}
]
},
"state": {},
"stateType": "",
"streamState": [
{}
]
}
}'
echo '{
"connectionId": "",
"connectionState": {
"connectionId": "",
"globalState": {
"shared_state": {},
"streamStates": [
{
"streamDescriptor": {
"name": "",
"namespace": ""
},
"streamState": {}
}
]
},
"state": {},
"stateType": "",
"streamState": [
{}
]
}
}' | \
http POST {{baseUrl}}/v1/state/create_or_update \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "connectionId": "",\n "connectionState": {\n "connectionId": "",\n "globalState": {\n "shared_state": {},\n "streamStates": [\n {\n "streamDescriptor": {\n "name": "",\n "namespace": ""\n },\n "streamState": {}\n }\n ]\n },\n "state": {},\n "stateType": "",\n "streamState": [\n {}\n ]\n }\n}' \
--output-document \
- {{baseUrl}}/v1/state/create_or_update
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"connectionId": "",
"connectionState": [
"connectionId": "",
"globalState": [
"shared_state": [],
"streamStates": [
[
"streamDescriptor": [
"name": "",
"namespace": ""
],
"streamState": []
]
]
],
"state": [],
"stateType": "",
"streamState": [[]]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/state/create_or_update")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Fetch the current state for a connection.
{{baseUrl}}/v1/state/get
BODY json
{
"connectionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/state/get");
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 \"connectionId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/state/get" {:content-type :json
:form-params {:connectionId ""}})
require "http/client"
url = "{{baseUrl}}/v1/state/get"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"connectionId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/state/get"),
Content = new StringContent("{\n \"connectionId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/state/get");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"connectionId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/state/get"
payload := strings.NewReader("{\n \"connectionId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/state/get HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 24
{
"connectionId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/state/get")
.setHeader("content-type", "application/json")
.setBody("{\n \"connectionId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/state/get"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"connectionId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"connectionId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/state/get")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/state/get")
.header("content-type", "application/json")
.body("{\n \"connectionId\": \"\"\n}")
.asString();
const data = JSON.stringify({
connectionId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/state/get');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/state/get',
headers: {'content-type': 'application/json'},
data: {connectionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/state/get';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/state/get',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "connectionId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"connectionId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/state/get")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/state/get',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({connectionId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/state/get',
headers: {'content-type': 'application/json'},
body: {connectionId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/state/get');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
connectionId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/state/get',
headers: {'content-type': 'application/json'},
data: {connectionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/state/get';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"connectionId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/state/get"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/state/get" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"connectionId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/state/get",
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([
'connectionId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/state/get', [
'body' => '{
"connectionId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/state/get');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'connectionId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'connectionId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/state/get');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/state/get' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/state/get' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"connectionId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/state/get", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/state/get"
payload = { "connectionId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/state/get"
payload <- "{\n \"connectionId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/state/get")
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 \"connectionId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/state/get') do |req|
req.body = "{\n \"connectionId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/state/get";
let payload = json!({"connectionId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/state/get \
--header 'content-type: application/json' \
--data '{
"connectionId": ""
}'
echo '{
"connectionId": ""
}' | \
http POST {{baseUrl}}/v1/state/get \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "connectionId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/state/get
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["connectionId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/state/get")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Create a connection
{{baseUrl}}/v1/web_backend/connections/create
BODY json
{
"destinationId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"operationIds": [],
"operations": [
{
"name": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
},
"workspaceId": ""
}
],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"sourceCatalogId": "",
"sourceId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/web_backend/connections/create");
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 \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"operationIds\": [],\n \"operations\": [\n {\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/web_backend/connections/create" {:content-type :json
:form-params {:destinationId ""
:geography ""
:name ""
:namespaceDefinition ""
:namespaceFormat ""
:nonBreakingChangesPreference ""
:operationIds []
:operations [{:name ""
:operatorConfiguration {:dbt {:dbtArguments ""
:dockerImage ""
:gitRepoBranch ""
:gitRepoUrl ""}
:normalization {:option ""}
:operatorType ""
:webhook {:dbtCloud {:accountId 0
:jobId 0}
:executionBody ""
:executionUrl ""
:webhookConfigId ""
:webhookType ""}}
:workspaceId ""}]
:prefix ""
:resourceRequirements {:cpu_limit ""
:cpu_request ""
:memory_limit ""
:memory_request ""}
:schedule {:timeUnit ""
:units 0}
:scheduleData {:basicSchedule {:timeUnit ""
:units 0}
:cron {:cronExpression ""
:cronTimeZone ""}}
:scheduleType ""
:sourceCatalogId ""
:sourceId ""
:status ""
:syncCatalog {:streams [{:config {:aliasName ""
:cursorField []
:destinationSyncMode ""
:fieldSelectionEnabled false
:primaryKey []
:selected false
:selectedFields [{:fieldPath []}]
:suggested false
:syncMode ""}
:stream {:defaultCursorField []
:jsonSchema {}
:name ""
:namespace ""
:sourceDefinedCursor false
:sourceDefinedPrimaryKey []
:supportedSyncModes []}}]}}})
require "http/client"
url = "{{baseUrl}}/v1/web_backend/connections/create"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"operationIds\": [],\n \"operations\": [\n {\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/web_backend/connections/create"),
Content = new StringContent("{\n \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"operationIds\": [],\n \"operations\": [\n {\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/web_backend/connections/create");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"operationIds\": [],\n \"operations\": [\n {\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/web_backend/connections/create"
payload := strings.NewReader("{\n \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"operationIds\": [],\n \"operations\": [\n {\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/web_backend/connections/create HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1913
{
"destinationId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"operationIds": [],
"operations": [
{
"name": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
},
"workspaceId": ""
}
],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"sourceCatalogId": "",
"sourceId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/web_backend/connections/create")
.setHeader("content-type", "application/json")
.setBody("{\n \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"operationIds\": [],\n \"operations\": [\n {\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/web_backend/connections/create"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"operationIds\": [],\n \"operations\": [\n {\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"operationIds\": [],\n \"operations\": [\n {\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/web_backend/connections/create")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/web_backend/connections/create")
.header("content-type", "application/json")
.body("{\n \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"operationIds\": [],\n \"operations\": [\n {\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}")
.asString();
const data = JSON.stringify({
destinationId: '',
geography: '',
name: '',
namespaceDefinition: '',
namespaceFormat: '',
nonBreakingChangesPreference: '',
operationIds: [],
operations: [
{
name: '',
operatorConfiguration: {
dbt: {
dbtArguments: '',
dockerImage: '',
gitRepoBranch: '',
gitRepoUrl: ''
},
normalization: {
option: ''
},
operatorType: '',
webhook: {
dbtCloud: {
accountId: 0,
jobId: 0
},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
},
workspaceId: ''
}
],
prefix: '',
resourceRequirements: {
cpu_limit: '',
cpu_request: '',
memory_limit: '',
memory_request: ''
},
schedule: {
timeUnit: '',
units: 0
},
scheduleData: {
basicSchedule: {
timeUnit: '',
units: 0
},
cron: {
cronExpression: '',
cronTimeZone: ''
}
},
scheduleType: '',
sourceCatalogId: '',
sourceId: '',
status: '',
syncCatalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [
{
fieldPath: []
}
],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/web_backend/connections/create');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/web_backend/connections/create',
headers: {'content-type': 'application/json'},
data: {
destinationId: '',
geography: '',
name: '',
namespaceDefinition: '',
namespaceFormat: '',
nonBreakingChangesPreference: '',
operationIds: [],
operations: [
{
name: '',
operatorConfiguration: {
dbt: {dbtArguments: '', dockerImage: '', gitRepoBranch: '', gitRepoUrl: ''},
normalization: {option: ''},
operatorType: '',
webhook: {
dbtCloud: {accountId: 0, jobId: 0},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
},
workspaceId: ''
}
],
prefix: '',
resourceRequirements: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
schedule: {timeUnit: '', units: 0},
scheduleData: {
basicSchedule: {timeUnit: '', units: 0},
cron: {cronExpression: '', cronTimeZone: ''}
},
scheduleType: '',
sourceCatalogId: '',
sourceId: '',
status: '',
syncCatalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [{fieldPath: []}],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/web_backend/connections/create';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationId":"","geography":"","name":"","namespaceDefinition":"","namespaceFormat":"","nonBreakingChangesPreference":"","operationIds":[],"operations":[{"name":"","operatorConfiguration":{"dbt":{"dbtArguments":"","dockerImage":"","gitRepoBranch":"","gitRepoUrl":""},"normalization":{"option":""},"operatorType":"","webhook":{"dbtCloud":{"accountId":0,"jobId":0},"executionBody":"","executionUrl":"","webhookConfigId":"","webhookType":""}},"workspaceId":""}],"prefix":"","resourceRequirements":{"cpu_limit":"","cpu_request":"","memory_limit":"","memory_request":""},"schedule":{"timeUnit":"","units":0},"scheduleData":{"basicSchedule":{"timeUnit":"","units":0},"cron":{"cronExpression":"","cronTimeZone":""}},"scheduleType":"","sourceCatalogId":"","sourceId":"","status":"","syncCatalog":{"streams":[{"config":{"aliasName":"","cursorField":[],"destinationSyncMode":"","fieldSelectionEnabled":false,"primaryKey":[],"selected":false,"selectedFields":[{"fieldPath":[]}],"suggested":false,"syncMode":""},"stream":{"defaultCursorField":[],"jsonSchema":{},"name":"","namespace":"","sourceDefinedCursor":false,"sourceDefinedPrimaryKey":[],"supportedSyncModes":[]}}]}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/web_backend/connections/create',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "destinationId": "",\n "geography": "",\n "name": "",\n "namespaceDefinition": "",\n "namespaceFormat": "",\n "nonBreakingChangesPreference": "",\n "operationIds": [],\n "operations": [\n {\n "name": "",\n "operatorConfiguration": {\n "dbt": {\n "dbtArguments": "",\n "dockerImage": "",\n "gitRepoBranch": "",\n "gitRepoUrl": ""\n },\n "normalization": {\n "option": ""\n },\n "operatorType": "",\n "webhook": {\n "dbtCloud": {\n "accountId": 0,\n "jobId": 0\n },\n "executionBody": "",\n "executionUrl": "",\n "webhookConfigId": "",\n "webhookType": ""\n }\n },\n "workspaceId": ""\n }\n ],\n "prefix": "",\n "resourceRequirements": {\n "cpu_limit": "",\n "cpu_request": "",\n "memory_limit": "",\n "memory_request": ""\n },\n "schedule": {\n "timeUnit": "",\n "units": 0\n },\n "scheduleData": {\n "basicSchedule": {\n "timeUnit": "",\n "units": 0\n },\n "cron": {\n "cronExpression": "",\n "cronTimeZone": ""\n }\n },\n "scheduleType": "",\n "sourceCatalogId": "",\n "sourceId": "",\n "status": "",\n "syncCatalog": {\n "streams": [\n {\n "config": {\n "aliasName": "",\n "cursorField": [],\n "destinationSyncMode": "",\n "fieldSelectionEnabled": false,\n "primaryKey": [],\n "selected": false,\n "selectedFields": [\n {\n "fieldPath": []\n }\n ],\n "suggested": false,\n "syncMode": ""\n },\n "stream": {\n "defaultCursorField": [],\n "jsonSchema": {},\n "name": "",\n "namespace": "",\n "sourceDefinedCursor": false,\n "sourceDefinedPrimaryKey": [],\n "supportedSyncModes": []\n }\n }\n ]\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"operationIds\": [],\n \"operations\": [\n {\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/web_backend/connections/create")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/web_backend/connections/create',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
destinationId: '',
geography: '',
name: '',
namespaceDefinition: '',
namespaceFormat: '',
nonBreakingChangesPreference: '',
operationIds: [],
operations: [
{
name: '',
operatorConfiguration: {
dbt: {dbtArguments: '', dockerImage: '', gitRepoBranch: '', gitRepoUrl: ''},
normalization: {option: ''},
operatorType: '',
webhook: {
dbtCloud: {accountId: 0, jobId: 0},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
},
workspaceId: ''
}
],
prefix: '',
resourceRequirements: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
schedule: {timeUnit: '', units: 0},
scheduleData: {
basicSchedule: {timeUnit: '', units: 0},
cron: {cronExpression: '', cronTimeZone: ''}
},
scheduleType: '',
sourceCatalogId: '',
sourceId: '',
status: '',
syncCatalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [{fieldPath: []}],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/web_backend/connections/create',
headers: {'content-type': 'application/json'},
body: {
destinationId: '',
geography: '',
name: '',
namespaceDefinition: '',
namespaceFormat: '',
nonBreakingChangesPreference: '',
operationIds: [],
operations: [
{
name: '',
operatorConfiguration: {
dbt: {dbtArguments: '', dockerImage: '', gitRepoBranch: '', gitRepoUrl: ''},
normalization: {option: ''},
operatorType: '',
webhook: {
dbtCloud: {accountId: 0, jobId: 0},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
},
workspaceId: ''
}
],
prefix: '',
resourceRequirements: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
schedule: {timeUnit: '', units: 0},
scheduleData: {
basicSchedule: {timeUnit: '', units: 0},
cron: {cronExpression: '', cronTimeZone: ''}
},
scheduleType: '',
sourceCatalogId: '',
sourceId: '',
status: '',
syncCatalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [{fieldPath: []}],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/web_backend/connections/create');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
destinationId: '',
geography: '',
name: '',
namespaceDefinition: '',
namespaceFormat: '',
nonBreakingChangesPreference: '',
operationIds: [],
operations: [
{
name: '',
operatorConfiguration: {
dbt: {
dbtArguments: '',
dockerImage: '',
gitRepoBranch: '',
gitRepoUrl: ''
},
normalization: {
option: ''
},
operatorType: '',
webhook: {
dbtCloud: {
accountId: 0,
jobId: 0
},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
},
workspaceId: ''
}
],
prefix: '',
resourceRequirements: {
cpu_limit: '',
cpu_request: '',
memory_limit: '',
memory_request: ''
},
schedule: {
timeUnit: '',
units: 0
},
scheduleData: {
basicSchedule: {
timeUnit: '',
units: 0
},
cron: {
cronExpression: '',
cronTimeZone: ''
}
},
scheduleType: '',
sourceCatalogId: '',
sourceId: '',
status: '',
syncCatalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [
{
fieldPath: []
}
],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/web_backend/connections/create',
headers: {'content-type': 'application/json'},
data: {
destinationId: '',
geography: '',
name: '',
namespaceDefinition: '',
namespaceFormat: '',
nonBreakingChangesPreference: '',
operationIds: [],
operations: [
{
name: '',
operatorConfiguration: {
dbt: {dbtArguments: '', dockerImage: '', gitRepoBranch: '', gitRepoUrl: ''},
normalization: {option: ''},
operatorType: '',
webhook: {
dbtCloud: {accountId: 0, jobId: 0},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
},
workspaceId: ''
}
],
prefix: '',
resourceRequirements: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
schedule: {timeUnit: '', units: 0},
scheduleData: {
basicSchedule: {timeUnit: '', units: 0},
cron: {cronExpression: '', cronTimeZone: ''}
},
scheduleType: '',
sourceCatalogId: '',
sourceId: '',
status: '',
syncCatalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [{fieldPath: []}],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/web_backend/connections/create';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationId":"","geography":"","name":"","namespaceDefinition":"","namespaceFormat":"","nonBreakingChangesPreference":"","operationIds":[],"operations":[{"name":"","operatorConfiguration":{"dbt":{"dbtArguments":"","dockerImage":"","gitRepoBranch":"","gitRepoUrl":""},"normalization":{"option":""},"operatorType":"","webhook":{"dbtCloud":{"accountId":0,"jobId":0},"executionBody":"","executionUrl":"","webhookConfigId":"","webhookType":""}},"workspaceId":""}],"prefix":"","resourceRequirements":{"cpu_limit":"","cpu_request":"","memory_limit":"","memory_request":""},"schedule":{"timeUnit":"","units":0},"scheduleData":{"basicSchedule":{"timeUnit":"","units":0},"cron":{"cronExpression":"","cronTimeZone":""}},"scheduleType":"","sourceCatalogId":"","sourceId":"","status":"","syncCatalog":{"streams":[{"config":{"aliasName":"","cursorField":[],"destinationSyncMode":"","fieldSelectionEnabled":false,"primaryKey":[],"selected":false,"selectedFields":[{"fieldPath":[]}],"suggested":false,"syncMode":""},"stream":{"defaultCursorField":[],"jsonSchema":{},"name":"","namespace":"","sourceDefinedCursor":false,"sourceDefinedPrimaryKey":[],"supportedSyncModes":[]}}]}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"destinationId": @"",
@"geography": @"",
@"name": @"",
@"namespaceDefinition": @"",
@"namespaceFormat": @"",
@"nonBreakingChangesPreference": @"",
@"operationIds": @[ ],
@"operations": @[ @{ @"name": @"", @"operatorConfiguration": @{ @"dbt": @{ @"dbtArguments": @"", @"dockerImage": @"", @"gitRepoBranch": @"", @"gitRepoUrl": @"" }, @"normalization": @{ @"option": @"" }, @"operatorType": @"", @"webhook": @{ @"dbtCloud": @{ @"accountId": @0, @"jobId": @0 }, @"executionBody": @"", @"executionUrl": @"", @"webhookConfigId": @"", @"webhookType": @"" } }, @"workspaceId": @"" } ],
@"prefix": @"",
@"resourceRequirements": @{ @"cpu_limit": @"", @"cpu_request": @"", @"memory_limit": @"", @"memory_request": @"" },
@"schedule": @{ @"timeUnit": @"", @"units": @0 },
@"scheduleData": @{ @"basicSchedule": @{ @"timeUnit": @"", @"units": @0 }, @"cron": @{ @"cronExpression": @"", @"cronTimeZone": @"" } },
@"scheduleType": @"",
@"sourceCatalogId": @"",
@"sourceId": @"",
@"status": @"",
@"syncCatalog": @{ @"streams": @[ @{ @"config": @{ @"aliasName": @"", @"cursorField": @[ ], @"destinationSyncMode": @"", @"fieldSelectionEnabled": @NO, @"primaryKey": @[ ], @"selected": @NO, @"selectedFields": @[ @{ @"fieldPath": @[ ] } ], @"suggested": @NO, @"syncMode": @"" }, @"stream": @{ @"defaultCursorField": @[ ], @"jsonSchema": @{ }, @"name": @"", @"namespace": @"", @"sourceDefinedCursor": @NO, @"sourceDefinedPrimaryKey": @[ ], @"supportedSyncModes": @[ ] } } ] } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/web_backend/connections/create"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/web_backend/connections/create" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"operationIds\": [],\n \"operations\": [\n {\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/web_backend/connections/create",
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([
'destinationId' => '',
'geography' => '',
'name' => '',
'namespaceDefinition' => '',
'namespaceFormat' => '',
'nonBreakingChangesPreference' => '',
'operationIds' => [
],
'operations' => [
[
'name' => '',
'operatorConfiguration' => [
'dbt' => [
'dbtArguments' => '',
'dockerImage' => '',
'gitRepoBranch' => '',
'gitRepoUrl' => ''
],
'normalization' => [
'option' => ''
],
'operatorType' => '',
'webhook' => [
'dbtCloud' => [
'accountId' => 0,
'jobId' => 0
],
'executionBody' => '',
'executionUrl' => '',
'webhookConfigId' => '',
'webhookType' => ''
]
],
'workspaceId' => ''
]
],
'prefix' => '',
'resourceRequirements' => [
'cpu_limit' => '',
'cpu_request' => '',
'memory_limit' => '',
'memory_request' => ''
],
'schedule' => [
'timeUnit' => '',
'units' => 0
],
'scheduleData' => [
'basicSchedule' => [
'timeUnit' => '',
'units' => 0
],
'cron' => [
'cronExpression' => '',
'cronTimeZone' => ''
]
],
'scheduleType' => '',
'sourceCatalogId' => '',
'sourceId' => '',
'status' => '',
'syncCatalog' => [
'streams' => [
[
'config' => [
'aliasName' => '',
'cursorField' => [
],
'destinationSyncMode' => '',
'fieldSelectionEnabled' => null,
'primaryKey' => [
],
'selected' => null,
'selectedFields' => [
[
'fieldPath' => [
]
]
],
'suggested' => null,
'syncMode' => ''
],
'stream' => [
'defaultCursorField' => [
],
'jsonSchema' => [
],
'name' => '',
'namespace' => '',
'sourceDefinedCursor' => null,
'sourceDefinedPrimaryKey' => [
],
'supportedSyncModes' => [
]
]
]
]
]
]),
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;
}
request('POST', '{{baseUrl}}/v1/web_backend/connections/create', [
'body' => '{
"destinationId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"operationIds": [],
"operations": [
{
"name": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
},
"workspaceId": ""
}
],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"sourceCatalogId": "",
"sourceId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/web_backend/connections/create');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'destinationId' => '',
'geography' => '',
'name' => '',
'namespaceDefinition' => '',
'namespaceFormat' => '',
'nonBreakingChangesPreference' => '',
'operationIds' => [
],
'operations' => [
[
'name' => '',
'operatorConfiguration' => [
'dbt' => [
'dbtArguments' => '',
'dockerImage' => '',
'gitRepoBranch' => '',
'gitRepoUrl' => ''
],
'normalization' => [
'option' => ''
],
'operatorType' => '',
'webhook' => [
'dbtCloud' => [
'accountId' => 0,
'jobId' => 0
],
'executionBody' => '',
'executionUrl' => '',
'webhookConfigId' => '',
'webhookType' => ''
]
],
'workspaceId' => ''
]
],
'prefix' => '',
'resourceRequirements' => [
'cpu_limit' => '',
'cpu_request' => '',
'memory_limit' => '',
'memory_request' => ''
],
'schedule' => [
'timeUnit' => '',
'units' => 0
],
'scheduleData' => [
'basicSchedule' => [
'timeUnit' => '',
'units' => 0
],
'cron' => [
'cronExpression' => '',
'cronTimeZone' => ''
]
],
'scheduleType' => '',
'sourceCatalogId' => '',
'sourceId' => '',
'status' => '',
'syncCatalog' => [
'streams' => [
[
'config' => [
'aliasName' => '',
'cursorField' => [
],
'destinationSyncMode' => '',
'fieldSelectionEnabled' => null,
'primaryKey' => [
],
'selected' => null,
'selectedFields' => [
[
'fieldPath' => [
]
]
],
'suggested' => null,
'syncMode' => ''
],
'stream' => [
'defaultCursorField' => [
],
'jsonSchema' => [
],
'name' => '',
'namespace' => '',
'sourceDefinedCursor' => null,
'sourceDefinedPrimaryKey' => [
],
'supportedSyncModes' => [
]
]
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'destinationId' => '',
'geography' => '',
'name' => '',
'namespaceDefinition' => '',
'namespaceFormat' => '',
'nonBreakingChangesPreference' => '',
'operationIds' => [
],
'operations' => [
[
'name' => '',
'operatorConfiguration' => [
'dbt' => [
'dbtArguments' => '',
'dockerImage' => '',
'gitRepoBranch' => '',
'gitRepoUrl' => ''
],
'normalization' => [
'option' => ''
],
'operatorType' => '',
'webhook' => [
'dbtCloud' => [
'accountId' => 0,
'jobId' => 0
],
'executionBody' => '',
'executionUrl' => '',
'webhookConfigId' => '',
'webhookType' => ''
]
],
'workspaceId' => ''
]
],
'prefix' => '',
'resourceRequirements' => [
'cpu_limit' => '',
'cpu_request' => '',
'memory_limit' => '',
'memory_request' => ''
],
'schedule' => [
'timeUnit' => '',
'units' => 0
],
'scheduleData' => [
'basicSchedule' => [
'timeUnit' => '',
'units' => 0
],
'cron' => [
'cronExpression' => '',
'cronTimeZone' => ''
]
],
'scheduleType' => '',
'sourceCatalogId' => '',
'sourceId' => '',
'status' => '',
'syncCatalog' => [
'streams' => [
[
'config' => [
'aliasName' => '',
'cursorField' => [
],
'destinationSyncMode' => '',
'fieldSelectionEnabled' => null,
'primaryKey' => [
],
'selected' => null,
'selectedFields' => [
[
'fieldPath' => [
]
]
],
'suggested' => null,
'syncMode' => ''
],
'stream' => [
'defaultCursorField' => [
],
'jsonSchema' => [
],
'name' => '',
'namespace' => '',
'sourceDefinedCursor' => null,
'sourceDefinedPrimaryKey' => [
],
'supportedSyncModes' => [
]
]
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/web_backend/connections/create');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/web_backend/connections/create' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"operationIds": [],
"operations": [
{
"name": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
},
"workspaceId": ""
}
],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"sourceCatalogId": "",
"sourceId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/web_backend/connections/create' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"operationIds": [],
"operations": [
{
"name": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
},
"workspaceId": ""
}
],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"sourceCatalogId": "",
"sourceId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"operationIds\": [],\n \"operations\": [\n {\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/web_backend/connections/create", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/web_backend/connections/create"
payload = {
"destinationId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"operationIds": [],
"operations": [
{
"name": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": { "option": "" },
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
},
"workspaceId": ""
}
],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"sourceCatalogId": "",
"sourceId": "",
"status": "",
"syncCatalog": { "streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": False,
"primaryKey": [],
"selected": False,
"selectedFields": [{ "fieldPath": [] }],
"suggested": False,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": False,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
] }
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/web_backend/connections/create"
payload <- "{\n \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"operationIds\": [],\n \"operations\": [\n {\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/web_backend/connections/create")
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 \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"operationIds\": [],\n \"operations\": [\n {\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/web_backend/connections/create') do |req|
req.body = "{\n \"destinationId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"operationIds\": [],\n \"operations\": [\n {\n \"name\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"sourceCatalogId\": \"\",\n \"sourceId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/web_backend/connections/create";
let payload = json!({
"destinationId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"operationIds": (),
"operations": (
json!({
"name": "",
"operatorConfiguration": json!({
"dbt": json!({
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
}),
"normalization": json!({"option": ""}),
"operatorType": "",
"webhook": json!({
"dbtCloud": json!({
"accountId": 0,
"jobId": 0
}),
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
})
}),
"workspaceId": ""
})
),
"prefix": "",
"resourceRequirements": json!({
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
}),
"schedule": json!({
"timeUnit": "",
"units": 0
}),
"scheduleData": json!({
"basicSchedule": json!({
"timeUnit": "",
"units": 0
}),
"cron": json!({
"cronExpression": "",
"cronTimeZone": ""
})
}),
"scheduleType": "",
"sourceCatalogId": "",
"sourceId": "",
"status": "",
"syncCatalog": json!({"streams": (
json!({
"config": json!({
"aliasName": "",
"cursorField": (),
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": (),
"selected": false,
"selectedFields": (json!({"fieldPath": ()})),
"suggested": false,
"syncMode": ""
}),
"stream": json!({
"defaultCursorField": (),
"jsonSchema": json!({}),
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": (),
"supportedSyncModes": ()
})
})
)})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/web_backend/connections/create \
--header 'content-type: application/json' \
--data '{
"destinationId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"operationIds": [],
"operations": [
{
"name": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
},
"workspaceId": ""
}
],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"sourceCatalogId": "",
"sourceId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}'
echo '{
"destinationId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"operationIds": [],
"operations": [
{
"name": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
},
"workspaceId": ""
}
],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"sourceCatalogId": "",
"sourceId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}' | \
http POST {{baseUrl}}/v1/web_backend/connections/create \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "destinationId": "",\n "geography": "",\n "name": "",\n "namespaceDefinition": "",\n "namespaceFormat": "",\n "nonBreakingChangesPreference": "",\n "operationIds": [],\n "operations": [\n {\n "name": "",\n "operatorConfiguration": {\n "dbt": {\n "dbtArguments": "",\n "dockerImage": "",\n "gitRepoBranch": "",\n "gitRepoUrl": ""\n },\n "normalization": {\n "option": ""\n },\n "operatorType": "",\n "webhook": {\n "dbtCloud": {\n "accountId": 0,\n "jobId": 0\n },\n "executionBody": "",\n "executionUrl": "",\n "webhookConfigId": "",\n "webhookType": ""\n }\n },\n "workspaceId": ""\n }\n ],\n "prefix": "",\n "resourceRequirements": {\n "cpu_limit": "",\n "cpu_request": "",\n "memory_limit": "",\n "memory_request": ""\n },\n "schedule": {\n "timeUnit": "",\n "units": 0\n },\n "scheduleData": {\n "basicSchedule": {\n "timeUnit": "",\n "units": 0\n },\n "cron": {\n "cronExpression": "",\n "cronTimeZone": ""\n }\n },\n "scheduleType": "",\n "sourceCatalogId": "",\n "sourceId": "",\n "status": "",\n "syncCatalog": {\n "streams": [\n {\n "config": {\n "aliasName": "",\n "cursorField": [],\n "destinationSyncMode": "",\n "fieldSelectionEnabled": false,\n "primaryKey": [],\n "selected": false,\n "selectedFields": [\n {\n "fieldPath": []\n }\n ],\n "suggested": false,\n "syncMode": ""\n },\n "stream": {\n "defaultCursorField": [],\n "jsonSchema": {},\n "name": "",\n "namespace": "",\n "sourceDefinedCursor": false,\n "sourceDefinedPrimaryKey": [],\n "supportedSyncModes": []\n }\n }\n ]\n }\n}' \
--output-document \
- {{baseUrl}}/v1/web_backend/connections/create
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"destinationId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"operationIds": [],
"operations": [
[
"name": "",
"operatorConfiguration": [
"dbt": [
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
],
"normalization": ["option": ""],
"operatorType": "",
"webhook": [
"dbtCloud": [
"accountId": 0,
"jobId": 0
],
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
]
],
"workspaceId": ""
]
],
"prefix": "",
"resourceRequirements": [
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
],
"schedule": [
"timeUnit": "",
"units": 0
],
"scheduleData": [
"basicSchedule": [
"timeUnit": "",
"units": 0
],
"cron": [
"cronExpression": "",
"cronTimeZone": ""
]
],
"scheduleType": "",
"sourceCatalogId": "",
"sourceId": "",
"status": "",
"syncCatalog": ["streams": [
[
"config": [
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [["fieldPath": []]],
"suggested": false,
"syncMode": ""
],
"stream": [
"defaultCursorField": [],
"jsonSchema": [],
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
]
]
]]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/web_backend/connections/create")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"destination": {
"connectionConfiguration": {
"user": "charles"
}
},
"namespaceFormat": "${SOURCE_NAMESPACE}",
"source": {
"connectionConfiguration": {
"user": "charles"
}
}
}
POST
Fetch the current state type for a connection.
{{baseUrl}}/v1/web_backend/state/get_type
BODY json
{
"connectionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/web_backend/state/get_type");
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 \"connectionId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/web_backend/state/get_type" {:content-type :json
:form-params {:connectionId ""}})
require "http/client"
url = "{{baseUrl}}/v1/web_backend/state/get_type"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"connectionId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/web_backend/state/get_type"),
Content = new StringContent("{\n \"connectionId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/web_backend/state/get_type");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"connectionId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/web_backend/state/get_type"
payload := strings.NewReader("{\n \"connectionId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/web_backend/state/get_type HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 24
{
"connectionId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/web_backend/state/get_type")
.setHeader("content-type", "application/json")
.setBody("{\n \"connectionId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/web_backend/state/get_type"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"connectionId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"connectionId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/web_backend/state/get_type")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/web_backend/state/get_type")
.header("content-type", "application/json")
.body("{\n \"connectionId\": \"\"\n}")
.asString();
const data = JSON.stringify({
connectionId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/web_backend/state/get_type');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/web_backend/state/get_type',
headers: {'content-type': 'application/json'},
data: {connectionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/web_backend/state/get_type';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/web_backend/state/get_type',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "connectionId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"connectionId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/web_backend/state/get_type")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/web_backend/state/get_type',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({connectionId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/web_backend/state/get_type',
headers: {'content-type': 'application/json'},
body: {connectionId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/web_backend/state/get_type');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
connectionId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/web_backend/state/get_type',
headers: {'content-type': 'application/json'},
data: {connectionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/web_backend/state/get_type';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"connectionId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/web_backend/state/get_type"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/web_backend/state/get_type" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"connectionId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/web_backend/state/get_type",
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([
'connectionId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/web_backend/state/get_type', [
'body' => '{
"connectionId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/web_backend/state/get_type');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'connectionId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'connectionId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/web_backend/state/get_type');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/web_backend/state/get_type' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/web_backend/state/get_type' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"connectionId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/web_backend/state/get_type", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/web_backend/state/get_type"
payload = { "connectionId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/web_backend/state/get_type"
payload <- "{\n \"connectionId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/web_backend/state/get_type")
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 \"connectionId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/web_backend/state/get_type') do |req|
req.body = "{\n \"connectionId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/web_backend/state/get_type";
let payload = json!({"connectionId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/web_backend/state/get_type \
--header 'content-type: application/json' \
--data '{
"connectionId": ""
}'
echo '{
"connectionId": ""
}' | \
http POST {{baseUrl}}/v1/web_backend/state/get_type \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "connectionId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/web_backend/state/get_type
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["connectionId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/web_backend/state/get_type")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Get a connection (POST)
{{baseUrl}}/v1/web_backend/connections/get
BODY json
{
"connectionId": "",
"withRefreshedCatalog": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/web_backend/connections/get");
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 \"connectionId\": \"\",\n \"withRefreshedCatalog\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/web_backend/connections/get" {:content-type :json
:form-params {:connectionId ""
:withRefreshedCatalog false}})
require "http/client"
url = "{{baseUrl}}/v1/web_backend/connections/get"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"connectionId\": \"\",\n \"withRefreshedCatalog\": false\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/web_backend/connections/get"),
Content = new StringContent("{\n \"connectionId\": \"\",\n \"withRefreshedCatalog\": false\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/web_backend/connections/get");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"connectionId\": \"\",\n \"withRefreshedCatalog\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/web_backend/connections/get"
payload := strings.NewReader("{\n \"connectionId\": \"\",\n \"withRefreshedCatalog\": false\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/web_backend/connections/get HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"connectionId": "",
"withRefreshedCatalog": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/web_backend/connections/get")
.setHeader("content-type", "application/json")
.setBody("{\n \"connectionId\": \"\",\n \"withRefreshedCatalog\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/web_backend/connections/get"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"connectionId\": \"\",\n \"withRefreshedCatalog\": false\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"connectionId\": \"\",\n \"withRefreshedCatalog\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/web_backend/connections/get")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/web_backend/connections/get")
.header("content-type", "application/json")
.body("{\n \"connectionId\": \"\",\n \"withRefreshedCatalog\": false\n}")
.asString();
const data = JSON.stringify({
connectionId: '',
withRefreshedCatalog: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/web_backend/connections/get');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/web_backend/connections/get',
headers: {'content-type': 'application/json'},
data: {connectionId: '', withRefreshedCatalog: false}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/web_backend/connections/get';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionId":"","withRefreshedCatalog":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/web_backend/connections/get',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "connectionId": "",\n "withRefreshedCatalog": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"connectionId\": \"\",\n \"withRefreshedCatalog\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/web_backend/connections/get")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/web_backend/connections/get',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({connectionId: '', withRefreshedCatalog: false}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/web_backend/connections/get',
headers: {'content-type': 'application/json'},
body: {connectionId: '', withRefreshedCatalog: false},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/web_backend/connections/get');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
connectionId: '',
withRefreshedCatalog: false
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/web_backend/connections/get',
headers: {'content-type': 'application/json'},
data: {connectionId: '', withRefreshedCatalog: false}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/web_backend/connections/get';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionId":"","withRefreshedCatalog":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"connectionId": @"",
@"withRefreshedCatalog": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/web_backend/connections/get"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/web_backend/connections/get" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"connectionId\": \"\",\n \"withRefreshedCatalog\": false\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/web_backend/connections/get",
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([
'connectionId' => '',
'withRefreshedCatalog' => null
]),
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;
}
request('POST', '{{baseUrl}}/v1/web_backend/connections/get', [
'body' => '{
"connectionId": "",
"withRefreshedCatalog": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/web_backend/connections/get');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'connectionId' => '',
'withRefreshedCatalog' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'connectionId' => '',
'withRefreshedCatalog' => null
]));
$request->setRequestUrl('{{baseUrl}}/v1/web_backend/connections/get');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/web_backend/connections/get' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionId": "",
"withRefreshedCatalog": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/web_backend/connections/get' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionId": "",
"withRefreshedCatalog": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"connectionId\": \"\",\n \"withRefreshedCatalog\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/web_backend/connections/get", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/web_backend/connections/get"
payload = {
"connectionId": "",
"withRefreshedCatalog": False
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/web_backend/connections/get"
payload <- "{\n \"connectionId\": \"\",\n \"withRefreshedCatalog\": false\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/web_backend/connections/get")
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 \"connectionId\": \"\",\n \"withRefreshedCatalog\": false\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/web_backend/connections/get') do |req|
req.body = "{\n \"connectionId\": \"\",\n \"withRefreshedCatalog\": false\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/web_backend/connections/get";
let payload = json!({
"connectionId": "",
"withRefreshedCatalog": false
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/web_backend/connections/get \
--header 'content-type: application/json' \
--data '{
"connectionId": "",
"withRefreshedCatalog": false
}'
echo '{
"connectionId": "",
"withRefreshedCatalog": false
}' | \
http POST {{baseUrl}}/v1/web_backend/connections/get \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "connectionId": "",\n "withRefreshedCatalog": false\n}' \
--output-document \
- {{baseUrl}}/v1/web_backend/connections/get
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"connectionId": "",
"withRefreshedCatalog": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/web_backend/connections/get")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"destination": {
"connectionConfiguration": {
"user": "charles"
}
},
"namespaceFormat": "${SOURCE_NAMESPACE}",
"source": {
"connectionConfiguration": {
"user": "charles"
}
}
}
POST
Returns a summary of source and destination definitions that could be updated.
{{baseUrl}}/v1/web_backend/check_updates
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/web_backend/check_updates");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/web_backend/check_updates")
require "http/client"
url = "{{baseUrl}}/v1/web_backend/check_updates"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/web_backend/check_updates"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/web_backend/check_updates");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/web_backend/check_updates"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/web_backend/check_updates HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/web_backend/check_updates")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/web_backend/check_updates"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/web_backend/check_updates")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/web_backend/check_updates")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/web_backend/check_updates');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/web_backend/check_updates'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/web_backend/check_updates';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/web_backend/check_updates',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/web_backend/check_updates")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/web_backend/check_updates',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/web_backend/check_updates'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/web_backend/check_updates');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/web_backend/check_updates'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/web_backend/check_updates';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/web_backend/check_updates"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/web_backend/check_updates" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/web_backend/check_updates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/web_backend/check_updates');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/web_backend/check_updates');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/web_backend/check_updates');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/web_backend/check_updates' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/web_backend/check_updates' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/v1/web_backend/check_updates")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/web_backend/check_updates"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/web_backend/check_updates"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/web_backend/check_updates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/v1/web_backend/check_updates') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/web_backend/check_updates";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/web_backend/check_updates
http POST {{baseUrl}}/v1/web_backend/check_updates
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/v1/web_backend/check_updates
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/web_backend/check_updates")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Returns all non-deleted connections for a workspace.
{{baseUrl}}/v1/web_backend/connections/list
BODY json
{
"destinationId": [],
"sourceId": [],
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/web_backend/connections/list");
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 \"destinationId\": [],\n \"sourceId\": [],\n \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/web_backend/connections/list" {:content-type :json
:form-params {:destinationId []
:sourceId []
:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/web_backend/connections/list"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"destinationId\": [],\n \"sourceId\": [],\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/web_backend/connections/list"),
Content = new StringContent("{\n \"destinationId\": [],\n \"sourceId\": [],\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/web_backend/connections/list");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"destinationId\": [],\n \"sourceId\": [],\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/web_backend/connections/list"
payload := strings.NewReader("{\n \"destinationId\": [],\n \"sourceId\": [],\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/web_backend/connections/list HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 64
{
"destinationId": [],
"sourceId": [],
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/web_backend/connections/list")
.setHeader("content-type", "application/json")
.setBody("{\n \"destinationId\": [],\n \"sourceId\": [],\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/web_backend/connections/list"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"destinationId\": [],\n \"sourceId\": [],\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"destinationId\": [],\n \"sourceId\": [],\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/web_backend/connections/list")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/web_backend/connections/list")
.header("content-type", "application/json")
.body("{\n \"destinationId\": [],\n \"sourceId\": [],\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
destinationId: [],
sourceId: [],
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/web_backend/connections/list');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/web_backend/connections/list',
headers: {'content-type': 'application/json'},
data: {destinationId: [], sourceId: [], workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/web_backend/connections/list';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationId":[],"sourceId":[],"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/web_backend/connections/list',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "destinationId": [],\n "sourceId": [],\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"destinationId\": [],\n \"sourceId\": [],\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/web_backend/connections/list")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/web_backend/connections/list',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({destinationId: [], sourceId: [], workspaceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/web_backend/connections/list',
headers: {'content-type': 'application/json'},
body: {destinationId: [], sourceId: [], workspaceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/web_backend/connections/list');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
destinationId: [],
sourceId: [],
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/web_backend/connections/list',
headers: {'content-type': 'application/json'},
data: {destinationId: [], sourceId: [], workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/web_backend/connections/list';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationId":[],"sourceId":[],"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"destinationId": @[ ],
@"sourceId": @[ ],
@"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/web_backend/connections/list"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/web_backend/connections/list" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"destinationId\": [],\n \"sourceId\": [],\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/web_backend/connections/list",
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([
'destinationId' => [
],
'sourceId' => [
],
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/web_backend/connections/list', [
'body' => '{
"destinationId": [],
"sourceId": [],
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/web_backend/connections/list');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'destinationId' => [
],
'sourceId' => [
],
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'destinationId' => [
],
'sourceId' => [
],
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/web_backend/connections/list');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/web_backend/connections/list' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationId": [],
"sourceId": [],
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/web_backend/connections/list' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationId": [],
"sourceId": [],
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"destinationId\": [],\n \"sourceId\": [],\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/web_backend/connections/list", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/web_backend/connections/list"
payload = {
"destinationId": [],
"sourceId": [],
"workspaceId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/web_backend/connections/list"
payload <- "{\n \"destinationId\": [],\n \"sourceId\": [],\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/web_backend/connections/list")
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 \"destinationId\": [],\n \"sourceId\": [],\n \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/web_backend/connections/list') do |req|
req.body = "{\n \"destinationId\": [],\n \"sourceId\": [],\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/web_backend/connections/list";
let payload = json!({
"destinationId": (),
"sourceId": (),
"workspaceId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/web_backend/connections/list \
--header 'content-type: application/json' \
--data '{
"destinationId": [],
"sourceId": [],
"workspaceId": ""
}'
echo '{
"destinationId": [],
"sourceId": [],
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/web_backend/connections/list \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "destinationId": [],\n "sourceId": [],\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/web_backend/connections/list
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"destinationId": [],
"sourceId": [],
"workspaceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/web_backend/connections/list")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Returns the current state of a workspace
{{baseUrl}}/v1/web_backend/workspace/state
BODY json
{
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/web_backend/workspace/state");
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 \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/web_backend/workspace/state" {:content-type :json
:form-params {:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/web_backend/workspace/state"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/web_backend/workspace/state"),
Content = new StringContent("{\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/web_backend/workspace/state");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/web_backend/workspace/state"
payload := strings.NewReader("{\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/web_backend/workspace/state HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/web_backend/workspace/state")
.setHeader("content-type", "application/json")
.setBody("{\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/web_backend/workspace/state"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/web_backend/workspace/state")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/web_backend/workspace/state")
.header("content-type", "application/json")
.body("{\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/web_backend/workspace/state');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/web_backend/workspace/state',
headers: {'content-type': 'application/json'},
data: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/web_backend/workspace/state';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/web_backend/workspace/state',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/web_backend/workspace/state")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/web_backend/workspace/state',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({workspaceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/web_backend/workspace/state',
headers: {'content-type': 'application/json'},
body: {workspaceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/web_backend/workspace/state');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/web_backend/workspace/state',
headers: {'content-type': 'application/json'},
data: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/web_backend/workspace/state';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/web_backend/workspace/state"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/web_backend/workspace/state" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/web_backend/workspace/state",
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([
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/web_backend/workspace/state', [
'body' => '{
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/web_backend/workspace/state');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/web_backend/workspace/state');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/web_backend/workspace/state' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/web_backend/workspace/state' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/web_backend/workspace/state", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/web_backend/workspace/state"
payload = { "workspaceId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/web_backend/workspace/state"
payload <- "{\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/web_backend/workspace/state")
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 \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/web_backend/workspace/state') do |req|
req.body = "{\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/web_backend/workspace/state";
let payload = json!({"workspaceId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/web_backend/workspace/state \
--header 'content-type: application/json' \
--data '{
"workspaceId": ""
}'
echo '{
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/web_backend/workspace/state \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/web_backend/workspace/state
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["workspaceId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/web_backend/workspace/state")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Update a connection (POST)
{{baseUrl}}/v1/web_backend/connections/update
BODY json
{
"connectionId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operations": [
{
"name": "",
"operationId": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
},
"workspaceId": ""
}
],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"skipReset": false,
"sourceCatalogId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/web_backend/connections/update");
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 \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operations\": [\n {\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"skipReset\": false,\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/web_backend/connections/update" {:content-type :json
:form-params {:connectionId ""
:geography ""
:name ""
:namespaceDefinition ""
:namespaceFormat ""
:nonBreakingChangesPreference ""
:notifySchemaChanges false
:operations [{:name ""
:operationId ""
:operatorConfiguration {:dbt {:dbtArguments ""
:dockerImage ""
:gitRepoBranch ""
:gitRepoUrl ""}
:normalization {:option ""}
:operatorType ""
:webhook {:dbtCloud {:accountId 0
:jobId 0}
:executionBody ""
:executionUrl ""
:webhookConfigId ""
:webhookType ""}}
:workspaceId ""}]
:prefix ""
:resourceRequirements {:cpu_limit ""
:cpu_request ""
:memory_limit ""
:memory_request ""}
:schedule {:timeUnit ""
:units 0}
:scheduleData {:basicSchedule {:timeUnit ""
:units 0}
:cron {:cronExpression ""
:cronTimeZone ""}}
:scheduleType ""
:skipReset false
:sourceCatalogId ""
:status ""
:syncCatalog {:streams [{:config {:aliasName ""
:cursorField []
:destinationSyncMode ""
:fieldSelectionEnabled false
:primaryKey []
:selected false
:selectedFields [{:fieldPath []}]
:suggested false
:syncMode ""}
:stream {:defaultCursorField []
:jsonSchema {}
:name ""
:namespace ""
:sourceDefinedCursor false
:sourceDefinedPrimaryKey []
:supportedSyncModes []}}]}}})
require "http/client"
url = "{{baseUrl}}/v1/web_backend/connections/update"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operations\": [\n {\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"skipReset\": false,\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/web_backend/connections/update"),
Content = new StringContent("{\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operations\": [\n {\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"skipReset\": false,\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/web_backend/connections/update");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operations\": [\n {\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"skipReset\": false,\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/web_backend/connections/update"
payload := strings.NewReader("{\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operations\": [\n {\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"skipReset\": false,\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/web_backend/connections/update HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1951
{
"connectionId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operations": [
{
"name": "",
"operationId": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
},
"workspaceId": ""
}
],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"skipReset": false,
"sourceCatalogId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/web_backend/connections/update")
.setHeader("content-type", "application/json")
.setBody("{\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operations\": [\n {\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"skipReset\": false,\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/web_backend/connections/update"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operations\": [\n {\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"skipReset\": false,\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operations\": [\n {\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"skipReset\": false,\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/web_backend/connections/update")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/web_backend/connections/update")
.header("content-type", "application/json")
.body("{\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operations\": [\n {\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"skipReset\": false,\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}")
.asString();
const data = JSON.stringify({
connectionId: '',
geography: '',
name: '',
namespaceDefinition: '',
namespaceFormat: '',
nonBreakingChangesPreference: '',
notifySchemaChanges: false,
operations: [
{
name: '',
operationId: '',
operatorConfiguration: {
dbt: {
dbtArguments: '',
dockerImage: '',
gitRepoBranch: '',
gitRepoUrl: ''
},
normalization: {
option: ''
},
operatorType: '',
webhook: {
dbtCloud: {
accountId: 0,
jobId: 0
},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
},
workspaceId: ''
}
],
prefix: '',
resourceRequirements: {
cpu_limit: '',
cpu_request: '',
memory_limit: '',
memory_request: ''
},
schedule: {
timeUnit: '',
units: 0
},
scheduleData: {
basicSchedule: {
timeUnit: '',
units: 0
},
cron: {
cronExpression: '',
cronTimeZone: ''
}
},
scheduleType: '',
skipReset: false,
sourceCatalogId: '',
status: '',
syncCatalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [
{
fieldPath: []
}
],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/web_backend/connections/update');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/web_backend/connections/update',
headers: {'content-type': 'application/json'},
data: {
connectionId: '',
geography: '',
name: '',
namespaceDefinition: '',
namespaceFormat: '',
nonBreakingChangesPreference: '',
notifySchemaChanges: false,
operations: [
{
name: '',
operationId: '',
operatorConfiguration: {
dbt: {dbtArguments: '', dockerImage: '', gitRepoBranch: '', gitRepoUrl: ''},
normalization: {option: ''},
operatorType: '',
webhook: {
dbtCloud: {accountId: 0, jobId: 0},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
},
workspaceId: ''
}
],
prefix: '',
resourceRequirements: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
schedule: {timeUnit: '', units: 0},
scheduleData: {
basicSchedule: {timeUnit: '', units: 0},
cron: {cronExpression: '', cronTimeZone: ''}
},
scheduleType: '',
skipReset: false,
sourceCatalogId: '',
status: '',
syncCatalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [{fieldPath: []}],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/web_backend/connections/update';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionId":"","geography":"","name":"","namespaceDefinition":"","namespaceFormat":"","nonBreakingChangesPreference":"","notifySchemaChanges":false,"operations":[{"name":"","operationId":"","operatorConfiguration":{"dbt":{"dbtArguments":"","dockerImage":"","gitRepoBranch":"","gitRepoUrl":""},"normalization":{"option":""},"operatorType":"","webhook":{"dbtCloud":{"accountId":0,"jobId":0},"executionBody":"","executionUrl":"","webhookConfigId":"","webhookType":""}},"workspaceId":""}],"prefix":"","resourceRequirements":{"cpu_limit":"","cpu_request":"","memory_limit":"","memory_request":""},"schedule":{"timeUnit":"","units":0},"scheduleData":{"basicSchedule":{"timeUnit":"","units":0},"cron":{"cronExpression":"","cronTimeZone":""}},"scheduleType":"","skipReset":false,"sourceCatalogId":"","status":"","syncCatalog":{"streams":[{"config":{"aliasName":"","cursorField":[],"destinationSyncMode":"","fieldSelectionEnabled":false,"primaryKey":[],"selected":false,"selectedFields":[{"fieldPath":[]}],"suggested":false,"syncMode":""},"stream":{"defaultCursorField":[],"jsonSchema":{},"name":"","namespace":"","sourceDefinedCursor":false,"sourceDefinedPrimaryKey":[],"supportedSyncModes":[]}}]}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/web_backend/connections/update',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "connectionId": "",\n "geography": "",\n "name": "",\n "namespaceDefinition": "",\n "namespaceFormat": "",\n "nonBreakingChangesPreference": "",\n "notifySchemaChanges": false,\n "operations": [\n {\n "name": "",\n "operationId": "",\n "operatorConfiguration": {\n "dbt": {\n "dbtArguments": "",\n "dockerImage": "",\n "gitRepoBranch": "",\n "gitRepoUrl": ""\n },\n "normalization": {\n "option": ""\n },\n "operatorType": "",\n "webhook": {\n "dbtCloud": {\n "accountId": 0,\n "jobId": 0\n },\n "executionBody": "",\n "executionUrl": "",\n "webhookConfigId": "",\n "webhookType": ""\n }\n },\n "workspaceId": ""\n }\n ],\n "prefix": "",\n "resourceRequirements": {\n "cpu_limit": "",\n "cpu_request": "",\n "memory_limit": "",\n "memory_request": ""\n },\n "schedule": {\n "timeUnit": "",\n "units": 0\n },\n "scheduleData": {\n "basicSchedule": {\n "timeUnit": "",\n "units": 0\n },\n "cron": {\n "cronExpression": "",\n "cronTimeZone": ""\n }\n },\n "scheduleType": "",\n "skipReset": false,\n "sourceCatalogId": "",\n "status": "",\n "syncCatalog": {\n "streams": [\n {\n "config": {\n "aliasName": "",\n "cursorField": [],\n "destinationSyncMode": "",\n "fieldSelectionEnabled": false,\n "primaryKey": [],\n "selected": false,\n "selectedFields": [\n {\n "fieldPath": []\n }\n ],\n "suggested": false,\n "syncMode": ""\n },\n "stream": {\n "defaultCursorField": [],\n "jsonSchema": {},\n "name": "",\n "namespace": "",\n "sourceDefinedCursor": false,\n "sourceDefinedPrimaryKey": [],\n "supportedSyncModes": []\n }\n }\n ]\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operations\": [\n {\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"skipReset\": false,\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/web_backend/connections/update")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/web_backend/connections/update',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
connectionId: '',
geography: '',
name: '',
namespaceDefinition: '',
namespaceFormat: '',
nonBreakingChangesPreference: '',
notifySchemaChanges: false,
operations: [
{
name: '',
operationId: '',
operatorConfiguration: {
dbt: {dbtArguments: '', dockerImage: '', gitRepoBranch: '', gitRepoUrl: ''},
normalization: {option: ''},
operatorType: '',
webhook: {
dbtCloud: {accountId: 0, jobId: 0},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
},
workspaceId: ''
}
],
prefix: '',
resourceRequirements: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
schedule: {timeUnit: '', units: 0},
scheduleData: {
basicSchedule: {timeUnit: '', units: 0},
cron: {cronExpression: '', cronTimeZone: ''}
},
scheduleType: '',
skipReset: false,
sourceCatalogId: '',
status: '',
syncCatalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [{fieldPath: []}],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/web_backend/connections/update',
headers: {'content-type': 'application/json'},
body: {
connectionId: '',
geography: '',
name: '',
namespaceDefinition: '',
namespaceFormat: '',
nonBreakingChangesPreference: '',
notifySchemaChanges: false,
operations: [
{
name: '',
operationId: '',
operatorConfiguration: {
dbt: {dbtArguments: '', dockerImage: '', gitRepoBranch: '', gitRepoUrl: ''},
normalization: {option: ''},
operatorType: '',
webhook: {
dbtCloud: {accountId: 0, jobId: 0},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
},
workspaceId: ''
}
],
prefix: '',
resourceRequirements: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
schedule: {timeUnit: '', units: 0},
scheduleData: {
basicSchedule: {timeUnit: '', units: 0},
cron: {cronExpression: '', cronTimeZone: ''}
},
scheduleType: '',
skipReset: false,
sourceCatalogId: '',
status: '',
syncCatalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [{fieldPath: []}],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/web_backend/connections/update');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
connectionId: '',
geography: '',
name: '',
namespaceDefinition: '',
namespaceFormat: '',
nonBreakingChangesPreference: '',
notifySchemaChanges: false,
operations: [
{
name: '',
operationId: '',
operatorConfiguration: {
dbt: {
dbtArguments: '',
dockerImage: '',
gitRepoBranch: '',
gitRepoUrl: ''
},
normalization: {
option: ''
},
operatorType: '',
webhook: {
dbtCloud: {
accountId: 0,
jobId: 0
},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
},
workspaceId: ''
}
],
prefix: '',
resourceRequirements: {
cpu_limit: '',
cpu_request: '',
memory_limit: '',
memory_request: ''
},
schedule: {
timeUnit: '',
units: 0
},
scheduleData: {
basicSchedule: {
timeUnit: '',
units: 0
},
cron: {
cronExpression: '',
cronTimeZone: ''
}
},
scheduleType: '',
skipReset: false,
sourceCatalogId: '',
status: '',
syncCatalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [
{
fieldPath: []
}
],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/web_backend/connections/update',
headers: {'content-type': 'application/json'},
data: {
connectionId: '',
geography: '',
name: '',
namespaceDefinition: '',
namespaceFormat: '',
nonBreakingChangesPreference: '',
notifySchemaChanges: false,
operations: [
{
name: '',
operationId: '',
operatorConfiguration: {
dbt: {dbtArguments: '', dockerImage: '', gitRepoBranch: '', gitRepoUrl: ''},
normalization: {option: ''},
operatorType: '',
webhook: {
dbtCloud: {accountId: 0, jobId: 0},
executionBody: '',
executionUrl: '',
webhookConfigId: '',
webhookType: ''
}
},
workspaceId: ''
}
],
prefix: '',
resourceRequirements: {cpu_limit: '', cpu_request: '', memory_limit: '', memory_request: ''},
schedule: {timeUnit: '', units: 0},
scheduleData: {
basicSchedule: {timeUnit: '', units: 0},
cron: {cronExpression: '', cronTimeZone: ''}
},
scheduleType: '',
skipReset: false,
sourceCatalogId: '',
status: '',
syncCatalog: {
streams: [
{
config: {
aliasName: '',
cursorField: [],
destinationSyncMode: '',
fieldSelectionEnabled: false,
primaryKey: [],
selected: false,
selectedFields: [{fieldPath: []}],
suggested: false,
syncMode: ''
},
stream: {
defaultCursorField: [],
jsonSchema: {},
name: '',
namespace: '',
sourceDefinedCursor: false,
sourceDefinedPrimaryKey: [],
supportedSyncModes: []
}
}
]
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/web_backend/connections/update';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionId":"","geography":"","name":"","namespaceDefinition":"","namespaceFormat":"","nonBreakingChangesPreference":"","notifySchemaChanges":false,"operations":[{"name":"","operationId":"","operatorConfiguration":{"dbt":{"dbtArguments":"","dockerImage":"","gitRepoBranch":"","gitRepoUrl":""},"normalization":{"option":""},"operatorType":"","webhook":{"dbtCloud":{"accountId":0,"jobId":0},"executionBody":"","executionUrl":"","webhookConfigId":"","webhookType":""}},"workspaceId":""}],"prefix":"","resourceRequirements":{"cpu_limit":"","cpu_request":"","memory_limit":"","memory_request":""},"schedule":{"timeUnit":"","units":0},"scheduleData":{"basicSchedule":{"timeUnit":"","units":0},"cron":{"cronExpression":"","cronTimeZone":""}},"scheduleType":"","skipReset":false,"sourceCatalogId":"","status":"","syncCatalog":{"streams":[{"config":{"aliasName":"","cursorField":[],"destinationSyncMode":"","fieldSelectionEnabled":false,"primaryKey":[],"selected":false,"selectedFields":[{"fieldPath":[]}],"suggested":false,"syncMode":""},"stream":{"defaultCursorField":[],"jsonSchema":{},"name":"","namespace":"","sourceDefinedCursor":false,"sourceDefinedPrimaryKey":[],"supportedSyncModes":[]}}]}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"connectionId": @"",
@"geography": @"",
@"name": @"",
@"namespaceDefinition": @"",
@"namespaceFormat": @"",
@"nonBreakingChangesPreference": @"",
@"notifySchemaChanges": @NO,
@"operations": @[ @{ @"name": @"", @"operationId": @"", @"operatorConfiguration": @{ @"dbt": @{ @"dbtArguments": @"", @"dockerImage": @"", @"gitRepoBranch": @"", @"gitRepoUrl": @"" }, @"normalization": @{ @"option": @"" }, @"operatorType": @"", @"webhook": @{ @"dbtCloud": @{ @"accountId": @0, @"jobId": @0 }, @"executionBody": @"", @"executionUrl": @"", @"webhookConfigId": @"", @"webhookType": @"" } }, @"workspaceId": @"" } ],
@"prefix": @"",
@"resourceRequirements": @{ @"cpu_limit": @"", @"cpu_request": @"", @"memory_limit": @"", @"memory_request": @"" },
@"schedule": @{ @"timeUnit": @"", @"units": @0 },
@"scheduleData": @{ @"basicSchedule": @{ @"timeUnit": @"", @"units": @0 }, @"cron": @{ @"cronExpression": @"", @"cronTimeZone": @"" } },
@"scheduleType": @"",
@"skipReset": @NO,
@"sourceCatalogId": @"",
@"status": @"",
@"syncCatalog": @{ @"streams": @[ @{ @"config": @{ @"aliasName": @"", @"cursorField": @[ ], @"destinationSyncMode": @"", @"fieldSelectionEnabled": @NO, @"primaryKey": @[ ], @"selected": @NO, @"selectedFields": @[ @{ @"fieldPath": @[ ] } ], @"suggested": @NO, @"syncMode": @"" }, @"stream": @{ @"defaultCursorField": @[ ], @"jsonSchema": @{ }, @"name": @"", @"namespace": @"", @"sourceDefinedCursor": @NO, @"sourceDefinedPrimaryKey": @[ ], @"supportedSyncModes": @[ ] } } ] } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/web_backend/connections/update"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/web_backend/connections/update" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operations\": [\n {\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"skipReset\": false,\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/web_backend/connections/update",
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([
'connectionId' => '',
'geography' => '',
'name' => '',
'namespaceDefinition' => '',
'namespaceFormat' => '',
'nonBreakingChangesPreference' => '',
'notifySchemaChanges' => null,
'operations' => [
[
'name' => '',
'operationId' => '',
'operatorConfiguration' => [
'dbt' => [
'dbtArguments' => '',
'dockerImage' => '',
'gitRepoBranch' => '',
'gitRepoUrl' => ''
],
'normalization' => [
'option' => ''
],
'operatorType' => '',
'webhook' => [
'dbtCloud' => [
'accountId' => 0,
'jobId' => 0
],
'executionBody' => '',
'executionUrl' => '',
'webhookConfigId' => '',
'webhookType' => ''
]
],
'workspaceId' => ''
]
],
'prefix' => '',
'resourceRequirements' => [
'cpu_limit' => '',
'cpu_request' => '',
'memory_limit' => '',
'memory_request' => ''
],
'schedule' => [
'timeUnit' => '',
'units' => 0
],
'scheduleData' => [
'basicSchedule' => [
'timeUnit' => '',
'units' => 0
],
'cron' => [
'cronExpression' => '',
'cronTimeZone' => ''
]
],
'scheduleType' => '',
'skipReset' => null,
'sourceCatalogId' => '',
'status' => '',
'syncCatalog' => [
'streams' => [
[
'config' => [
'aliasName' => '',
'cursorField' => [
],
'destinationSyncMode' => '',
'fieldSelectionEnabled' => null,
'primaryKey' => [
],
'selected' => null,
'selectedFields' => [
[
'fieldPath' => [
]
]
],
'suggested' => null,
'syncMode' => ''
],
'stream' => [
'defaultCursorField' => [
],
'jsonSchema' => [
],
'name' => '',
'namespace' => '',
'sourceDefinedCursor' => null,
'sourceDefinedPrimaryKey' => [
],
'supportedSyncModes' => [
]
]
]
]
]
]),
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;
}
request('POST', '{{baseUrl}}/v1/web_backend/connections/update', [
'body' => '{
"connectionId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operations": [
{
"name": "",
"operationId": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
},
"workspaceId": ""
}
],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"skipReset": false,
"sourceCatalogId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/web_backend/connections/update');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'connectionId' => '',
'geography' => '',
'name' => '',
'namespaceDefinition' => '',
'namespaceFormat' => '',
'nonBreakingChangesPreference' => '',
'notifySchemaChanges' => null,
'operations' => [
[
'name' => '',
'operationId' => '',
'operatorConfiguration' => [
'dbt' => [
'dbtArguments' => '',
'dockerImage' => '',
'gitRepoBranch' => '',
'gitRepoUrl' => ''
],
'normalization' => [
'option' => ''
],
'operatorType' => '',
'webhook' => [
'dbtCloud' => [
'accountId' => 0,
'jobId' => 0
],
'executionBody' => '',
'executionUrl' => '',
'webhookConfigId' => '',
'webhookType' => ''
]
],
'workspaceId' => ''
]
],
'prefix' => '',
'resourceRequirements' => [
'cpu_limit' => '',
'cpu_request' => '',
'memory_limit' => '',
'memory_request' => ''
],
'schedule' => [
'timeUnit' => '',
'units' => 0
],
'scheduleData' => [
'basicSchedule' => [
'timeUnit' => '',
'units' => 0
],
'cron' => [
'cronExpression' => '',
'cronTimeZone' => ''
]
],
'scheduleType' => '',
'skipReset' => null,
'sourceCatalogId' => '',
'status' => '',
'syncCatalog' => [
'streams' => [
[
'config' => [
'aliasName' => '',
'cursorField' => [
],
'destinationSyncMode' => '',
'fieldSelectionEnabled' => null,
'primaryKey' => [
],
'selected' => null,
'selectedFields' => [
[
'fieldPath' => [
]
]
],
'suggested' => null,
'syncMode' => ''
],
'stream' => [
'defaultCursorField' => [
],
'jsonSchema' => [
],
'name' => '',
'namespace' => '',
'sourceDefinedCursor' => null,
'sourceDefinedPrimaryKey' => [
],
'supportedSyncModes' => [
]
]
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'connectionId' => '',
'geography' => '',
'name' => '',
'namespaceDefinition' => '',
'namespaceFormat' => '',
'nonBreakingChangesPreference' => '',
'notifySchemaChanges' => null,
'operations' => [
[
'name' => '',
'operationId' => '',
'operatorConfiguration' => [
'dbt' => [
'dbtArguments' => '',
'dockerImage' => '',
'gitRepoBranch' => '',
'gitRepoUrl' => ''
],
'normalization' => [
'option' => ''
],
'operatorType' => '',
'webhook' => [
'dbtCloud' => [
'accountId' => 0,
'jobId' => 0
],
'executionBody' => '',
'executionUrl' => '',
'webhookConfigId' => '',
'webhookType' => ''
]
],
'workspaceId' => ''
]
],
'prefix' => '',
'resourceRequirements' => [
'cpu_limit' => '',
'cpu_request' => '',
'memory_limit' => '',
'memory_request' => ''
],
'schedule' => [
'timeUnit' => '',
'units' => 0
],
'scheduleData' => [
'basicSchedule' => [
'timeUnit' => '',
'units' => 0
],
'cron' => [
'cronExpression' => '',
'cronTimeZone' => ''
]
],
'scheduleType' => '',
'skipReset' => null,
'sourceCatalogId' => '',
'status' => '',
'syncCatalog' => [
'streams' => [
[
'config' => [
'aliasName' => '',
'cursorField' => [
],
'destinationSyncMode' => '',
'fieldSelectionEnabled' => null,
'primaryKey' => [
],
'selected' => null,
'selectedFields' => [
[
'fieldPath' => [
]
]
],
'suggested' => null,
'syncMode' => ''
],
'stream' => [
'defaultCursorField' => [
],
'jsonSchema' => [
],
'name' => '',
'namespace' => '',
'sourceDefinedCursor' => null,
'sourceDefinedPrimaryKey' => [
],
'supportedSyncModes' => [
]
]
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/web_backend/connections/update');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/web_backend/connections/update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operations": [
{
"name": "",
"operationId": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
},
"workspaceId": ""
}
],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"skipReset": false,
"sourceCatalogId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/web_backend/connections/update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operations": [
{
"name": "",
"operationId": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
},
"workspaceId": ""
}
],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"skipReset": false,
"sourceCatalogId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operations\": [\n {\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"skipReset\": false,\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/web_backend/connections/update", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/web_backend/connections/update"
payload = {
"connectionId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": False,
"operations": [
{
"name": "",
"operationId": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": { "option": "" },
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
},
"workspaceId": ""
}
],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"skipReset": False,
"sourceCatalogId": "",
"status": "",
"syncCatalog": { "streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": False,
"primaryKey": [],
"selected": False,
"selectedFields": [{ "fieldPath": [] }],
"suggested": False,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": False,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
] }
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/web_backend/connections/update"
payload <- "{\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operations\": [\n {\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"skipReset\": false,\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/web_backend/connections/update")
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 \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operations\": [\n {\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"skipReset\": false,\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/web_backend/connections/update') do |req|
req.body = "{\n \"connectionId\": \"\",\n \"geography\": \"\",\n \"name\": \"\",\n \"namespaceDefinition\": \"\",\n \"namespaceFormat\": \"\",\n \"nonBreakingChangesPreference\": \"\",\n \"notifySchemaChanges\": false,\n \"operations\": [\n {\n \"name\": \"\",\n \"operationId\": \"\",\n \"operatorConfiguration\": {\n \"dbt\": {\n \"dbtArguments\": \"\",\n \"dockerImage\": \"\",\n \"gitRepoBranch\": \"\",\n \"gitRepoUrl\": \"\"\n },\n \"normalization\": {\n \"option\": \"\"\n },\n \"operatorType\": \"\",\n \"webhook\": {\n \"dbtCloud\": {\n \"accountId\": 0,\n \"jobId\": 0\n },\n \"executionBody\": \"\",\n \"executionUrl\": \"\",\n \"webhookConfigId\": \"\",\n \"webhookType\": \"\"\n }\n },\n \"workspaceId\": \"\"\n }\n ],\n \"prefix\": \"\",\n \"resourceRequirements\": {\n \"cpu_limit\": \"\",\n \"cpu_request\": \"\",\n \"memory_limit\": \"\",\n \"memory_request\": \"\"\n },\n \"schedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"scheduleData\": {\n \"basicSchedule\": {\n \"timeUnit\": \"\",\n \"units\": 0\n },\n \"cron\": {\n \"cronExpression\": \"\",\n \"cronTimeZone\": \"\"\n }\n },\n \"scheduleType\": \"\",\n \"skipReset\": false,\n \"sourceCatalogId\": \"\",\n \"status\": \"\",\n \"syncCatalog\": {\n \"streams\": [\n {\n \"config\": {\n \"aliasName\": \"\",\n \"cursorField\": [],\n \"destinationSyncMode\": \"\",\n \"fieldSelectionEnabled\": false,\n \"primaryKey\": [],\n \"selected\": false,\n \"selectedFields\": [\n {\n \"fieldPath\": []\n }\n ],\n \"suggested\": false,\n \"syncMode\": \"\"\n },\n \"stream\": {\n \"defaultCursorField\": [],\n \"jsonSchema\": {},\n \"name\": \"\",\n \"namespace\": \"\",\n \"sourceDefinedCursor\": false,\n \"sourceDefinedPrimaryKey\": [],\n \"supportedSyncModes\": []\n }\n }\n ]\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/web_backend/connections/update";
let payload = json!({
"connectionId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operations": (
json!({
"name": "",
"operationId": "",
"operatorConfiguration": json!({
"dbt": json!({
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
}),
"normalization": json!({"option": ""}),
"operatorType": "",
"webhook": json!({
"dbtCloud": json!({
"accountId": 0,
"jobId": 0
}),
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
})
}),
"workspaceId": ""
})
),
"prefix": "",
"resourceRequirements": json!({
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
}),
"schedule": json!({
"timeUnit": "",
"units": 0
}),
"scheduleData": json!({
"basicSchedule": json!({
"timeUnit": "",
"units": 0
}),
"cron": json!({
"cronExpression": "",
"cronTimeZone": ""
})
}),
"scheduleType": "",
"skipReset": false,
"sourceCatalogId": "",
"status": "",
"syncCatalog": json!({"streams": (
json!({
"config": json!({
"aliasName": "",
"cursorField": (),
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": (),
"selected": false,
"selectedFields": (json!({"fieldPath": ()})),
"suggested": false,
"syncMode": ""
}),
"stream": json!({
"defaultCursorField": (),
"jsonSchema": json!({}),
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": (),
"supportedSyncModes": ()
})
})
)})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/web_backend/connections/update \
--header 'content-type: application/json' \
--data '{
"connectionId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operations": [
{
"name": "",
"operationId": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
},
"workspaceId": ""
}
],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"skipReset": false,
"sourceCatalogId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}'
echo '{
"connectionId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operations": [
{
"name": "",
"operationId": "",
"operatorConfiguration": {
"dbt": {
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
},
"normalization": {
"option": ""
},
"operatorType": "",
"webhook": {
"dbtCloud": {
"accountId": 0,
"jobId": 0
},
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
}
},
"workspaceId": ""
}
],
"prefix": "",
"resourceRequirements": {
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
},
"schedule": {
"timeUnit": "",
"units": 0
},
"scheduleData": {
"basicSchedule": {
"timeUnit": "",
"units": 0
},
"cron": {
"cronExpression": "",
"cronTimeZone": ""
}
},
"scheduleType": "",
"skipReset": false,
"sourceCatalogId": "",
"status": "",
"syncCatalog": {
"streams": [
{
"config": {
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [
{
"fieldPath": []
}
],
"suggested": false,
"syncMode": ""
},
"stream": {
"defaultCursorField": [],
"jsonSchema": {},
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
}
}
]
}
}' | \
http POST {{baseUrl}}/v1/web_backend/connections/update \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "connectionId": "",\n "geography": "",\n "name": "",\n "namespaceDefinition": "",\n "namespaceFormat": "",\n "nonBreakingChangesPreference": "",\n "notifySchemaChanges": false,\n "operations": [\n {\n "name": "",\n "operationId": "",\n "operatorConfiguration": {\n "dbt": {\n "dbtArguments": "",\n "dockerImage": "",\n "gitRepoBranch": "",\n "gitRepoUrl": ""\n },\n "normalization": {\n "option": ""\n },\n "operatorType": "",\n "webhook": {\n "dbtCloud": {\n "accountId": 0,\n "jobId": 0\n },\n "executionBody": "",\n "executionUrl": "",\n "webhookConfigId": "",\n "webhookType": ""\n }\n },\n "workspaceId": ""\n }\n ],\n "prefix": "",\n "resourceRequirements": {\n "cpu_limit": "",\n "cpu_request": "",\n "memory_limit": "",\n "memory_request": ""\n },\n "schedule": {\n "timeUnit": "",\n "units": 0\n },\n "scheduleData": {\n "basicSchedule": {\n "timeUnit": "",\n "units": 0\n },\n "cron": {\n "cronExpression": "",\n "cronTimeZone": ""\n }\n },\n "scheduleType": "",\n "skipReset": false,\n "sourceCatalogId": "",\n "status": "",\n "syncCatalog": {\n "streams": [\n {\n "config": {\n "aliasName": "",\n "cursorField": [],\n "destinationSyncMode": "",\n "fieldSelectionEnabled": false,\n "primaryKey": [],\n "selected": false,\n "selectedFields": [\n {\n "fieldPath": []\n }\n ],\n "suggested": false,\n "syncMode": ""\n },\n "stream": {\n "defaultCursorField": [],\n "jsonSchema": {},\n "name": "",\n "namespace": "",\n "sourceDefinedCursor": false,\n "sourceDefinedPrimaryKey": [],\n "supportedSyncModes": []\n }\n }\n ]\n }\n}' \
--output-document \
- {{baseUrl}}/v1/web_backend/connections/update
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"connectionId": "",
"geography": "",
"name": "",
"namespaceDefinition": "",
"namespaceFormat": "",
"nonBreakingChangesPreference": "",
"notifySchemaChanges": false,
"operations": [
[
"name": "",
"operationId": "",
"operatorConfiguration": [
"dbt": [
"dbtArguments": "",
"dockerImage": "",
"gitRepoBranch": "",
"gitRepoUrl": ""
],
"normalization": ["option": ""],
"operatorType": "",
"webhook": [
"dbtCloud": [
"accountId": 0,
"jobId": 0
],
"executionBody": "",
"executionUrl": "",
"webhookConfigId": "",
"webhookType": ""
]
],
"workspaceId": ""
]
],
"prefix": "",
"resourceRequirements": [
"cpu_limit": "",
"cpu_request": "",
"memory_limit": "",
"memory_request": ""
],
"schedule": [
"timeUnit": "",
"units": 0
],
"scheduleData": [
"basicSchedule": [
"timeUnit": "",
"units": 0
],
"cron": [
"cronExpression": "",
"cronTimeZone": ""
]
],
"scheduleType": "",
"skipReset": false,
"sourceCatalogId": "",
"status": "",
"syncCatalog": ["streams": [
[
"config": [
"aliasName": "",
"cursorField": [],
"destinationSyncMode": "",
"fieldSelectionEnabled": false,
"primaryKey": [],
"selected": false,
"selectedFields": [["fieldPath": []]],
"suggested": false,
"syncMode": ""
],
"stream": [
"defaultCursorField": [],
"jsonSchema": [],
"name": "",
"namespace": "",
"sourceDefinedCursor": false,
"sourceDefinedPrimaryKey": [],
"supportedSyncModes": []
]
]
]]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/web_backend/connections/update")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"destination": {
"connectionConfiguration": {
"user": "charles"
}
},
"namespaceFormat": "${SOURCE_NAMESPACE}",
"source": {
"connectionConfiguration": {
"user": "charles"
}
}
}
POST
Creates a workspace
{{baseUrl}}/v1/workspaces/create
BODY json
{
"anonymousDataCollection": false,
"defaultGeography": "",
"displaySetupWizard": false,
"email": "",
"name": "",
"news": false,
"notifications": [
{
"customerioConfiguration": {},
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": {
"webhook": ""
}
}
],
"securityUpdates": false,
"webhookConfigs": [
{
"authToken": "",
"name": "",
"validationUrl": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/workspaces/create");
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 \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"name\": \"\",\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/workspaces/create" {:content-type :json
:form-params {:anonymousDataCollection false
:defaultGeography ""
:displaySetupWizard false
:email ""
:name ""
:news false
:notifications [{:customerioConfiguration {}
:notificationType ""
:sendOnFailure false
:sendOnSuccess false
:slackConfiguration {:webhook ""}}]
:securityUpdates false
:webhookConfigs [{:authToken ""
:name ""
:validationUrl ""}]}})
require "http/client"
url = "{{baseUrl}}/v1/workspaces/create"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"name\": \"\",\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/workspaces/create"),
Content = new StringContent("{\n \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"name\": \"\",\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/workspaces/create");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"name\": \"\",\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/workspaces/create"
payload := strings.NewReader("{\n \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"name\": \"\",\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/workspaces/create HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 500
{
"anonymousDataCollection": false,
"defaultGeography": "",
"displaySetupWizard": false,
"email": "",
"name": "",
"news": false,
"notifications": [
{
"customerioConfiguration": {},
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": {
"webhook": ""
}
}
],
"securityUpdates": false,
"webhookConfigs": [
{
"authToken": "",
"name": "",
"validationUrl": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/workspaces/create")
.setHeader("content-type", "application/json")
.setBody("{\n \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"name\": \"\",\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/workspaces/create"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"name\": \"\",\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"name\": \"\",\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/workspaces/create")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/workspaces/create")
.header("content-type", "application/json")
.body("{\n \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"name\": \"\",\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
anonymousDataCollection: false,
defaultGeography: '',
displaySetupWizard: false,
email: '',
name: '',
news: false,
notifications: [
{
customerioConfiguration: {},
notificationType: '',
sendOnFailure: false,
sendOnSuccess: false,
slackConfiguration: {
webhook: ''
}
}
],
securityUpdates: false,
webhookConfigs: [
{
authToken: '',
name: '',
validationUrl: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/workspaces/create');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/workspaces/create',
headers: {'content-type': 'application/json'},
data: {
anonymousDataCollection: false,
defaultGeography: '',
displaySetupWizard: false,
email: '',
name: '',
news: false,
notifications: [
{
customerioConfiguration: {},
notificationType: '',
sendOnFailure: false,
sendOnSuccess: false,
slackConfiguration: {webhook: ''}
}
],
securityUpdates: false,
webhookConfigs: [{authToken: '', name: '', validationUrl: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/workspaces/create';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"anonymousDataCollection":false,"defaultGeography":"","displaySetupWizard":false,"email":"","name":"","news":false,"notifications":[{"customerioConfiguration":{},"notificationType":"","sendOnFailure":false,"sendOnSuccess":false,"slackConfiguration":{"webhook":""}}],"securityUpdates":false,"webhookConfigs":[{"authToken":"","name":"","validationUrl":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/workspaces/create',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "anonymousDataCollection": false,\n "defaultGeography": "",\n "displaySetupWizard": false,\n "email": "",\n "name": "",\n "news": false,\n "notifications": [\n {\n "customerioConfiguration": {},\n "notificationType": "",\n "sendOnFailure": false,\n "sendOnSuccess": false,\n "slackConfiguration": {\n "webhook": ""\n }\n }\n ],\n "securityUpdates": false,\n "webhookConfigs": [\n {\n "authToken": "",\n "name": "",\n "validationUrl": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"name\": \"\",\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/workspaces/create")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/workspaces/create',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
anonymousDataCollection: false,
defaultGeography: '',
displaySetupWizard: false,
email: '',
name: '',
news: false,
notifications: [
{
customerioConfiguration: {},
notificationType: '',
sendOnFailure: false,
sendOnSuccess: false,
slackConfiguration: {webhook: ''}
}
],
securityUpdates: false,
webhookConfigs: [{authToken: '', name: '', validationUrl: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/workspaces/create',
headers: {'content-type': 'application/json'},
body: {
anonymousDataCollection: false,
defaultGeography: '',
displaySetupWizard: false,
email: '',
name: '',
news: false,
notifications: [
{
customerioConfiguration: {},
notificationType: '',
sendOnFailure: false,
sendOnSuccess: false,
slackConfiguration: {webhook: ''}
}
],
securityUpdates: false,
webhookConfigs: [{authToken: '', name: '', validationUrl: ''}]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/workspaces/create');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
anonymousDataCollection: false,
defaultGeography: '',
displaySetupWizard: false,
email: '',
name: '',
news: false,
notifications: [
{
customerioConfiguration: {},
notificationType: '',
sendOnFailure: false,
sendOnSuccess: false,
slackConfiguration: {
webhook: ''
}
}
],
securityUpdates: false,
webhookConfigs: [
{
authToken: '',
name: '',
validationUrl: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/workspaces/create',
headers: {'content-type': 'application/json'},
data: {
anonymousDataCollection: false,
defaultGeography: '',
displaySetupWizard: false,
email: '',
name: '',
news: false,
notifications: [
{
customerioConfiguration: {},
notificationType: '',
sendOnFailure: false,
sendOnSuccess: false,
slackConfiguration: {webhook: ''}
}
],
securityUpdates: false,
webhookConfigs: [{authToken: '', name: '', validationUrl: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/workspaces/create';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"anonymousDataCollection":false,"defaultGeography":"","displaySetupWizard":false,"email":"","name":"","news":false,"notifications":[{"customerioConfiguration":{},"notificationType":"","sendOnFailure":false,"sendOnSuccess":false,"slackConfiguration":{"webhook":""}}],"securityUpdates":false,"webhookConfigs":[{"authToken":"","name":"","validationUrl":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"anonymousDataCollection": @NO,
@"defaultGeography": @"",
@"displaySetupWizard": @NO,
@"email": @"",
@"name": @"",
@"news": @NO,
@"notifications": @[ @{ @"customerioConfiguration": @{ }, @"notificationType": @"", @"sendOnFailure": @NO, @"sendOnSuccess": @NO, @"slackConfiguration": @{ @"webhook": @"" } } ],
@"securityUpdates": @NO,
@"webhookConfigs": @[ @{ @"authToken": @"", @"name": @"", @"validationUrl": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/workspaces/create"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/workspaces/create" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"name\": \"\",\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/workspaces/create",
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([
'anonymousDataCollection' => null,
'defaultGeography' => '',
'displaySetupWizard' => null,
'email' => '',
'name' => '',
'news' => null,
'notifications' => [
[
'customerioConfiguration' => [
],
'notificationType' => '',
'sendOnFailure' => null,
'sendOnSuccess' => null,
'slackConfiguration' => [
'webhook' => ''
]
]
],
'securityUpdates' => null,
'webhookConfigs' => [
[
'authToken' => '',
'name' => '',
'validationUrl' => ''
]
]
]),
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;
}
request('POST', '{{baseUrl}}/v1/workspaces/create', [
'body' => '{
"anonymousDataCollection": false,
"defaultGeography": "",
"displaySetupWizard": false,
"email": "",
"name": "",
"news": false,
"notifications": [
{
"customerioConfiguration": {},
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": {
"webhook": ""
}
}
],
"securityUpdates": false,
"webhookConfigs": [
{
"authToken": "",
"name": "",
"validationUrl": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/workspaces/create');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'anonymousDataCollection' => null,
'defaultGeography' => '',
'displaySetupWizard' => null,
'email' => '',
'name' => '',
'news' => null,
'notifications' => [
[
'customerioConfiguration' => [
],
'notificationType' => '',
'sendOnFailure' => null,
'sendOnSuccess' => null,
'slackConfiguration' => [
'webhook' => ''
]
]
],
'securityUpdates' => null,
'webhookConfigs' => [
[
'authToken' => '',
'name' => '',
'validationUrl' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'anonymousDataCollection' => null,
'defaultGeography' => '',
'displaySetupWizard' => null,
'email' => '',
'name' => '',
'news' => null,
'notifications' => [
[
'customerioConfiguration' => [
],
'notificationType' => '',
'sendOnFailure' => null,
'sendOnSuccess' => null,
'slackConfiguration' => [
'webhook' => ''
]
]
],
'securityUpdates' => null,
'webhookConfigs' => [
[
'authToken' => '',
'name' => '',
'validationUrl' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/workspaces/create');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/workspaces/create' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"anonymousDataCollection": false,
"defaultGeography": "",
"displaySetupWizard": false,
"email": "",
"name": "",
"news": false,
"notifications": [
{
"customerioConfiguration": {},
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": {
"webhook": ""
}
}
],
"securityUpdates": false,
"webhookConfigs": [
{
"authToken": "",
"name": "",
"validationUrl": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/workspaces/create' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"anonymousDataCollection": false,
"defaultGeography": "",
"displaySetupWizard": false,
"email": "",
"name": "",
"news": false,
"notifications": [
{
"customerioConfiguration": {},
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": {
"webhook": ""
}
}
],
"securityUpdates": false,
"webhookConfigs": [
{
"authToken": "",
"name": "",
"validationUrl": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"name\": \"\",\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/workspaces/create", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/workspaces/create"
payload = {
"anonymousDataCollection": False,
"defaultGeography": "",
"displaySetupWizard": False,
"email": "",
"name": "",
"news": False,
"notifications": [
{
"customerioConfiguration": {},
"notificationType": "",
"sendOnFailure": False,
"sendOnSuccess": False,
"slackConfiguration": { "webhook": "" }
}
],
"securityUpdates": False,
"webhookConfigs": [
{
"authToken": "",
"name": "",
"validationUrl": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/workspaces/create"
payload <- "{\n \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"name\": \"\",\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/workspaces/create")
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 \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"name\": \"\",\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/workspaces/create') do |req|
req.body = "{\n \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"name\": \"\",\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/workspaces/create";
let payload = json!({
"anonymousDataCollection": false,
"defaultGeography": "",
"displaySetupWizard": false,
"email": "",
"name": "",
"news": false,
"notifications": (
json!({
"customerioConfiguration": json!({}),
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": json!({"webhook": ""})
})
),
"securityUpdates": false,
"webhookConfigs": (
json!({
"authToken": "",
"name": "",
"validationUrl": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/workspaces/create \
--header 'content-type: application/json' \
--data '{
"anonymousDataCollection": false,
"defaultGeography": "",
"displaySetupWizard": false,
"email": "",
"name": "",
"news": false,
"notifications": [
{
"customerioConfiguration": {},
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": {
"webhook": ""
}
}
],
"securityUpdates": false,
"webhookConfigs": [
{
"authToken": "",
"name": "",
"validationUrl": ""
}
]
}'
echo '{
"anonymousDataCollection": false,
"defaultGeography": "",
"displaySetupWizard": false,
"email": "",
"name": "",
"news": false,
"notifications": [
{
"customerioConfiguration": {},
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": {
"webhook": ""
}
}
],
"securityUpdates": false,
"webhookConfigs": [
{
"authToken": "",
"name": "",
"validationUrl": ""
}
]
}' | \
http POST {{baseUrl}}/v1/workspaces/create \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "anonymousDataCollection": false,\n "defaultGeography": "",\n "displaySetupWizard": false,\n "email": "",\n "name": "",\n "news": false,\n "notifications": [\n {\n "customerioConfiguration": {},\n "notificationType": "",\n "sendOnFailure": false,\n "sendOnSuccess": false,\n "slackConfiguration": {\n "webhook": ""\n }\n }\n ],\n "securityUpdates": false,\n "webhookConfigs": [\n {\n "authToken": "",\n "name": "",\n "validationUrl": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/v1/workspaces/create
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"anonymousDataCollection": false,
"defaultGeography": "",
"displaySetupWizard": false,
"email": "",
"name": "",
"news": false,
"notifications": [
[
"customerioConfiguration": [],
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": ["webhook": ""]
]
],
"securityUpdates": false,
"webhookConfigs": [
[
"authToken": "",
"name": "",
"validationUrl": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/workspaces/create")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Deletes a workspace
{{baseUrl}}/v1/workspaces/delete
BODY json
{
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/workspaces/delete");
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 \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/workspaces/delete" {:content-type :json
:form-params {:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/workspaces/delete"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/workspaces/delete"),
Content = new StringContent("{\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/workspaces/delete");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/workspaces/delete"
payload := strings.NewReader("{\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/workspaces/delete HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/workspaces/delete")
.setHeader("content-type", "application/json")
.setBody("{\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/workspaces/delete"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/workspaces/delete")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/workspaces/delete")
.header("content-type", "application/json")
.body("{\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/workspaces/delete');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/workspaces/delete',
headers: {'content-type': 'application/json'},
data: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/workspaces/delete';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/workspaces/delete',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/workspaces/delete")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/workspaces/delete',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({workspaceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/workspaces/delete',
headers: {'content-type': 'application/json'},
body: {workspaceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/workspaces/delete');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/workspaces/delete',
headers: {'content-type': 'application/json'},
data: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/workspaces/delete';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/workspaces/delete"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/workspaces/delete" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/workspaces/delete",
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([
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/workspaces/delete', [
'body' => '{
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/workspaces/delete');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/workspaces/delete');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/workspaces/delete' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/workspaces/delete' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/workspaces/delete", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/workspaces/delete"
payload = { "workspaceId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/workspaces/delete"
payload <- "{\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/workspaces/delete")
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 \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/workspaces/delete') do |req|
req.body = "{\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/workspaces/delete";
let payload = json!({"workspaceId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/workspaces/delete \
--header 'content-type: application/json' \
--data '{
"workspaceId": ""
}'
echo '{
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/workspaces/delete \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/workspaces/delete
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["workspaceId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/workspaces/delete")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Find workspace by ID
{{baseUrl}}/v1/workspaces/get
BODY json
{
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/workspaces/get");
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 \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/workspaces/get" {:content-type :json
:form-params {:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/workspaces/get"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/workspaces/get"),
Content = new StringContent("{\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/workspaces/get");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/workspaces/get"
payload := strings.NewReader("{\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/workspaces/get HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/workspaces/get")
.setHeader("content-type", "application/json")
.setBody("{\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/workspaces/get"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/workspaces/get")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/workspaces/get")
.header("content-type", "application/json")
.body("{\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/workspaces/get');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/workspaces/get',
headers: {'content-type': 'application/json'},
data: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/workspaces/get';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/workspaces/get',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/workspaces/get")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/workspaces/get',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({workspaceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/workspaces/get',
headers: {'content-type': 'application/json'},
body: {workspaceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/workspaces/get');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/workspaces/get',
headers: {'content-type': 'application/json'},
data: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/workspaces/get';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/workspaces/get"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/workspaces/get" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/workspaces/get",
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([
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/workspaces/get', [
'body' => '{
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/workspaces/get');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/workspaces/get');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/workspaces/get' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/workspaces/get' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/workspaces/get", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/workspaces/get"
payload = { "workspaceId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/workspaces/get"
payload <- "{\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/workspaces/get")
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 \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/workspaces/get') do |req|
req.body = "{\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/workspaces/get";
let payload = json!({"workspaceId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/workspaces/get \
--header 'content-type: application/json' \
--data '{
"workspaceId": ""
}'
echo '{
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/workspaces/get \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/workspaces/get
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["workspaceId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/workspaces/get")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Find workspace by connection id
{{baseUrl}}/v1/workspaces/get_by_connection_id
BODY json
{
"connectionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/workspaces/get_by_connection_id");
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 \"connectionId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/workspaces/get_by_connection_id" {:content-type :json
:form-params {:connectionId ""}})
require "http/client"
url = "{{baseUrl}}/v1/workspaces/get_by_connection_id"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"connectionId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/workspaces/get_by_connection_id"),
Content = new StringContent("{\n \"connectionId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/workspaces/get_by_connection_id");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"connectionId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/workspaces/get_by_connection_id"
payload := strings.NewReader("{\n \"connectionId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/workspaces/get_by_connection_id HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 24
{
"connectionId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/workspaces/get_by_connection_id")
.setHeader("content-type", "application/json")
.setBody("{\n \"connectionId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/workspaces/get_by_connection_id"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"connectionId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"connectionId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/workspaces/get_by_connection_id")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/workspaces/get_by_connection_id")
.header("content-type", "application/json")
.body("{\n \"connectionId\": \"\"\n}")
.asString();
const data = JSON.stringify({
connectionId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/workspaces/get_by_connection_id');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/workspaces/get_by_connection_id',
headers: {'content-type': 'application/json'},
data: {connectionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/workspaces/get_by_connection_id';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/workspaces/get_by_connection_id',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "connectionId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"connectionId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/workspaces/get_by_connection_id")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/workspaces/get_by_connection_id',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({connectionId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/workspaces/get_by_connection_id',
headers: {'content-type': 'application/json'},
body: {connectionId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/workspaces/get_by_connection_id');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
connectionId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/workspaces/get_by_connection_id',
headers: {'content-type': 'application/json'},
data: {connectionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/workspaces/get_by_connection_id';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"connectionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"connectionId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/workspaces/get_by_connection_id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/workspaces/get_by_connection_id" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"connectionId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/workspaces/get_by_connection_id",
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([
'connectionId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/workspaces/get_by_connection_id', [
'body' => '{
"connectionId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/workspaces/get_by_connection_id');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'connectionId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'connectionId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/workspaces/get_by_connection_id');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/workspaces/get_by_connection_id' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/workspaces/get_by_connection_id' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"connectionId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"connectionId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/workspaces/get_by_connection_id", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/workspaces/get_by_connection_id"
payload = { "connectionId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/workspaces/get_by_connection_id"
payload <- "{\n \"connectionId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/workspaces/get_by_connection_id")
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 \"connectionId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/workspaces/get_by_connection_id') do |req|
req.body = "{\n \"connectionId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/workspaces/get_by_connection_id";
let payload = json!({"connectionId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/workspaces/get_by_connection_id \
--header 'content-type: application/json' \
--data '{
"connectionId": ""
}'
echo '{
"connectionId": ""
}' | \
http POST {{baseUrl}}/v1/workspaces/get_by_connection_id \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "connectionId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/workspaces/get_by_connection_id
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["connectionId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/workspaces/get_by_connection_id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Find workspace by slug
{{baseUrl}}/v1/workspaces/get_by_slug
BODY json
{
"slug": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/workspaces/get_by_slug");
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 \"slug\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/workspaces/get_by_slug" {:content-type :json
:form-params {:slug ""}})
require "http/client"
url = "{{baseUrl}}/v1/workspaces/get_by_slug"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"slug\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/workspaces/get_by_slug"),
Content = new StringContent("{\n \"slug\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/workspaces/get_by_slug");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"slug\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/workspaces/get_by_slug"
payload := strings.NewReader("{\n \"slug\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/workspaces/get_by_slug HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 16
{
"slug": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/workspaces/get_by_slug")
.setHeader("content-type", "application/json")
.setBody("{\n \"slug\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/workspaces/get_by_slug"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"slug\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"slug\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/workspaces/get_by_slug")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/workspaces/get_by_slug")
.header("content-type", "application/json")
.body("{\n \"slug\": \"\"\n}")
.asString();
const data = JSON.stringify({
slug: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/workspaces/get_by_slug');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/workspaces/get_by_slug',
headers: {'content-type': 'application/json'},
data: {slug: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/workspaces/get_by_slug';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"slug":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/workspaces/get_by_slug',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "slug": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"slug\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/workspaces/get_by_slug")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/workspaces/get_by_slug',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({slug: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/workspaces/get_by_slug',
headers: {'content-type': 'application/json'},
body: {slug: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/workspaces/get_by_slug');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
slug: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/workspaces/get_by_slug',
headers: {'content-type': 'application/json'},
data: {slug: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/workspaces/get_by_slug';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"slug":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"slug": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/workspaces/get_by_slug"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/workspaces/get_by_slug" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"slug\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/workspaces/get_by_slug",
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([
'slug' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/workspaces/get_by_slug', [
'body' => '{
"slug": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/workspaces/get_by_slug');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'slug' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'slug' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/workspaces/get_by_slug');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/workspaces/get_by_slug' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"slug": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/workspaces/get_by_slug' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"slug": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"slug\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/workspaces/get_by_slug", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/workspaces/get_by_slug"
payload = { "slug": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/workspaces/get_by_slug"
payload <- "{\n \"slug\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/workspaces/get_by_slug")
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 \"slug\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/workspaces/get_by_slug') do |req|
req.body = "{\n \"slug\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/workspaces/get_by_slug";
let payload = json!({"slug": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/workspaces/get_by_slug \
--header 'content-type: application/json' \
--data '{
"slug": ""
}'
echo '{
"slug": ""
}' | \
http POST {{baseUrl}}/v1/workspaces/get_by_slug \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "slug": ""\n}' \
--output-document \
- {{baseUrl}}/v1/workspaces/get_by_slug
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["slug": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/workspaces/get_by_slug")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
List all workspaces registered in the current Airbyte deployment
{{baseUrl}}/v1/workspaces/list
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/workspaces/list");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/workspaces/list")
require "http/client"
url = "{{baseUrl}}/v1/workspaces/list"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/workspaces/list"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/workspaces/list");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/workspaces/list"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/workspaces/list HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/workspaces/list")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/workspaces/list"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/workspaces/list")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/workspaces/list")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/workspaces/list');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/v1/workspaces/list'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/workspaces/list';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/workspaces/list',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/workspaces/list")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/workspaces/list',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'POST', url: '{{baseUrl}}/v1/workspaces/list'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/workspaces/list');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'POST', url: '{{baseUrl}}/v1/workspaces/list'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/workspaces/list';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/workspaces/list"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/workspaces/list" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/workspaces/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/workspaces/list');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/workspaces/list');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/workspaces/list');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/workspaces/list' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/workspaces/list' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/v1/workspaces/list")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/workspaces/list"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/workspaces/list"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/workspaces/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/v1/workspaces/list') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/workspaces/list";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/workspaces/list
http POST {{baseUrl}}/v1/workspaces/list
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/v1/workspaces/list
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/workspaces/list")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Update workspace feedback state
{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done
BODY json
{
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done");
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 \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done" {:content-type :json
:form-params {:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done"),
Content = new StringContent("{\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done"
payload := strings.NewReader("{\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/workspaces/tag_feedback_status_as_done HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done")
.setHeader("content-type", "application/json")
.setBody("{\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done")
.header("content-type", "application/json")
.body("{\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done',
headers: {'content-type': 'application/json'},
data: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/workspaces/tag_feedback_status_as_done',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({workspaceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done',
headers: {'content-type': 'application/json'},
body: {workspaceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done',
headers: {'content-type': 'application/json'},
data: {workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done",
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([
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done', [
'body' => '{
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/workspaces/tag_feedback_status_as_done", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done"
payload = { "workspaceId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done"
payload <- "{\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done")
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 \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/workspaces/tag_feedback_status_as_done') do |req|
req.body = "{\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done";
let payload = json!({"workspaceId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/workspaces/tag_feedback_status_as_done \
--header 'content-type: application/json' \
--data '{
"workspaceId": ""
}'
echo '{
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/workspaces/tag_feedback_status_as_done \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/workspaces/tag_feedback_status_as_done
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["workspaceId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/workspaces/tag_feedback_status_as_done")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Update workspace name
{{baseUrl}}/v1/workspaces/update_name
BODY json
{
"name": "",
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/workspaces/update_name");
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\": \"\",\n \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/workspaces/update_name" {:content-type :json
:form-params {:name ""
:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/workspaces/update_name"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"name\": \"\",\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/workspaces/update_name"),
Content = new StringContent("{\n \"name\": \"\",\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/workspaces/update_name");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"name\": \"\",\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/workspaces/update_name"
payload := strings.NewReader("{\n \"name\": \"\",\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/workspaces/update_name HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 37
{
"name": "",
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/workspaces/update_name")
.setHeader("content-type", "application/json")
.setBody("{\n \"name\": \"\",\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/workspaces/update_name"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"name\": \"\",\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"name\": \"\",\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/workspaces/update_name")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/workspaces/update_name")
.header("content-type", "application/json")
.body("{\n \"name\": \"\",\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
name: '',
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/workspaces/update_name');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/workspaces/update_name',
headers: {'content-type': 'application/json'},
data: {name: '', workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/workspaces/update_name';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"name":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/workspaces/update_name',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "name": "",\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"name\": \"\",\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/workspaces/update_name")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/workspaces/update_name',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({name: '', workspaceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/workspaces/update_name',
headers: {'content-type': 'application/json'},
body: {name: '', workspaceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/workspaces/update_name');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
name: '',
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/workspaces/update_name',
headers: {'content-type': 'application/json'},
data: {name: '', workspaceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/workspaces/update_name';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"name":"","workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"name": @"",
@"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/workspaces/update_name"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/workspaces/update_name" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"name\": \"\",\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/workspaces/update_name",
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' => '',
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/workspaces/update_name', [
'body' => '{
"name": "",
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/workspaces/update_name');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'name' => '',
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'name' => '',
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/workspaces/update_name');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/workspaces/update_name' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": "",
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/workspaces/update_name' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": "",
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"name\": \"\",\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/workspaces/update_name", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/workspaces/update_name"
payload = {
"name": "",
"workspaceId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/workspaces/update_name"
payload <- "{\n \"name\": \"\",\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/workspaces/update_name")
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\": \"\",\n \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/workspaces/update_name') do |req|
req.body = "{\n \"name\": \"\",\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/workspaces/update_name";
let payload = json!({
"name": "",
"workspaceId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/workspaces/update_name \
--header 'content-type: application/json' \
--data '{
"name": "",
"workspaceId": ""
}'
echo '{
"name": "",
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/workspaces/update_name \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "name": "",\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/workspaces/update_name
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"name": "",
"workspaceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/workspaces/update_name")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Update workspace state
{{baseUrl}}/v1/workspaces/update
BODY json
{
"anonymousDataCollection": false,
"defaultGeography": "",
"displaySetupWizard": false,
"email": "",
"initialSetupComplete": false,
"news": false,
"notifications": [
{
"customerioConfiguration": {},
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": {
"webhook": ""
}
}
],
"securityUpdates": false,
"webhookConfigs": [
{
"authToken": "",
"name": "",
"validationUrl": ""
}
],
"workspaceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/workspaces/update");
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 \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"initialSetupComplete\": false,\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ],\n \"workspaceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/workspaces/update" {:content-type :json
:form-params {:anonymousDataCollection false
:defaultGeography ""
:displaySetupWizard false
:email ""
:initialSetupComplete false
:news false
:notifications [{:customerioConfiguration {}
:notificationType ""
:sendOnFailure false
:sendOnSuccess false
:slackConfiguration {:webhook ""}}]
:securityUpdates false
:webhookConfigs [{:authToken ""
:name ""
:validationUrl ""}]
:workspaceId ""}})
require "http/client"
url = "{{baseUrl}}/v1/workspaces/update"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"initialSetupComplete\": false,\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ],\n \"workspaceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/workspaces/update"),
Content = new StringContent("{\n \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"initialSetupComplete\": false,\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ],\n \"workspaceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/workspaces/update");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"initialSetupComplete\": false,\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ],\n \"workspaceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/workspaces/update"
payload := strings.NewReader("{\n \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"initialSetupComplete\": false,\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ],\n \"workspaceId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/workspaces/update HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 540
{
"anonymousDataCollection": false,
"defaultGeography": "",
"displaySetupWizard": false,
"email": "",
"initialSetupComplete": false,
"news": false,
"notifications": [
{
"customerioConfiguration": {},
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": {
"webhook": ""
}
}
],
"securityUpdates": false,
"webhookConfigs": [
{
"authToken": "",
"name": "",
"validationUrl": ""
}
],
"workspaceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/workspaces/update")
.setHeader("content-type", "application/json")
.setBody("{\n \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"initialSetupComplete\": false,\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ],\n \"workspaceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/workspaces/update"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"initialSetupComplete\": false,\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ],\n \"workspaceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"initialSetupComplete\": false,\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ],\n \"workspaceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/workspaces/update")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/workspaces/update")
.header("content-type", "application/json")
.body("{\n \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"initialSetupComplete\": false,\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ],\n \"workspaceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
anonymousDataCollection: false,
defaultGeography: '',
displaySetupWizard: false,
email: '',
initialSetupComplete: false,
news: false,
notifications: [
{
customerioConfiguration: {},
notificationType: '',
sendOnFailure: false,
sendOnSuccess: false,
slackConfiguration: {
webhook: ''
}
}
],
securityUpdates: false,
webhookConfigs: [
{
authToken: '',
name: '',
validationUrl: ''
}
],
workspaceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/workspaces/update');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/workspaces/update',
headers: {'content-type': 'application/json'},
data: {
anonymousDataCollection: false,
defaultGeography: '',
displaySetupWizard: false,
email: '',
initialSetupComplete: false,
news: false,
notifications: [
{
customerioConfiguration: {},
notificationType: '',
sendOnFailure: false,
sendOnSuccess: false,
slackConfiguration: {webhook: ''}
}
],
securityUpdates: false,
webhookConfigs: [{authToken: '', name: '', validationUrl: ''}],
workspaceId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/workspaces/update';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"anonymousDataCollection":false,"defaultGeography":"","displaySetupWizard":false,"email":"","initialSetupComplete":false,"news":false,"notifications":[{"customerioConfiguration":{},"notificationType":"","sendOnFailure":false,"sendOnSuccess":false,"slackConfiguration":{"webhook":""}}],"securityUpdates":false,"webhookConfigs":[{"authToken":"","name":"","validationUrl":""}],"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/workspaces/update',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "anonymousDataCollection": false,\n "defaultGeography": "",\n "displaySetupWizard": false,\n "email": "",\n "initialSetupComplete": false,\n "news": false,\n "notifications": [\n {\n "customerioConfiguration": {},\n "notificationType": "",\n "sendOnFailure": false,\n "sendOnSuccess": false,\n "slackConfiguration": {\n "webhook": ""\n }\n }\n ],\n "securityUpdates": false,\n "webhookConfigs": [\n {\n "authToken": "",\n "name": "",\n "validationUrl": ""\n }\n ],\n "workspaceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"initialSetupComplete\": false,\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ],\n \"workspaceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/workspaces/update")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/workspaces/update',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
anonymousDataCollection: false,
defaultGeography: '',
displaySetupWizard: false,
email: '',
initialSetupComplete: false,
news: false,
notifications: [
{
customerioConfiguration: {},
notificationType: '',
sendOnFailure: false,
sendOnSuccess: false,
slackConfiguration: {webhook: ''}
}
],
securityUpdates: false,
webhookConfigs: [{authToken: '', name: '', validationUrl: ''}],
workspaceId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/workspaces/update',
headers: {'content-type': 'application/json'},
body: {
anonymousDataCollection: false,
defaultGeography: '',
displaySetupWizard: false,
email: '',
initialSetupComplete: false,
news: false,
notifications: [
{
customerioConfiguration: {},
notificationType: '',
sendOnFailure: false,
sendOnSuccess: false,
slackConfiguration: {webhook: ''}
}
],
securityUpdates: false,
webhookConfigs: [{authToken: '', name: '', validationUrl: ''}],
workspaceId: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/workspaces/update');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
anonymousDataCollection: false,
defaultGeography: '',
displaySetupWizard: false,
email: '',
initialSetupComplete: false,
news: false,
notifications: [
{
customerioConfiguration: {},
notificationType: '',
sendOnFailure: false,
sendOnSuccess: false,
slackConfiguration: {
webhook: ''
}
}
],
securityUpdates: false,
webhookConfigs: [
{
authToken: '',
name: '',
validationUrl: ''
}
],
workspaceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/workspaces/update',
headers: {'content-type': 'application/json'},
data: {
anonymousDataCollection: false,
defaultGeography: '',
displaySetupWizard: false,
email: '',
initialSetupComplete: false,
news: false,
notifications: [
{
customerioConfiguration: {},
notificationType: '',
sendOnFailure: false,
sendOnSuccess: false,
slackConfiguration: {webhook: ''}
}
],
securityUpdates: false,
webhookConfigs: [{authToken: '', name: '', validationUrl: ''}],
workspaceId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/workspaces/update';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"anonymousDataCollection":false,"defaultGeography":"","displaySetupWizard":false,"email":"","initialSetupComplete":false,"news":false,"notifications":[{"customerioConfiguration":{},"notificationType":"","sendOnFailure":false,"sendOnSuccess":false,"slackConfiguration":{"webhook":""}}],"securityUpdates":false,"webhookConfigs":[{"authToken":"","name":"","validationUrl":""}],"workspaceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"anonymousDataCollection": @NO,
@"defaultGeography": @"",
@"displaySetupWizard": @NO,
@"email": @"",
@"initialSetupComplete": @NO,
@"news": @NO,
@"notifications": @[ @{ @"customerioConfiguration": @{ }, @"notificationType": @"", @"sendOnFailure": @NO, @"sendOnSuccess": @NO, @"slackConfiguration": @{ @"webhook": @"" } } ],
@"securityUpdates": @NO,
@"webhookConfigs": @[ @{ @"authToken": @"", @"name": @"", @"validationUrl": @"" } ],
@"workspaceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/workspaces/update"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/workspaces/update" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"initialSetupComplete\": false,\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ],\n \"workspaceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/workspaces/update",
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([
'anonymousDataCollection' => null,
'defaultGeography' => '',
'displaySetupWizard' => null,
'email' => '',
'initialSetupComplete' => null,
'news' => null,
'notifications' => [
[
'customerioConfiguration' => [
],
'notificationType' => '',
'sendOnFailure' => null,
'sendOnSuccess' => null,
'slackConfiguration' => [
'webhook' => ''
]
]
],
'securityUpdates' => null,
'webhookConfigs' => [
[
'authToken' => '',
'name' => '',
'validationUrl' => ''
]
],
'workspaceId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/v1/workspaces/update', [
'body' => '{
"anonymousDataCollection": false,
"defaultGeography": "",
"displaySetupWizard": false,
"email": "",
"initialSetupComplete": false,
"news": false,
"notifications": [
{
"customerioConfiguration": {},
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": {
"webhook": ""
}
}
],
"securityUpdates": false,
"webhookConfigs": [
{
"authToken": "",
"name": "",
"validationUrl": ""
}
],
"workspaceId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/workspaces/update');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'anonymousDataCollection' => null,
'defaultGeography' => '',
'displaySetupWizard' => null,
'email' => '',
'initialSetupComplete' => null,
'news' => null,
'notifications' => [
[
'customerioConfiguration' => [
],
'notificationType' => '',
'sendOnFailure' => null,
'sendOnSuccess' => null,
'slackConfiguration' => [
'webhook' => ''
]
]
],
'securityUpdates' => null,
'webhookConfigs' => [
[
'authToken' => '',
'name' => '',
'validationUrl' => ''
]
],
'workspaceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'anonymousDataCollection' => null,
'defaultGeography' => '',
'displaySetupWizard' => null,
'email' => '',
'initialSetupComplete' => null,
'news' => null,
'notifications' => [
[
'customerioConfiguration' => [
],
'notificationType' => '',
'sendOnFailure' => null,
'sendOnSuccess' => null,
'slackConfiguration' => [
'webhook' => ''
]
]
],
'securityUpdates' => null,
'webhookConfigs' => [
[
'authToken' => '',
'name' => '',
'validationUrl' => ''
]
],
'workspaceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/workspaces/update');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/workspaces/update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"anonymousDataCollection": false,
"defaultGeography": "",
"displaySetupWizard": false,
"email": "",
"initialSetupComplete": false,
"news": false,
"notifications": [
{
"customerioConfiguration": {},
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": {
"webhook": ""
}
}
],
"securityUpdates": false,
"webhookConfigs": [
{
"authToken": "",
"name": "",
"validationUrl": ""
}
],
"workspaceId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/workspaces/update' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"anonymousDataCollection": false,
"defaultGeography": "",
"displaySetupWizard": false,
"email": "",
"initialSetupComplete": false,
"news": false,
"notifications": [
{
"customerioConfiguration": {},
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": {
"webhook": ""
}
}
],
"securityUpdates": false,
"webhookConfigs": [
{
"authToken": "",
"name": "",
"validationUrl": ""
}
],
"workspaceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"initialSetupComplete\": false,\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ],\n \"workspaceId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/workspaces/update", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/workspaces/update"
payload = {
"anonymousDataCollection": False,
"defaultGeography": "",
"displaySetupWizard": False,
"email": "",
"initialSetupComplete": False,
"news": False,
"notifications": [
{
"customerioConfiguration": {},
"notificationType": "",
"sendOnFailure": False,
"sendOnSuccess": False,
"slackConfiguration": { "webhook": "" }
}
],
"securityUpdates": False,
"webhookConfigs": [
{
"authToken": "",
"name": "",
"validationUrl": ""
}
],
"workspaceId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/workspaces/update"
payload <- "{\n \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"initialSetupComplete\": false,\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ],\n \"workspaceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/workspaces/update")
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 \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"initialSetupComplete\": false,\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ],\n \"workspaceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/workspaces/update') do |req|
req.body = "{\n \"anonymousDataCollection\": false,\n \"defaultGeography\": \"\",\n \"displaySetupWizard\": false,\n \"email\": \"\",\n \"initialSetupComplete\": false,\n \"news\": false,\n \"notifications\": [\n {\n \"customerioConfiguration\": {},\n \"notificationType\": \"\",\n \"sendOnFailure\": false,\n \"sendOnSuccess\": false,\n \"slackConfiguration\": {\n \"webhook\": \"\"\n }\n }\n ],\n \"securityUpdates\": false,\n \"webhookConfigs\": [\n {\n \"authToken\": \"\",\n \"name\": \"\",\n \"validationUrl\": \"\"\n }\n ],\n \"workspaceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/workspaces/update";
let payload = json!({
"anonymousDataCollection": false,
"defaultGeography": "",
"displaySetupWizard": false,
"email": "",
"initialSetupComplete": false,
"news": false,
"notifications": (
json!({
"customerioConfiguration": json!({}),
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": json!({"webhook": ""})
})
),
"securityUpdates": false,
"webhookConfigs": (
json!({
"authToken": "",
"name": "",
"validationUrl": ""
})
),
"workspaceId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/workspaces/update \
--header 'content-type: application/json' \
--data '{
"anonymousDataCollection": false,
"defaultGeography": "",
"displaySetupWizard": false,
"email": "",
"initialSetupComplete": false,
"news": false,
"notifications": [
{
"customerioConfiguration": {},
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": {
"webhook": ""
}
}
],
"securityUpdates": false,
"webhookConfigs": [
{
"authToken": "",
"name": "",
"validationUrl": ""
}
],
"workspaceId": ""
}'
echo '{
"anonymousDataCollection": false,
"defaultGeography": "",
"displaySetupWizard": false,
"email": "",
"initialSetupComplete": false,
"news": false,
"notifications": [
{
"customerioConfiguration": {},
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": {
"webhook": ""
}
}
],
"securityUpdates": false,
"webhookConfigs": [
{
"authToken": "",
"name": "",
"validationUrl": ""
}
],
"workspaceId": ""
}' | \
http POST {{baseUrl}}/v1/workspaces/update \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "anonymousDataCollection": false,\n "defaultGeography": "",\n "displaySetupWizard": false,\n "email": "",\n "initialSetupComplete": false,\n "news": false,\n "notifications": [\n {\n "customerioConfiguration": {},\n "notificationType": "",\n "sendOnFailure": false,\n "sendOnSuccess": false,\n "slackConfiguration": {\n "webhook": ""\n }\n }\n ],\n "securityUpdates": false,\n "webhookConfigs": [\n {\n "authToken": "",\n "name": "",\n "validationUrl": ""\n }\n ],\n "workspaceId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/workspaces/update
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"anonymousDataCollection": false,
"defaultGeography": "",
"displaySetupWizard": false,
"email": "",
"initialSetupComplete": false,
"news": false,
"notifications": [
[
"customerioConfiguration": [],
"notificationType": "",
"sendOnFailure": false,
"sendOnSuccess": false,
"slackConfiguration": ["webhook": ""]
]
],
"securityUpdates": false,
"webhookConfigs": [
[
"authToken": "",
"name": "",
"validationUrl": ""
]
],
"workspaceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/workspaces/update")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()