RudderStack HTTP API
POST
Alias
{{baseUrl}}/v1/alias
BODY json
{
"userId": "",
"previousId": "",
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/alias");
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 \"userId\": \"\",\n \"previousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/alias" {:content-type :json
:form-params {:userId ""
:previousId ""
:context {:traits {:trait1 ""}
:ip ""
:library {:name ""}}
:timestamp ""}})
require "http/client"
url = "{{baseUrl}}/v1/alias"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"userId\": \"\",\n \"previousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/alias"),
Content = new StringContent("{\n \"userId\": \"\",\n \"previousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/alias");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"userId\": \"\",\n \"previousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/alias"
payload := strings.NewReader("{\n \"userId\": \"\",\n \"previousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/alias HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 173
{
"userId": "",
"previousId": "",
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/alias")
.setHeader("content-type", "application/json")
.setBody("{\n \"userId\": \"\",\n \"previousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/alias"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"userId\": \"\",\n \"previousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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 \"userId\": \"\",\n \"previousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/alias")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/alias")
.header("content-type", "application/json")
.body("{\n \"userId\": \"\",\n \"previousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}")
.asString();
const data = JSON.stringify({
userId: '',
previousId: '',
context: {
traits: {
trait1: ''
},
ip: '',
library: {
name: ''
}
},
timestamp: ''
});
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/alias');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/alias',
headers: {'content-type': 'application/json'},
data: {
userId: '',
previousId: '',
context: {traits: {trait1: ''}, ip: '', library: {name: ''}},
timestamp: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/alias';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"userId":"","previousId":"","context":{"traits":{"trait1":""},"ip":"","library":{"name":""}},"timestamp":""}'
};
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/alias',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "userId": "",\n "previousId": "",\n "context": {\n "traits": {\n "trait1": ""\n },\n "ip": "",\n "library": {\n "name": ""\n }\n },\n "timestamp": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"userId\": \"\",\n \"previousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/alias")
.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/alias',
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({
userId: '',
previousId: '',
context: {traits: {trait1: ''}, ip: '', library: {name: ''}},
timestamp: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/alias',
headers: {'content-type': 'application/json'},
body: {
userId: '',
previousId: '',
context: {traits: {trait1: ''}, ip: '', library: {name: ''}},
timestamp: ''
},
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/alias');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
userId: '',
previousId: '',
context: {
traits: {
trait1: ''
},
ip: '',
library: {
name: ''
}
},
timestamp: ''
});
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/alias',
headers: {'content-type': 'application/json'},
data: {
userId: '',
previousId: '',
context: {traits: {trait1: ''}, ip: '', library: {name: ''}},
timestamp: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/alias';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"userId":"","previousId":"","context":{"traits":{"trait1":""},"ip":"","library":{"name":""}},"timestamp":""}'
};
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 = @{ @"userId": @"",
@"previousId": @"",
@"context": @{ @"traits": @{ @"trait1": @"" }, @"ip": @"", @"library": @{ @"name": @"" } },
@"timestamp": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/alias"]
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/alias" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"userId\": \"\",\n \"previousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/alias",
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([
'userId' => '',
'previousId' => '',
'context' => [
'traits' => [
'trait1' => ''
],
'ip' => '',
'library' => [
'name' => ''
]
],
'timestamp' => ''
]),
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/alias', [
'body' => '{
"userId": "",
"previousId": "",
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/alias');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'userId' => '',
'previousId' => '',
'context' => [
'traits' => [
'trait1' => ''
],
'ip' => '',
'library' => [
'name' => ''
]
],
'timestamp' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'userId' => '',
'previousId' => '',
'context' => [
'traits' => [
'trait1' => ''
],
'ip' => '',
'library' => [
'name' => ''
]
],
'timestamp' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/alias');
$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/alias' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"userId": "",
"previousId": "",
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/alias' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"userId": "",
"previousId": "",
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"userId\": \"\",\n \"previousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/alias", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/alias"
payload = {
"userId": "",
"previousId": "",
"context": {
"traits": { "trait1": "" },
"ip": "",
"library": { "name": "" }
},
"timestamp": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/alias"
payload <- "{\n \"userId\": \"\",\n \"previousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/alias")
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 \"userId\": \"\",\n \"previousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/alias') do |req|
req.body = "{\n \"userId\": \"\",\n \"previousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/alias";
let payload = json!({
"userId": "",
"previousId": "",
"context": json!({
"traits": json!({"trait1": ""}),
"ip": "",
"library": json!({"name": ""})
}),
"timestamp": ""
});
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/alias \
--header 'content-type: application/json' \
--data '{
"userId": "",
"previousId": "",
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}'
echo '{
"userId": "",
"previousId": "",
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}' | \
http POST {{baseUrl}}/v1/alias \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "userId": "",\n "previousId": "",\n "context": {\n "traits": {\n "trait1": ""\n },\n "ip": "",\n "library": {\n "name": ""\n }\n },\n "timestamp": ""\n}' \
--output-document \
- {{baseUrl}}/v1/alias
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"userId": "",
"previousId": "",
"context": [
"traits": ["trait1": ""],
"ip": "",
"library": ["name": ""]
],
"timestamp": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/alias")! 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
text/plain; charset=utf-8
RESPONSE BODY text
OK
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Invalid request
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Invalid Authorization Header
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Source does not accept webhook events
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Request size too large
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Too many requests
POST
Batch
{{baseUrl}}/v1/batch
BODY json
{
"batch": [
{
"userId": "",
"anonymousId": "",
"type": "",
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/batch");
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 \"batch\": [\n {\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"type\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/batch" {:content-type :json
:form-params {:batch [{:userId ""
:anonymousId ""
:type ""
:context {:traits {:trait1 ""}
:ip ""
:library {:name ""}}
:timestamp ""}]}})
require "http/client"
url = "{{baseUrl}}/v1/batch"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"batch\": [\n {\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"type\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/batch"),
Content = new StringContent("{\n \"batch\": [\n {\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"type\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/batch");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"batch\": [\n {\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"type\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/batch"
payload := strings.NewReader("{\n \"batch\": [\n {\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"type\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/batch HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 269
{
"batch": [
{
"userId": "",
"anonymousId": "",
"type": "",
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/batch")
.setHeader("content-type", "application/json")
.setBody("{\n \"batch\": [\n {\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"type\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/batch"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"batch\": [\n {\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"type\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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 \"batch\": [\n {\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"type\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/batch")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/batch")
.header("content-type", "application/json")
.body("{\n \"batch\": [\n {\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"type\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
batch: [
{
userId: '',
anonymousId: '',
type: '',
context: {
traits: {
trait1: ''
},
ip: '',
library: {
name: ''
}
},
timestamp: ''
}
]
});
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/batch');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/batch',
headers: {'content-type': 'application/json'},
data: {
batch: [
{
userId: '',
anonymousId: '',
type: '',
context: {traits: {trait1: ''}, ip: '', library: {name: ''}},
timestamp: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"batch":[{"userId":"","anonymousId":"","type":"","context":{"traits":{"trait1":""},"ip":"","library":{"name":""}},"timestamp":""}]}'
};
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/batch',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "batch": [\n {\n "userId": "",\n "anonymousId": "",\n "type": "",\n "context": {\n "traits": {\n "trait1": ""\n },\n "ip": "",\n "library": {\n "name": ""\n }\n },\n "timestamp": ""\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 \"batch\": [\n {\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"type\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/batch")
.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/batch',
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({
batch: [
{
userId: '',
anonymousId: '',
type: '',
context: {traits: {trait1: ''}, ip: '', library: {name: ''}},
timestamp: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/batch',
headers: {'content-type': 'application/json'},
body: {
batch: [
{
userId: '',
anonymousId: '',
type: '',
context: {traits: {trait1: ''}, ip: '', library: {name: ''}},
timestamp: ''
}
]
},
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/batch');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
batch: [
{
userId: '',
anonymousId: '',
type: '',
context: {
traits: {
trait1: ''
},
ip: '',
library: {
name: ''
}
},
timestamp: ''
}
]
});
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/batch',
headers: {'content-type': 'application/json'},
data: {
batch: [
{
userId: '',
anonymousId: '',
type: '',
context: {traits: {trait1: ''}, ip: '', library: {name: ''}},
timestamp: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"batch":[{"userId":"","anonymousId":"","type":"","context":{"traits":{"trait1":""},"ip":"","library":{"name":""}},"timestamp":""}]}'
};
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 = @{ @"batch": @[ @{ @"userId": @"", @"anonymousId": @"", @"type": @"", @"context": @{ @"traits": @{ @"trait1": @"" }, @"ip": @"", @"library": @{ @"name": @"" } }, @"timestamp": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/batch"]
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/batch" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"batch\": [\n {\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"type\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/batch",
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([
'batch' => [
[
'userId' => '',
'anonymousId' => '',
'type' => '',
'context' => [
'traits' => [
'trait1' => ''
],
'ip' => '',
'library' => [
'name' => ''
]
],
'timestamp' => ''
]
]
]),
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/batch', [
'body' => '{
"batch": [
{
"userId": "",
"anonymousId": "",
"type": "",
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/batch');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'batch' => [
[
'userId' => '',
'anonymousId' => '',
'type' => '',
'context' => [
'traits' => [
'trait1' => ''
],
'ip' => '',
'library' => [
'name' => ''
]
],
'timestamp' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'batch' => [
[
'userId' => '',
'anonymousId' => '',
'type' => '',
'context' => [
'traits' => [
'trait1' => ''
],
'ip' => '',
'library' => [
'name' => ''
]
],
'timestamp' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/batch');
$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/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"batch": [
{
"userId": "",
"anonymousId": "",
"type": "",
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"batch": [
{
"userId": "",
"anonymousId": "",
"type": "",
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"batch\": [\n {\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"type\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/batch", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/batch"
payload = { "batch": [
{
"userId": "",
"anonymousId": "",
"type": "",
"context": {
"traits": { "trait1": "" },
"ip": "",
"library": { "name": "" }
},
"timestamp": ""
}
] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/batch"
payload <- "{\n \"batch\": [\n {\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"type\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/batch")
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 \"batch\": [\n {\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"type\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/batch') do |req|
req.body = "{\n \"batch\": [\n {\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"type\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/batch";
let payload = json!({"batch": (
json!({
"userId": "",
"anonymousId": "",
"type": "",
"context": json!({
"traits": json!({"trait1": ""}),
"ip": "",
"library": json!({"name": ""})
}),
"timestamp": ""
})
)});
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/batch \
--header 'content-type: application/json' \
--data '{
"batch": [
{
"userId": "",
"anonymousId": "",
"type": "",
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}
]
}'
echo '{
"batch": [
{
"userId": "",
"anonymousId": "",
"type": "",
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}
]
}' | \
http POST {{baseUrl}}/v1/batch \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "batch": [\n {\n "userId": "",\n "anonymousId": "",\n "type": "",\n "context": {\n "traits": {\n "trait1": ""\n },\n "ip": "",\n "library": {\n "name": ""\n }\n },\n "timestamp": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/v1/batch
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["batch": [
[
"userId": "",
"anonymousId": "",
"type": "",
"context": [
"traits": ["trait1": ""],
"ip": "",
"library": ["name": ""]
],
"timestamp": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/batch")! 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
text/plain; charset=utf-8
RESPONSE BODY text
OK
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Invalid request
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Invalid Authorization Header
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Source does not accept webhook events
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Request size too large
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Too many requests
POST
Group
{{baseUrl}}/v1/group
BODY json
{
"userId": "",
"anonymousId": "",
"groupId": "",
"traits": {},
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/group");
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 \"userId\": \"\",\n \"anonymousId\": \"\",\n \"groupId\": \"\",\n \"traits\": {},\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/group" {:content-type :json
:form-params {:userId ""
:anonymousId ""
:groupId ""
:traits {}
:context {:traits {:trait1 ""}
:ip ""
:library {:name ""}}
:timestamp ""}})
require "http/client"
url = "{{baseUrl}}/v1/group"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"groupId\": \"\",\n \"traits\": {},\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/group"),
Content = new StringContent("{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"groupId\": \"\",\n \"traits\": {},\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/group");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"groupId\": \"\",\n \"traits\": {},\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/group"
payload := strings.NewReader("{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"groupId\": \"\",\n \"traits\": {},\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/group HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 207
{
"userId": "",
"anonymousId": "",
"groupId": "",
"traits": {},
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/group")
.setHeader("content-type", "application/json")
.setBody("{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"groupId\": \"\",\n \"traits\": {},\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/group"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"groupId\": \"\",\n \"traits\": {},\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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 \"userId\": \"\",\n \"anonymousId\": \"\",\n \"groupId\": \"\",\n \"traits\": {},\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/group")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/group")
.header("content-type", "application/json")
.body("{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"groupId\": \"\",\n \"traits\": {},\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}")
.asString();
const data = JSON.stringify({
userId: '',
anonymousId: '',
groupId: '',
traits: {},
context: {
traits: {
trait1: ''
},
ip: '',
library: {
name: ''
}
},
timestamp: ''
});
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/group');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/group',
headers: {'content-type': 'application/json'},
data: {
userId: '',
anonymousId: '',
groupId: '',
traits: {},
context: {traits: {trait1: ''}, ip: '', library: {name: ''}},
timestamp: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/group';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"userId":"","anonymousId":"","groupId":"","traits":{},"context":{"traits":{"trait1":""},"ip":"","library":{"name":""}},"timestamp":""}'
};
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/group',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "userId": "",\n "anonymousId": "",\n "groupId": "",\n "traits": {},\n "context": {\n "traits": {\n "trait1": ""\n },\n "ip": "",\n "library": {\n "name": ""\n }\n },\n "timestamp": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"groupId\": \"\",\n \"traits\": {},\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/group")
.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/group',
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({
userId: '',
anonymousId: '',
groupId: '',
traits: {},
context: {traits: {trait1: ''}, ip: '', library: {name: ''}},
timestamp: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/group',
headers: {'content-type': 'application/json'},
body: {
userId: '',
anonymousId: '',
groupId: '',
traits: {},
context: {traits: {trait1: ''}, ip: '', library: {name: ''}},
timestamp: ''
},
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/group');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
userId: '',
anonymousId: '',
groupId: '',
traits: {},
context: {
traits: {
trait1: ''
},
ip: '',
library: {
name: ''
}
},
timestamp: ''
});
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/group',
headers: {'content-type': 'application/json'},
data: {
userId: '',
anonymousId: '',
groupId: '',
traits: {},
context: {traits: {trait1: ''}, ip: '', library: {name: ''}},
timestamp: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/group';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"userId":"","anonymousId":"","groupId":"","traits":{},"context":{"traits":{"trait1":""},"ip":"","library":{"name":""}},"timestamp":""}'
};
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 = @{ @"userId": @"",
@"anonymousId": @"",
@"groupId": @"",
@"traits": @{ },
@"context": @{ @"traits": @{ @"trait1": @"" }, @"ip": @"", @"library": @{ @"name": @"" } },
@"timestamp": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/group"]
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/group" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"groupId\": \"\",\n \"traits\": {},\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/group",
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([
'userId' => '',
'anonymousId' => '',
'groupId' => '',
'traits' => [
],
'context' => [
'traits' => [
'trait1' => ''
],
'ip' => '',
'library' => [
'name' => ''
]
],
'timestamp' => ''
]),
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/group', [
'body' => '{
"userId": "",
"anonymousId": "",
"groupId": "",
"traits": {},
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/group');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'userId' => '',
'anonymousId' => '',
'groupId' => '',
'traits' => [
],
'context' => [
'traits' => [
'trait1' => ''
],
'ip' => '',
'library' => [
'name' => ''
]
],
'timestamp' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'userId' => '',
'anonymousId' => '',
'groupId' => '',
'traits' => [
],
'context' => [
'traits' => [
'trait1' => ''
],
'ip' => '',
'library' => [
'name' => ''
]
],
'timestamp' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/group');
$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/group' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"userId": "",
"anonymousId": "",
"groupId": "",
"traits": {},
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/group' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"userId": "",
"anonymousId": "",
"groupId": "",
"traits": {},
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"groupId\": \"\",\n \"traits\": {},\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/group", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/group"
payload = {
"userId": "",
"anonymousId": "",
"groupId": "",
"traits": {},
"context": {
"traits": { "trait1": "" },
"ip": "",
"library": { "name": "" }
},
"timestamp": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/group"
payload <- "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"groupId\": \"\",\n \"traits\": {},\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/group")
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 \"userId\": \"\",\n \"anonymousId\": \"\",\n \"groupId\": \"\",\n \"traits\": {},\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/group') do |req|
req.body = "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"groupId\": \"\",\n \"traits\": {},\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/group";
let payload = json!({
"userId": "",
"anonymousId": "",
"groupId": "",
"traits": json!({}),
"context": json!({
"traits": json!({"trait1": ""}),
"ip": "",
"library": json!({"name": ""})
}),
"timestamp": ""
});
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/group \
--header 'content-type: application/json' \
--data '{
"userId": "",
"anonymousId": "",
"groupId": "",
"traits": {},
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}'
echo '{
"userId": "",
"anonymousId": "",
"groupId": "",
"traits": {},
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}' | \
http POST {{baseUrl}}/v1/group \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "userId": "",\n "anonymousId": "",\n "groupId": "",\n "traits": {},\n "context": {\n "traits": {\n "trait1": ""\n },\n "ip": "",\n "library": {\n "name": ""\n }\n },\n "timestamp": ""\n}' \
--output-document \
- {{baseUrl}}/v1/group
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"userId": "",
"anonymousId": "",
"groupId": "",
"traits": [],
"context": [
"traits": ["trait1": ""],
"ip": "",
"library": ["name": ""]
],
"timestamp": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/group")! 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
text/plain; charset=utf-8
RESPONSE BODY text
OK
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Invalid request
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Invalid Authorization Header
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Source does not accept webhook events
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Request size too large
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Too many requests
POST
Identify
{{baseUrl}}/v1/identify
BODY json
{
"userId": "",
"anonymousId": "",
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/identify");
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 \"userId\": \"\",\n \"anonymousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/identify" {:content-type :json
:form-params {:userId ""
:anonymousId ""
:context {:traits {:trait1 ""}
:ip ""
:library {:name ""}}
:timestamp ""}})
require "http/client"
url = "{{baseUrl}}/v1/identify"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/identify"),
Content = new StringContent("{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/identify");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/identify"
payload := strings.NewReader("{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/identify HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 174
{
"userId": "",
"anonymousId": "",
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/identify")
.setHeader("content-type", "application/json")
.setBody("{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/identify"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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 \"userId\": \"\",\n \"anonymousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/identify")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/identify")
.header("content-type", "application/json")
.body("{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}")
.asString();
const data = JSON.stringify({
userId: '',
anonymousId: '',
context: {
traits: {
trait1: ''
},
ip: '',
library: {
name: ''
}
},
timestamp: ''
});
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/identify');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/identify',
headers: {'content-type': 'application/json'},
data: {
userId: '',
anonymousId: '',
context: {traits: {trait1: ''}, ip: '', library: {name: ''}},
timestamp: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/identify';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"userId":"","anonymousId":"","context":{"traits":{"trait1":""},"ip":"","library":{"name":""}},"timestamp":""}'
};
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/identify',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "userId": "",\n "anonymousId": "",\n "context": {\n "traits": {\n "trait1": ""\n },\n "ip": "",\n "library": {\n "name": ""\n }\n },\n "timestamp": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/identify")
.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/identify',
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({
userId: '',
anonymousId: '',
context: {traits: {trait1: ''}, ip: '', library: {name: ''}},
timestamp: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/identify',
headers: {'content-type': 'application/json'},
body: {
userId: '',
anonymousId: '',
context: {traits: {trait1: ''}, ip: '', library: {name: ''}},
timestamp: ''
},
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/identify');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
userId: '',
anonymousId: '',
context: {
traits: {
trait1: ''
},
ip: '',
library: {
name: ''
}
},
timestamp: ''
});
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/identify',
headers: {'content-type': 'application/json'},
data: {
userId: '',
anonymousId: '',
context: {traits: {trait1: ''}, ip: '', library: {name: ''}},
timestamp: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/identify';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"userId":"","anonymousId":"","context":{"traits":{"trait1":""},"ip":"","library":{"name":""}},"timestamp":""}'
};
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 = @{ @"userId": @"",
@"anonymousId": @"",
@"context": @{ @"traits": @{ @"trait1": @"" }, @"ip": @"", @"library": @{ @"name": @"" } },
@"timestamp": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/identify"]
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/identify" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/identify",
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([
'userId' => '',
'anonymousId' => '',
'context' => [
'traits' => [
'trait1' => ''
],
'ip' => '',
'library' => [
'name' => ''
]
],
'timestamp' => ''
]),
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/identify', [
'body' => '{
"userId": "",
"anonymousId": "",
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/identify');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'userId' => '',
'anonymousId' => '',
'context' => [
'traits' => [
'trait1' => ''
],
'ip' => '',
'library' => [
'name' => ''
]
],
'timestamp' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'userId' => '',
'anonymousId' => '',
'context' => [
'traits' => [
'trait1' => ''
],
'ip' => '',
'library' => [
'name' => ''
]
],
'timestamp' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/identify');
$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/identify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"userId": "",
"anonymousId": "",
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/identify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"userId": "",
"anonymousId": "",
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/identify", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/identify"
payload = {
"userId": "",
"anonymousId": "",
"context": {
"traits": { "trait1": "" },
"ip": "",
"library": { "name": "" }
},
"timestamp": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/identify"
payload <- "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/identify")
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 \"userId\": \"\",\n \"anonymousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/identify') do |req|
req.body = "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"context\": {\n \"traits\": {\n \"trait1\": \"\"\n },\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/identify";
let payload = json!({
"userId": "",
"anonymousId": "",
"context": json!({
"traits": json!({"trait1": ""}),
"ip": "",
"library": json!({"name": ""})
}),
"timestamp": ""
});
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/identify \
--header 'content-type: application/json' \
--data '{
"userId": "",
"anonymousId": "",
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}'
echo '{
"userId": "",
"anonymousId": "",
"context": {
"traits": {
"trait1": ""
},
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}' | \
http POST {{baseUrl}}/v1/identify \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "userId": "",\n "anonymousId": "",\n "context": {\n "traits": {\n "trait1": ""\n },\n "ip": "",\n "library": {\n "name": ""\n }\n },\n "timestamp": ""\n}' \
--output-document \
- {{baseUrl}}/v1/identify
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"userId": "",
"anonymousId": "",
"context": [
"traits": ["trait1": ""],
"ip": "",
"library": ["name": ""]
],
"timestamp": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/identify")! 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
text/plain; charset=utf-8
RESPONSE BODY text
OK
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Invalid request
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Invalid Authorization Header
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Source does not accept webhook events
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Request size too large
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Too many requests
POST
Page
{{baseUrl}}/v1/page
BODY json
{
"userId": "",
"anonymousId": "",
"name": "",
"properties": {},
"context": {
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/page");
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 \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/page" {:content-type :json
:form-params {:userId ""
:anonymousId ""
:name ""
:properties {}
:context {:ip ""
:library {:name ""}}
:timestamp ""}})
require "http/client"
url = "{{baseUrl}}/v1/page"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/page"),
Content = new StringContent("{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/page");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/page"
payload := strings.NewReader("{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/page HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 166
{
"userId": "",
"anonymousId": "",
"name": "",
"properties": {},
"context": {
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/page")
.setHeader("content-type", "application/json")
.setBody("{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/page"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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 \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/page")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/page")
.header("content-type", "application/json")
.body("{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}")
.asString();
const data = JSON.stringify({
userId: '',
anonymousId: '',
name: '',
properties: {},
context: {
ip: '',
library: {
name: ''
}
},
timestamp: ''
});
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/page');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/page',
headers: {'content-type': 'application/json'},
data: {
userId: '',
anonymousId: '',
name: '',
properties: {},
context: {ip: '', library: {name: ''}},
timestamp: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/page';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"userId":"","anonymousId":"","name":"","properties":{},"context":{"ip":"","library":{"name":""}},"timestamp":""}'
};
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/page',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "userId": "",\n "anonymousId": "",\n "name": "",\n "properties": {},\n "context": {\n "ip": "",\n "library": {\n "name": ""\n }\n },\n "timestamp": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/page")
.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/page',
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({
userId: '',
anonymousId: '',
name: '',
properties: {},
context: {ip: '', library: {name: ''}},
timestamp: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/page',
headers: {'content-type': 'application/json'},
body: {
userId: '',
anonymousId: '',
name: '',
properties: {},
context: {ip: '', library: {name: ''}},
timestamp: ''
},
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/page');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
userId: '',
anonymousId: '',
name: '',
properties: {},
context: {
ip: '',
library: {
name: ''
}
},
timestamp: ''
});
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/page',
headers: {'content-type': 'application/json'},
data: {
userId: '',
anonymousId: '',
name: '',
properties: {},
context: {ip: '', library: {name: ''}},
timestamp: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/page';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"userId":"","anonymousId":"","name":"","properties":{},"context":{"ip":"","library":{"name":""}},"timestamp":""}'
};
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 = @{ @"userId": @"",
@"anonymousId": @"",
@"name": @"",
@"properties": @{ },
@"context": @{ @"ip": @"", @"library": @{ @"name": @"" } },
@"timestamp": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/page"]
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/page" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/page",
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([
'userId' => '',
'anonymousId' => '',
'name' => '',
'properties' => [
],
'context' => [
'ip' => '',
'library' => [
'name' => ''
]
],
'timestamp' => ''
]),
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/page', [
'body' => '{
"userId": "",
"anonymousId": "",
"name": "",
"properties": {},
"context": {
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/page');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'userId' => '',
'anonymousId' => '',
'name' => '',
'properties' => [
],
'context' => [
'ip' => '',
'library' => [
'name' => ''
]
],
'timestamp' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'userId' => '',
'anonymousId' => '',
'name' => '',
'properties' => [
],
'context' => [
'ip' => '',
'library' => [
'name' => ''
]
],
'timestamp' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/page');
$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/page' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"userId": "",
"anonymousId": "",
"name": "",
"properties": {},
"context": {
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/page' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"userId": "",
"anonymousId": "",
"name": "",
"properties": {},
"context": {
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/page", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/page"
payload = {
"userId": "",
"anonymousId": "",
"name": "",
"properties": {},
"context": {
"ip": "",
"library": { "name": "" }
},
"timestamp": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/page"
payload <- "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/page")
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 \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/page') do |req|
req.body = "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/page";
let payload = json!({
"userId": "",
"anonymousId": "",
"name": "",
"properties": json!({}),
"context": json!({
"ip": "",
"library": json!({"name": ""})
}),
"timestamp": ""
});
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/page \
--header 'content-type: application/json' \
--data '{
"userId": "",
"anonymousId": "",
"name": "",
"properties": {},
"context": {
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}'
echo '{
"userId": "",
"anonymousId": "",
"name": "",
"properties": {},
"context": {
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}' | \
http POST {{baseUrl}}/v1/page \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "userId": "",\n "anonymousId": "",\n "name": "",\n "properties": {},\n "context": {\n "ip": "",\n "library": {\n "name": ""\n }\n },\n "timestamp": ""\n}' \
--output-document \
- {{baseUrl}}/v1/page
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"userId": "",
"anonymousId": "",
"name": "",
"properties": [],
"context": [
"ip": "",
"library": ["name": ""]
],
"timestamp": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/page")! 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
text/plain; charset=utf-8
RESPONSE BODY text
OK
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Invalid request
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Invalid Authorization Header
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Source does not accept webhook events
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Request size too large
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Too many requests
POST
Screen
{{baseUrl}}/v1/screen
BODY json
{
"userId": "",
"anonymousId": "",
"name": "",
"properties": {},
"context": {
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/screen");
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 \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/screen" {:content-type :json
:form-params {:userId ""
:anonymousId ""
:name ""
:properties {}
:context {:ip ""
:library {:name ""}}
:timestamp ""}})
require "http/client"
url = "{{baseUrl}}/v1/screen"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/screen"),
Content = new StringContent("{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/screen");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/screen"
payload := strings.NewReader("{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/screen HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 166
{
"userId": "",
"anonymousId": "",
"name": "",
"properties": {},
"context": {
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/screen")
.setHeader("content-type", "application/json")
.setBody("{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/screen"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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 \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/screen")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/screen")
.header("content-type", "application/json")
.body("{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}")
.asString();
const data = JSON.stringify({
userId: '',
anonymousId: '',
name: '',
properties: {},
context: {
ip: '',
library: {
name: ''
}
},
timestamp: ''
});
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/screen');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/screen',
headers: {'content-type': 'application/json'},
data: {
userId: '',
anonymousId: '',
name: '',
properties: {},
context: {ip: '', library: {name: ''}},
timestamp: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/screen';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"userId":"","anonymousId":"","name":"","properties":{},"context":{"ip":"","library":{"name":""}},"timestamp":""}'
};
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/screen',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "userId": "",\n "anonymousId": "",\n "name": "",\n "properties": {},\n "context": {\n "ip": "",\n "library": {\n "name": ""\n }\n },\n "timestamp": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/screen")
.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/screen',
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({
userId: '',
anonymousId: '',
name: '',
properties: {},
context: {ip: '', library: {name: ''}},
timestamp: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/screen',
headers: {'content-type': 'application/json'},
body: {
userId: '',
anonymousId: '',
name: '',
properties: {},
context: {ip: '', library: {name: ''}},
timestamp: ''
},
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/screen');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
userId: '',
anonymousId: '',
name: '',
properties: {},
context: {
ip: '',
library: {
name: ''
}
},
timestamp: ''
});
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/screen',
headers: {'content-type': 'application/json'},
data: {
userId: '',
anonymousId: '',
name: '',
properties: {},
context: {ip: '', library: {name: ''}},
timestamp: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/screen';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"userId":"","anonymousId":"","name":"","properties":{},"context":{"ip":"","library":{"name":""}},"timestamp":""}'
};
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 = @{ @"userId": @"",
@"anonymousId": @"",
@"name": @"",
@"properties": @{ },
@"context": @{ @"ip": @"", @"library": @{ @"name": @"" } },
@"timestamp": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/screen"]
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/screen" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/screen",
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([
'userId' => '',
'anonymousId' => '',
'name' => '',
'properties' => [
],
'context' => [
'ip' => '',
'library' => [
'name' => ''
]
],
'timestamp' => ''
]),
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/screen', [
'body' => '{
"userId": "",
"anonymousId": "",
"name": "",
"properties": {},
"context": {
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/screen');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'userId' => '',
'anonymousId' => '',
'name' => '',
'properties' => [
],
'context' => [
'ip' => '',
'library' => [
'name' => ''
]
],
'timestamp' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'userId' => '',
'anonymousId' => '',
'name' => '',
'properties' => [
],
'context' => [
'ip' => '',
'library' => [
'name' => ''
]
],
'timestamp' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/screen');
$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/screen' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"userId": "",
"anonymousId": "",
"name": "",
"properties": {},
"context": {
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/screen' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"userId": "",
"anonymousId": "",
"name": "",
"properties": {},
"context": {
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/screen", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/screen"
payload = {
"userId": "",
"anonymousId": "",
"name": "",
"properties": {},
"context": {
"ip": "",
"library": { "name": "" }
},
"timestamp": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/screen"
payload <- "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/screen")
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 \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/screen') do |req|
req.body = "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"name\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/screen";
let payload = json!({
"userId": "",
"anonymousId": "",
"name": "",
"properties": json!({}),
"context": json!({
"ip": "",
"library": json!({"name": ""})
}),
"timestamp": ""
});
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/screen \
--header 'content-type: application/json' \
--data '{
"userId": "",
"anonymousId": "",
"name": "",
"properties": {},
"context": {
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}'
echo '{
"userId": "",
"anonymousId": "",
"name": "",
"properties": {},
"context": {
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}' | \
http POST {{baseUrl}}/v1/screen \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "userId": "",\n "anonymousId": "",\n "name": "",\n "properties": {},\n "context": {\n "ip": "",\n "library": {\n "name": ""\n }\n },\n "timestamp": ""\n}' \
--output-document \
- {{baseUrl}}/v1/screen
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"userId": "",
"anonymousId": "",
"name": "",
"properties": [],
"context": [
"ip": "",
"library": ["name": ""]
],
"timestamp": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/screen")! 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
text/plain; charset=utf-8
RESPONSE BODY text
OK
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Invalid request
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Invalid Authorization Header
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Source does not accept webhook events
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Request size too large
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Too many requests
POST
Track
{{baseUrl}}/v1/track
BODY json
{
"userId": "",
"anonymousId": "",
"event": "",
"properties": {},
"context": {
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/track");
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 \"userId\": \"\",\n \"anonymousId\": \"\",\n \"event\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/track" {:content-type :json
:form-params {:userId ""
:anonymousId ""
:event ""
:properties {}
:context {:ip ""
:library {:name ""}}
:timestamp ""}})
require "http/client"
url = "{{baseUrl}}/v1/track"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"event\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/track"),
Content = new StringContent("{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"event\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/track");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"event\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/track"
payload := strings.NewReader("{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"event\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/track HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 167
{
"userId": "",
"anonymousId": "",
"event": "",
"properties": {},
"context": {
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/track")
.setHeader("content-type", "application/json")
.setBody("{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"event\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/track"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"event\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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 \"userId\": \"\",\n \"anonymousId\": \"\",\n \"event\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/track")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/track")
.header("content-type", "application/json")
.body("{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"event\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}")
.asString();
const data = JSON.stringify({
userId: '',
anonymousId: '',
event: '',
properties: {},
context: {
ip: '',
library: {
name: ''
}
},
timestamp: ''
});
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/track');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/track',
headers: {'content-type': 'application/json'},
data: {
userId: '',
anonymousId: '',
event: '',
properties: {},
context: {ip: '', library: {name: ''}},
timestamp: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/track';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"userId":"","anonymousId":"","event":"","properties":{},"context":{"ip":"","library":{"name":""}},"timestamp":""}'
};
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/track',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "userId": "",\n "anonymousId": "",\n "event": "",\n "properties": {},\n "context": {\n "ip": "",\n "library": {\n "name": ""\n }\n },\n "timestamp": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"event\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/track")
.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/track',
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({
userId: '',
anonymousId: '',
event: '',
properties: {},
context: {ip: '', library: {name: ''}},
timestamp: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/track',
headers: {'content-type': 'application/json'},
body: {
userId: '',
anonymousId: '',
event: '',
properties: {},
context: {ip: '', library: {name: ''}},
timestamp: ''
},
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/track');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
userId: '',
anonymousId: '',
event: '',
properties: {},
context: {
ip: '',
library: {
name: ''
}
},
timestamp: ''
});
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/track',
headers: {'content-type': 'application/json'},
data: {
userId: '',
anonymousId: '',
event: '',
properties: {},
context: {ip: '', library: {name: ''}},
timestamp: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/track';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"userId":"","anonymousId":"","event":"","properties":{},"context":{"ip":"","library":{"name":""}},"timestamp":""}'
};
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 = @{ @"userId": @"",
@"anonymousId": @"",
@"event": @"",
@"properties": @{ },
@"context": @{ @"ip": @"", @"library": @{ @"name": @"" } },
@"timestamp": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/track"]
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/track" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"event\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/track",
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([
'userId' => '',
'anonymousId' => '',
'event' => '',
'properties' => [
],
'context' => [
'ip' => '',
'library' => [
'name' => ''
]
],
'timestamp' => ''
]),
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/track', [
'body' => '{
"userId": "",
"anonymousId": "",
"event": "",
"properties": {},
"context": {
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/track');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'userId' => '',
'anonymousId' => '',
'event' => '',
'properties' => [
],
'context' => [
'ip' => '',
'library' => [
'name' => ''
]
],
'timestamp' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'userId' => '',
'anonymousId' => '',
'event' => '',
'properties' => [
],
'context' => [
'ip' => '',
'library' => [
'name' => ''
]
],
'timestamp' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/track');
$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/track' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"userId": "",
"anonymousId": "",
"event": "",
"properties": {},
"context": {
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/track' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"userId": "",
"anonymousId": "",
"event": "",
"properties": {},
"context": {
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"event\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/track", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/track"
payload = {
"userId": "",
"anonymousId": "",
"event": "",
"properties": {},
"context": {
"ip": "",
"library": { "name": "" }
},
"timestamp": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/track"
payload <- "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"event\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/track")
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 \"userId\": \"\",\n \"anonymousId\": \"\",\n \"event\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\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/track') do |req|
req.body = "{\n \"userId\": \"\",\n \"anonymousId\": \"\",\n \"event\": \"\",\n \"properties\": {},\n \"context\": {\n \"ip\": \"\",\n \"library\": {\n \"name\": \"\"\n }\n },\n \"timestamp\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/track";
let payload = json!({
"userId": "",
"anonymousId": "",
"event": "",
"properties": json!({}),
"context": json!({
"ip": "",
"library": json!({"name": ""})
}),
"timestamp": ""
});
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/track \
--header 'content-type: application/json' \
--data '{
"userId": "",
"anonymousId": "",
"event": "",
"properties": {},
"context": {
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}'
echo '{
"userId": "",
"anonymousId": "",
"event": "",
"properties": {},
"context": {
"ip": "",
"library": {
"name": ""
}
},
"timestamp": ""
}' | \
http POST {{baseUrl}}/v1/track \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "userId": "",\n "anonymousId": "",\n "event": "",\n "properties": {},\n "context": {\n "ip": "",\n "library": {\n "name": ""\n }\n },\n "timestamp": ""\n}' \
--output-document \
- {{baseUrl}}/v1/track
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"userId": "",
"anonymousId": "",
"event": "",
"properties": [],
"context": [
"ip": "",
"library": ["name": ""]
],
"timestamp": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/track")! 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
text/plain; charset=utf-8
RESPONSE BODY text
OK
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Invalid request
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Invalid Authorization Header
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Source does not accept webhook events
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Request size too large
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Too many requests
POST
Audience List
{{baseUrl}}/internal/v1/audiencelist
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/internal/v1/audiencelist");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/internal/v1/audiencelist")
require "http/client"
url = "{{baseUrl}}/internal/v1/audiencelist"
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}}/internal/v1/audiencelist"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/internal/v1/audiencelist");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/internal/v1/audiencelist"
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/internal/v1/audiencelist HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/internal/v1/audiencelist")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/internal/v1/audiencelist"))
.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}}/internal/v1/audiencelist")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/internal/v1/audiencelist")
.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}}/internal/v1/audiencelist');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/internal/v1/audiencelist'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/internal/v1/audiencelist';
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}}/internal/v1/audiencelist',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/internal/v1/audiencelist")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/internal/v1/audiencelist',
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}}/internal/v1/audiencelist'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/internal/v1/audiencelist');
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}}/internal/v1/audiencelist'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/internal/v1/audiencelist';
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}}/internal/v1/audiencelist"]
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}}/internal/v1/audiencelist" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/internal/v1/audiencelist",
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}}/internal/v1/audiencelist');
echo $response->getBody();
setUrl('{{baseUrl}}/internal/v1/audiencelist');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/internal/v1/audiencelist');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/internal/v1/audiencelist' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/internal/v1/audiencelist' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/internal/v1/audiencelist")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/internal/v1/audiencelist"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/internal/v1/audiencelist"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/internal/v1/audiencelist")
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/internal/v1/audiencelist') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/internal/v1/audiencelist";
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}}/internal/v1/audiencelist
http POST {{baseUrl}}/internal/v1/audiencelist
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/internal/v1/audiencelist
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/internal/v1/audiencelist")! 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()
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
OK
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Invalid request
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Invalid Authorization Header
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Source does not accept webhook events
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Request size too large
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Too many requests
POST
Batch (POST)
{{baseUrl}}/internal/v1/batch
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/internal/v1/batch");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/internal/v1/batch")
require "http/client"
url = "{{baseUrl}}/internal/v1/batch"
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}}/internal/v1/batch"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/internal/v1/batch");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/internal/v1/batch"
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/internal/v1/batch HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/internal/v1/batch")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/internal/v1/batch"))
.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}}/internal/v1/batch")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/internal/v1/batch")
.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}}/internal/v1/batch');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/internal/v1/batch'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/internal/v1/batch';
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}}/internal/v1/batch',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/internal/v1/batch")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/internal/v1/batch',
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}}/internal/v1/batch'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/internal/v1/batch');
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}}/internal/v1/batch'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/internal/v1/batch';
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}}/internal/v1/batch"]
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}}/internal/v1/batch" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/internal/v1/batch",
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}}/internal/v1/batch');
echo $response->getBody();
setUrl('{{baseUrl}}/internal/v1/batch');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/internal/v1/batch');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/internal/v1/batch' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/internal/v1/batch' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/internal/v1/batch")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/internal/v1/batch"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/internal/v1/batch"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/internal/v1/batch")
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/internal/v1/batch') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/internal/v1/batch";
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}}/internal/v1/batch
http POST {{baseUrl}}/internal/v1/batch
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/internal/v1/batch
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/internal/v1/batch")! 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()
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
OK
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Invalid request
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Invalid Authorization Header
POST
Extract
{{baseUrl}}/internal/v1/extract
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/internal/v1/extract");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/internal/v1/extract")
require "http/client"
url = "{{baseUrl}}/internal/v1/extract"
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}}/internal/v1/extract"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/internal/v1/extract");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/internal/v1/extract"
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/internal/v1/extract HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/internal/v1/extract")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/internal/v1/extract"))
.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}}/internal/v1/extract")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/internal/v1/extract")
.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}}/internal/v1/extract');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/internal/v1/extract'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/internal/v1/extract';
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}}/internal/v1/extract',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/internal/v1/extract")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/internal/v1/extract',
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}}/internal/v1/extract'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/internal/v1/extract');
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}}/internal/v1/extract'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/internal/v1/extract';
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}}/internal/v1/extract"]
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}}/internal/v1/extract" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/internal/v1/extract",
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}}/internal/v1/extract');
echo $response->getBody();
setUrl('{{baseUrl}}/internal/v1/extract');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/internal/v1/extract');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/internal/v1/extract' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/internal/v1/extract' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/internal/v1/extract")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/internal/v1/extract"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/internal/v1/extract"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/internal/v1/extract")
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/internal/v1/extract') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/internal/v1/extract";
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}}/internal/v1/extract
http POST {{baseUrl}}/internal/v1/extract
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/internal/v1/extract
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/internal/v1/extract")! 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()
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
OK
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Invalid request
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Invalid Authorization Header
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Source does not accept webhook events
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Request size too large
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Too many requests
POST
Replay
{{baseUrl}}/internal/v1/replay
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/internal/v1/replay");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/internal/v1/replay")
require "http/client"
url = "{{baseUrl}}/internal/v1/replay"
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}}/internal/v1/replay"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/internal/v1/replay");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/internal/v1/replay"
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/internal/v1/replay HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/internal/v1/replay")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/internal/v1/replay"))
.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}}/internal/v1/replay")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/internal/v1/replay")
.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}}/internal/v1/replay');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/internal/v1/replay'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/internal/v1/replay';
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}}/internal/v1/replay',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/internal/v1/replay")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/internal/v1/replay',
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}}/internal/v1/replay'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/internal/v1/replay');
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}}/internal/v1/replay'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/internal/v1/replay';
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}}/internal/v1/replay"]
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}}/internal/v1/replay" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/internal/v1/replay",
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}}/internal/v1/replay');
echo $response->getBody();
setUrl('{{baseUrl}}/internal/v1/replay');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/internal/v1/replay');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/internal/v1/replay' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/internal/v1/replay' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/internal/v1/replay")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/internal/v1/replay"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/internal/v1/replay"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/internal/v1/replay")
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/internal/v1/replay') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/internal/v1/replay";
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}}/internal/v1/replay
http POST {{baseUrl}}/internal/v1/replay
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/internal/v1/replay
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/internal/v1/replay")! 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()
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
OK
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Invalid request
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Invalid Authorization Header
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Source does not accept webhook events
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Request size too large
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Too many requests
POST
Retl
{{baseUrl}}/internal/v1/retl
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/internal/v1/retl");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/internal/v1/retl")
require "http/client"
url = "{{baseUrl}}/internal/v1/retl"
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}}/internal/v1/retl"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/internal/v1/retl");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/internal/v1/retl"
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/internal/v1/retl HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/internal/v1/retl")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/internal/v1/retl"))
.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}}/internal/v1/retl")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/internal/v1/retl")
.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}}/internal/v1/retl');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/internal/v1/retl'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/internal/v1/retl';
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}}/internal/v1/retl',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/internal/v1/retl")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/internal/v1/retl',
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}}/internal/v1/retl'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/internal/v1/retl');
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}}/internal/v1/retl'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/internal/v1/retl';
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}}/internal/v1/retl"]
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}}/internal/v1/retl" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/internal/v1/retl",
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}}/internal/v1/retl');
echo $response->getBody();
setUrl('{{baseUrl}}/internal/v1/retl');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/internal/v1/retl');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/internal/v1/retl' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/internal/v1/retl' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/internal/v1/retl")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/internal/v1/retl"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/internal/v1/retl"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/internal/v1/retl")
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/internal/v1/retl') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/internal/v1/retl";
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}}/internal/v1/retl
http POST {{baseUrl}}/internal/v1/retl
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/internal/v1/retl
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/internal/v1/retl")! 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()
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
OK
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Invalid request
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Invalid Authorization Header
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Source does not accept webhook events
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Request size too large
RESPONSE HEADERS
Content-Type
text/plain; charset=utf-8
RESPONSE BODY text
Too many requests