Skip to content

Publish Event

Public your first Event

Congratulations on taking the first step to leverage the capabilities of Palzin Track! By publishing your initial event, you unlock the potential to gain valuable insights into your application's performance. This guide will walk you through the process of publishing your event using Palzin Track.

Making a POST Request

To publish your event to Palzin Track, you'll be utilizing HTTP POST requests to the designated log endpoint. Here's how to get started:

TIP

The project and channel values should be lowercase! Alphabet characters, digits, and dashes "-" are accepted. Validation Regex: ^[a-z0-9]+(?:-[a-z0-9]+)*$

POST https://api.palzin.live/v1/log

Publish Event

To publish an event on Palzin Track, make use of the designated API route. Craft your request following the guidelines below:

Parameters:

Header

Content-TypeHeaderapplication/json
AuthorizationHeaderYour Authorization Token

Body

project*StringProject name
channel*StringChannel name
event*StringEvent name
user_idStringUser ID
descriptionStringEvent description
iconEmojiSingle emoji as the event icon
notifyBooleanSend push notification
tagskey/valueEvent tags
parserString"markdown" or "text"
timestampNumberunix timestamp (seconds)
Responses (200: OK)
js
{
   // Response   
}
{
   // Response   
}

TIP

Important: Fields ending with an (*) are required in your request!

Historical Data

To include historical logs in your Palzin Track, simply append a timestamp parameter to your log entries. The timestamp should be provided as a Unix timestamp in seconds. Keep in mind that when you add historical logs, you won't receive push notifications for them.

Code Snippet for Javascript

javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer YOUR_API_TOKEN");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
   "project": "my-product",
   "channel": "waitlist",
   "event": "Waitlist Member",
   "description": "email: [email protected]",
   "icon": "🔥",
   "notify": true
});

var requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body: raw,
   redirect: 'follow'
};

fetch("https://api.palzin.live/v1/log", requestOptions)
        .then(response => response.text())
        .then(result => console.log(result))
        .catch(error => console.log('error', error));
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer YOUR_API_TOKEN");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
   "project": "my-product",
   "channel": "waitlist",
   "event": "Waitlist Member",
   "description": "email: [email protected]",
   "icon": "🔥",
   "notify": true
});

var requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body: raw,
   redirect: 'follow'
};

fetch("https://api.palzin.live/v1/log", requestOptions)
        .then(response => response.text())
        .then(result => console.log(result))
        .catch(error => console.log('error', error));
jquery
var settings = {
  "url": "https://api.palzin.live/v1/log",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_API_TOKEN"
  },
  "data": JSON.stringify({
   "project": "my-product",
   "channel": "waitlist",
   "event": "Waitlist Member",
   "description": "email: [email protected]",
   "icon": "🔥",
   "notify": true
  }),
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var settings = {
  "url": "https://api.palzin.live/v1/log",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_API_TOKEN"
  },
  "data": JSON.stringify({
   "project": "my-product",
   "channel": "waitlist",
   "event": "Waitlist Member",
   "description": "email: [email protected]",
   "icon": "🔥",
   "notify": true
  }),
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
javascript
// WARNING: For POST requests, body is set to null by browsers.
var data = JSON.stringify({
    "project": "my-product",
    "channel": "waitlist",
    "event": "Waitlist Member",
    "description": "email: [email protected]",
    "icon": "🔥",
    "notify": true
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function() {
    if(this.readyState === 4) {
        console.log(this.responseText);
    }
});

xhr.open("POST", "https://api.palzin.live/v1/log");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Authorization", "Bearer YOUR_API_TOKEN");

xhr.send(data);
// WARNING: For POST requests, body is set to null by browsers.
var data = JSON.stringify({
    "project": "my-product",
    "channel": "waitlist",
    "event": "Waitlist Member",
    "description": "email: [email protected]",
    "icon": "🔥",
    "notify": true
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function() {
    if(this.readyState === 4) {
        console.log(this.responseText);
    }
});

xhr.open("POST", "https://api.palzin.live/v1/log");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Authorization", "Bearer YOUR_API_TOKEN");

xhr.send(data);

Code Snippet for NodeJs

javascript
const axios = require('axios');
let data = JSON.stringify({
    "project": "my-product",
    "channel": "waitlist",
    "event": "Waitlist Member",
    "description": "email: [email protected]",
    "icon": "🔥",
    "notify": true
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.palzin.live/v1/log',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': 'Bearer YOUR_API_TOKEN'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
const axios = require('axios');
let data = JSON.stringify({
    "project": "my-product",
    "channel": "waitlist",
    "event": "Waitlist Member",
    "description": "email: [email protected]",
    "icon": "🔥",
    "notify": true
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.palzin.live/v1/log',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': 'Bearer YOUR_API_TOKEN'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
javascript
var unirest = require('unirest');
var req = unirest('POST', 'https://api.palzin.live/v1/log')
  .headers({
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_API_TOKEN'
  })
  .send(JSON.stringify({
      "project": "my-product",
      "channel": "waitlist",
      "event": "Waitlist Member",
      "description": "email: [email protected]",
      "icon": "🔥",
      "notify": true
  }))
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });
var unirest = require('unirest');
var req = unirest('POST', 'https://api.palzin.live/v1/log')
  .headers({
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_API_TOKEN'
  })
  .send(JSON.stringify({
      "project": "my-product",
      "channel": "waitlist",
      "event": "Waitlist Member",
      "description": "email: [email protected]",
      "icon": "🔥",
      "notify": true
  }))
  .end(function (res) { 
    if (res.error) throw new Error(res.error); 
    console.log(res.raw_body);
  });
javascript
var https = require('follow-redirects').https;
var fs = require('fs');

var options = {
   'method': 'POST',
   'hostname': 'palzin.live',
   'path': '/api/v1/log',
   'headers': {
      'Authorization': 'Bearer YOUR_API_TOKEN',
      'Content-Type': 'application/json'
   },
   'maxRedirects': 20
};

var req = https.request(options, function (res) {
   var chunks = [];

   res.on("data", function (chunk) {
      chunks.push(chunk);
   });

   res.on("end", function (chunk) {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
   });

   res.on("error", function (error) {
      console.error(error);
   });
});

var postData = JSON.stringify({
   "project": "my-product",
   "channel": "waitlist",
   "event": "Waitlist Member",
   "description": "email: [email protected]",
   "icon": "🔥",
   "notify": true
});

req.write(postData);

req.end();
var https = require('follow-redirects').https;
var fs = require('fs');

var options = {
   'method': 'POST',
   'hostname': 'palzin.live',
   'path': '/api/v1/log',
   'headers': {
      'Authorization': 'Bearer YOUR_API_TOKEN',
      'Content-Type': 'application/json'
   },
   'maxRedirects': 20
};

var req = https.request(options, function (res) {
   var chunks = [];

   res.on("data", function (chunk) {
      chunks.push(chunk);
   });

   res.on("end", function (chunk) {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
   });

   res.on("error", function (error) {
      console.error(error);
   });
});

var postData = JSON.stringify({
   "project": "my-product",
   "channel": "waitlist",
   "event": "Waitlist Member",
   "description": "email: [email protected]",
   "icon": "🔥",
   "notify": true
});

req.write(postData);

req.end();

Code Snippet for PHP

php
<?php
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://api.palzin.live/v1/log',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS =>'{
    "project": "my-product",
    "channel": "waitlist",
    "event": "Waitlist Member",
    "description": "email: [email protected]",
    "icon": "🔥",
    "notify": true
}',
    CURLOPT_HTTPHEADER => array(
        'Authorization: Bearer YOUR_API_TOKEN',
        'Content-Type: application/json'
    ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
<?php
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://api.palzin.live/v1/log',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS =>'{
    "project": "my-product",
    "channel": "waitlist",
    "event": "Waitlist Member",
    "description": "email: [email protected]",
    "icon": "🔥",
    "notify": true
}',
    CURLOPT_HTTPHEADER => array(
        'Authorization: Bearer YOUR_API_TOKEN',
        'Content-Type: application/json'
    ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
php
<?php
$client = new Client();
$headers = [
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer YOUR_API_TOKEN'
];
$body = '{
    "project": "my-product",
    "channel": "waitlist",
    "event": "Waitlist Member",
    "description": "email: [email protected]",
    "icon": "🔥",
    "notify": true
}';
$request = new Request('POST', 'https://api.palzin.live/v1/log', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
<?php
$client = new Client();
$headers = [
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer YOUR_API_TOKEN'
];
$body = '{
    "project": "my-product",
    "channel": "waitlist",
    "event": "Waitlist Member",
    "description": "email: [email protected]",
    "icon": "🔥",
    "notify": true
}';
$request = new Request('POST', 'https://api.palzin.live/v1/log', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

Code Snippet for Python

python
import http.client
import json

conn = http.client.HTTPSConnection("palzin.live")
payload = json.dumps({
  "project": "my-product",
  "channel": "waitlist",
  "event": "Waitlist Member",
  "description": "email: [email protected]",
  "icon": "🔥",
  "tags": {
        "email": "[email protected]",
        "uid": "uid1234"
  },
  "notify": True
})
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN',
  'Content-Type': 'application/json'
}
conn.request("POST", "/api/v1/log", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import http.client
import json

conn = http.client.HTTPSConnection("palzin.live")
payload = json.dumps({
  "project": "my-product",
  "channel": "waitlist",
  "event": "Waitlist Member",
  "description": "email: [email protected]",
  "icon": "🔥",
  "tags": {
        "email": "[email protected]",
        "uid": "uid1234"
  },
  "notify": True
})
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN',
  'Content-Type': 'application/json'
}
conn.request("POST", "/api/v1/log", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Code Snippet for C#

c#
var client = new RestClient("https://api.palzin.live/v1/log");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer YOUR_API_TOKEN");
var body = @"{""project"":""my-project"",""channel"":""waitlist"",""event"":""Waitlist Member"",""description"":""email: [email protected]"",""icon"":""🔥"",""notify"":false}";
request.AddParameter("application/json", body,  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
var client = new RestClient("https://api.palzin.live/v1/log");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer YOUR_API_TOKEN");
var body = @"{""project"":""my-project"",""channel"":""waitlist"",""event"":""Waitlist Member"",""description"":""email: [email protected]"",""icon"":""🔥"",""notify"":false}";
request.AddParameter("application/json", body,  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

Code Snippet for Dart

dart
var headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer YOUR_API_TOKEN'
};
var request = http.Request('POST', Uri.parse('https://api.palzin.live/v1/log'));
request.body = json.encode({
  "project": "my-project",
  "channel": "waitlist",
  "event": "Waitlist Member",
  "description": "email: [email protected]",
  "icon": "🔥",
  "notify": false
});
request.headers.addAll(headers);

http.StreamedResponse response = await request.send();

if (response.statusCode == 200) {
  print(await response.stream.bytesToString());
}
else {
  print(response.reasonPhrase);
}
var headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer YOUR_API_TOKEN'
};
var request = http.Request('POST', Uri.parse('https://api.palzin.live/v1/log'));
request.body = json.encode({
  "project": "my-project",
  "channel": "waitlist",
  "event": "Waitlist Member",
  "description": "email: [email protected]",
  "icon": "🔥",
  "notify": false
});
request.headers.addAll(headers);

http.StreamedResponse response = await request.send();

if (response.statusCode == 200) {
  print(await response.stream.bytesToString());
}
else {
  print(response.reasonPhrase);
}

Code Snippet for Go

go
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.palzin.live/v1/log"
  method := "POST"

  payload := strings.NewReader(`{"project":"my-project","channel":"waitlist","event":"Waitlist Member","description":"email: [email protected]","icon":"🔥","notify":false}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("Authorization", "Bearer YOUR_API_TOKEN")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.palzin.live/v1/log"
  method := "POST"

  payload := strings.NewReader(`{"project":"my-project","channel":"waitlist","event":"Waitlist Member","description":"email: [email protected]","icon":"🔥","notify":false}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("Authorization", "Bearer YOUR_API_TOKEN")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}

Code Snippet for Java

java
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"project\":\"my-project\",\"channel\":\"waitlist\",\"event\":\"Waitlist Member\",\"description\":\"email: [email protected]\\",\"icon\":\"🔥\",\"notify\":false}");
Request request = new Request.Builder()
  .url("https://api.palzin.live/v1/log")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer YOUR_API_TOKEN")
  .build();
Response response = client.newCall(request).execute();
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"project\":\"my-project\",\"channel\":\"waitlist\",\"event\":\"Waitlist Member\",\"description\":\"email: [email protected]\\",\"icon\":\"🔥\",\"notify\":false}");
Request request = new Request.Builder()
  .url("https://api.palzin.live/v1/log")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer YOUR_API_TOKEN")
  .build();
Response response = client.newCall(request).execute();
java
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.palzin.live/v1/log")
  .header("Content-Type", "application/json")
  .header("Authorization", "Bearer YOUR_API_TOKEN")
  .body("{\"project\":\"my-project\",\"channel\":\"waitlist\",\"event\":\"Waitlist Member\",\"description\":\"email: [email protected]\\",\"icon\":\"🔥\",\"notify\":false}")
  .asString();
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.palzin.live/v1/log")
  .header("Content-Type", "application/json")
  .header("Authorization", "Bearer YOUR_API_TOKEN")
  .body("{\"project\":\"my-project\",\"channel\":\"waitlist\",\"event\":\"Waitlist Member\",\"description\":\"email: [email protected]\\",\"icon\":\"🔥\",\"notify\":false}")
  .asString();

Code Snippet for C

c
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
  curl_easy_setopt(curl, CURLOPT_URL, "https://api.palzin.live/v1/log");
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
  curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
  struct curl_slist *headers = NULL;
  headers = curl_slist_append(headers, "Content-Type: application/json");
  headers = curl_slist_append(headers, "Authorization: Bearer YOUR_API_TOKEN");
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
  const char *data = "{\"project\":\"my-project\",\"channel\":\"waitlist\",\"event\":\"Waitlist Member\",\"description\":\"email: [email protected]\\",\"icon\":\"🔥\",\"notify\":false}";
  curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
  res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
  curl_easy_setopt(curl, CURLOPT_URL, "https://api.palzin.live/v1/log");
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
  curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
  struct curl_slist *headers = NULL;
  headers = curl_slist_append(headers, "Content-Type: application/json");
  headers = curl_slist_append(headers, "Authorization: Bearer YOUR_API_TOKEN");
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
  const char *data = "{\"project\":\"my-project\",\"channel\":\"waitlist\",\"event\":\"Waitlist Member\",\"description\":\"email: [email protected]\\",\"icon\":\"🔥\",\"notify\":false}";
  curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
  res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);

Code Snippet for Objective-C

objective-c
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.palzin.live/v1/log"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Content-Type": @"application/json",
  @"Authorization": @"Bearer YOUR_API_TOKEN"
};

[request setAllHTTPHeaderFields:headers];
NSData *postData = [[NSData alloc] initWithData:[@"{\"project\":\"my-project\",\"channel\":\"waitlist\",\"event\":\"Waitlist Member\",\"description\":\"email: [email protected]\\",\"icon\":\"🔥\",\"notify\":false}" dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.palzin.live/v1/log"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Content-Type": @"application/json",
  @"Authorization": @"Bearer YOUR_API_TOKEN"
};

[request setAllHTTPHeaderFields:headers];
NSData *postData = [[NSData alloc] initWithData:[@"{\"project\":\"my-project\",\"channel\":\"waitlist\",\"event\":\"Waitlist Member\",\"description\":\"email: [email protected]\\",\"icon\":\"🔥\",\"notify\":false}" dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);

Code Snippet for OCaml

ocaml
open Lwt
open Cohttp
open Cohttp_lwt_unix

let postData = ref "{\"project\":\"my-project\",\"channel\":\"waitlist\",\"event\":\"Waitlist Member\",\"description\":\"email: [email protected]\\",\"icon\":\"🔥\",\"notify\":false}";;

let reqBody = 
  let uri = Uri.of_string "https://api.palzin.live/v1/log" in
  let headers = Header.init ()
    |> fun h -> Header.add h "Content-Type" "application/json"
    |> fun h -> Header.add h "Authorization" "Bearer YOUR_API_TOKEN"
  in
  let body = Cohttp_lwt.Body.of_string !postData in

  Client.call ~headers ~body `POST uri >>= fun (_resp, body) ->
  body |> Cohttp_lwt.Body.to_string >|= fun body -> body

let () =
  let respBody = Lwt_main.run reqBody in
  print_endline (respBody)
open Lwt
open Cohttp
open Cohttp_lwt_unix

let postData = ref "{\"project\":\"my-project\",\"channel\":\"waitlist\",\"event\":\"Waitlist Member\",\"description\":\"email: [email protected]\\",\"icon\":\"🔥\",\"notify\":false}";;

let reqBody = 
  let uri = Uri.of_string "https://api.palzin.live/v1/log" in
  let headers = Header.init ()
    |> fun h -> Header.add h "Content-Type" "application/json"
    |> fun h -> Header.add h "Authorization" "Bearer YOUR_API_TOKEN"
  in
  let body = Cohttp_lwt.Body.of_string !postData in

  Client.call ~headers ~body `POST uri >>= fun (_resp, body) ->
  body |> Cohttp_lwt.Body.to_string >|= fun body -> body

let () =
  let respBody = Lwt_main.run reqBody in
  print_endline (respBody)

Code Snippet for PowerShell

powershell
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/json")
$headers.Add("Authorization", "Bearer YOUR_API_TOKEN")

$body = "{`"project`":`"my-project`",`"channel`":`"waitlist`",`"event`":`"Waitlist Member`",`"description`":`"email: [email protected]``",`"icon`":`"🔥`",`"notify`":false}"

$response = Invoke-RestMethod 'https://api.palzin.live/v1/log' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/json")
$headers.Add("Authorization", "Bearer YOUR_API_TOKEN")

$body = "{`"project`":`"my-project`",`"channel`":`"waitlist`",`"event`":`"Waitlist Member`",`"description`":`"email: [email protected]``",`"icon`":`"🔥`",`"notify`":false}"

$response = Invoke-RestMethod 'https://api.palzin.live/v1/log' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json

Code Snippet for R

r
library(httr)

headers = c(
  'Content-Type' = 'application/json',
  'Authorization' = 'Bearer YOUR_API_TOKEN'
)

body = '{
  "project": "my-project",
  "channel": "waitlist",
  "event": "Waitlist Member",
  "description": "email: [email protected]",
  "icon": "🔥",
  "notify": false
}';

res <- VERB("POST", url = "https://api.palzin.live/v1/log", body = body, add_headers(headers))

cat(content(res, 'text'))
library(httr)

headers = c(
  'Content-Type' = 'application/json',
  'Authorization' = 'Bearer YOUR_API_TOKEN'
)

body = '{
  "project": "my-project",
  "channel": "waitlist",
  "event": "Waitlist Member",
  "description": "email: [email protected]",
  "icon": "🔥",
  "notify": false
}';

res <- VERB("POST", url = "https://api.palzin.live/v1/log", body = body, add_headers(headers))

cat(content(res, 'text'))
r
library(RCurl)
headers = c(
  "Content-Type" = "application/json",
  "Authorization" = "Bearer YOUR_API_TOKEN"
)
params = "{
  \"project\": \"my-project\",
  \"channel\": \"waitlist\",
  \"event\": \"Waitlist Member\",
  \"description\": \"email: [email protected]\\",
  \"icon\": \"🔥\",
  \"notify\": false
}"
res <- postForm("https://api.palzin.live/v1/log", .opts=list(postfields = params, httpheader = headers, followlocation = TRUE), style = "httppost")
cat(res)
library(RCurl)
headers = c(
  "Content-Type" = "application/json",
  "Authorization" = "Bearer YOUR_API_TOKEN"
)
params = "{
  \"project\": \"my-project\",
  \"channel\": \"waitlist\",
  \"event\": \"Waitlist Member\",
  \"description\": \"email: [email protected]\\",
  \"icon\": \"🔥\",
  \"notify\": false
}"
res <- postForm("https://api.palzin.live/v1/log", .opts=list(postfields = params, httpheader = headers, followlocation = TRUE), style = "httppost")
cat(res)

Code Snippet for Ruby

ruby
require "uri"
require "json"
require "net/http"

url = URI("https://api.palzin.live/v1/log")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer YOUR_API_TOKEN"
request.body = JSON.dump({
  "project": "my-project",
  "channel": "waitlist",
  "event": "Waitlist Member",
  "description": "email: [email protected]",
  "icon": "🔥",
  "notify": false
})

response = https.request(request)
puts response.read_body
require "uri"
require "json"
require "net/http"

url = URI("https://api.palzin.live/v1/log")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer YOUR_API_TOKEN"
request.body = JSON.dump({
  "project": "my-project",
  "channel": "waitlist",
  "event": "Waitlist Member",
  "description": "email: [email protected]",
  "icon": "🔥",
  "notify": false
})

response = https.request(request)
puts response.read_body

Code Snippet for Shell

shell
printf '{"project":"my-project","channel":"waitlist","event":"Waitlist Member","description":"email: [email protected]\","icon":"🔥","notify":false}'| http  --follow --timeout 3600 POST 'https://api.palzin.live/v1/log' \
 Content-Type:'application/json' \
 Authorization:'Bearer YOUR_API_TOKEN'
printf '{"project":"my-project","channel":"waitlist","event":"Waitlist Member","description":"email: [email protected]\","icon":"🔥","notify":false}'| http  --follow --timeout 3600 POST 'https://api.palzin.live/v1/log' \
 Content-Type:'application/json' \
 Authorization:'Bearer YOUR_API_TOKEN'
shell
curl --location --request POST 'https://api.palzin.live/v1/log' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "project": "my-website",
    "channel": "user-register",
    "event": "User Registered",
    "description": "email: [email protected]",
    "icon": "🔥",
    "notify": true,
    "tags": {
        "email": "[email protected]",
        "uid": "uid1234"
    }
}'
curl --location --request POST 'https://api.palzin.live/v1/log' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "project": "my-website",
    "channel": "user-register",
    "event": "User Registered",
    "description": "email: [email protected]",
    "icon": "🔥",
    "notify": true,
    "tags": {
        "email": "[email protected]",
        "uid": "uid1234"
    }
}'
shell
wget --no-check-certificate --quiet \
  --method POST \
  --timeout=0 \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_API_TOKEN' \
  --body-data '{"project":"my-project","channel":"waitlist","event":"Waitlist Member","description":"email: [email protected]","icon":"🔥","notify":false}' \
   'https://api.palzin.live/v1/log'
wget --no-check-certificate --quiet \
  --method POST \
  --timeout=0 \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_API_TOKEN' \
  --body-data '{"project":"my-project","channel":"waitlist","event":"Waitlist Member","description":"email: [email protected]","icon":"🔥","notify":false}' \
   'https://api.palzin.live/v1/log'

Code Snippet for Swift

swift
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

var semaphore = DispatchSemaphore (value: 0)

let parameters = "{\"project\":\"my-project\",\"channel\":\"waitlist\",\"event\":\"Waitlist Member\",\"description\":\"email: [email protected]\\",\"icon\":\"🔥\",\"notify\":false}"
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://api.palzin.live/v1/log")!,timeoutInterval: Double.infinity)
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
request.addValue("Bearer YOUR_API_TOKEN", forHTTPHeaderField: "Authorization")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    semaphore.signal()
    return
  }
  print(String(data: data, encoding: .utf8)!)
  semaphore.signal()
}

task.resume()
semaphore.wait()
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

var semaphore = DispatchSemaphore (value: 0)

let parameters = "{\"project\":\"my-project\",\"channel\":\"waitlist\",\"event\":\"Waitlist Member\",\"description\":\"email: [email protected]\\",\"icon\":\"🔥\",\"notify\":false}"
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://api.palzin.live/v1/log")!,timeoutInterval: Double.infinity)
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
request.addValue("Bearer YOUR_API_TOKEN", forHTTPHeaderField: "Authorization")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    semaphore.signal()
    return
  }
  print(String(data: data, encoding: .utf8)!)
  semaphore.signal()
}

task.resume()
semaphore.wait()