Game event intake
curl --request POST \
--url https://api.erlcrussia.com/v3/webhooks \
--header 'Content-Type: application/json' \
--header 'x-signature-ed25519: <api-key>' \
--header 'x-signature-timestamp: <api-key>' \
--data '
{
"server": "12345678",
"events": [
{
"event": "CustomCommand",
"timestamp": 1792083600,
"origin": "12345678",
"data": {
"command": ";help",
"player": "Builderman"
}
}
]
}
'import requests
url = "https://api.erlcrussia.com/v3/webhooks"
payload = {
"server": "12345678",
"events": [
{
"event": "CustomCommand",
"timestamp": 1792083600,
"origin": "12345678",
"data": {
"command": ";help",
"player": "Builderman"
}
}
]
}
headers = {
"x-signature-timestamp": "<api-key>",
"x-signature-ed25519": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-signature-timestamp': '<api-key>',
'x-signature-ed25519': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
server: '12345678',
events: [
{
event: 'CustomCommand',
timestamp: 1792083600,
origin: '12345678',
data: {command: ';help', player: 'Builderman'}
}
]
})
};
fetch('https://api.erlcrussia.com/v3/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.erlcrussia.com/v3/webhooks",
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([
'server' => '12345678',
'events' => [
[
'event' => 'CustomCommand',
'timestamp' => 1792083600,
'origin' => '12345678',
'data' => [
'command' => ';help',
'player' => 'Builderman'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-signature-ed25519: <api-key>",
"x-signature-timestamp: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.erlcrussia.com/v3/webhooks"
payload := strings.NewReader("{\n \"server\": \"12345678\",\n \"events\": [\n {\n \"event\": \"CustomCommand\",\n \"timestamp\": 1792083600,\n \"origin\": \"12345678\",\n \"data\": {\n \"command\": \";help\",\n \"player\": \"Builderman\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-signature-timestamp", "<api-key>")
req.Header.Add("x-signature-ed25519", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.erlcrussia.com/v3/webhooks")
.header("x-signature-timestamp", "<api-key>")
.header("x-signature-ed25519", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"server\": \"12345678\",\n \"events\": [\n {\n \"event\": \"CustomCommand\",\n \"timestamp\": 1792083600,\n \"origin\": \"12345678\",\n \"data\": {\n \"command\": \";help\",\n \"player\": \"Builderman\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.erlcrussia.com/v3/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-signature-timestamp"] = '<api-key>'
request["x-signature-ed25519"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"server\": \"12345678\",\n \"events\": [\n {\n \"event\": \"CustomCommand\",\n \"timestamp\": 1792083600,\n \"origin\": \"12345678\",\n \"data\": {\n \"command\": \";help\",\n \"player\": \"Builderman\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "received",
"event_type": "CustomCommand",
"server_id": "12345678"
}Webhooks
Game event intake
ER:LC sends server events here, signed with Ed25519. The API checks the signature and forwards the event to your URLs.
POST
/
webhooks
Game event intake
curl --request POST \
--url https://api.erlcrussia.com/v3/webhooks \
--header 'Content-Type: application/json' \
--header 'x-signature-ed25519: <api-key>' \
--header 'x-signature-timestamp: <api-key>' \
--data '
{
"server": "12345678",
"events": [
{
"event": "CustomCommand",
"timestamp": 1792083600,
"origin": "12345678",
"data": {
"command": ";help",
"player": "Builderman"
}
}
]
}
'import requests
url = "https://api.erlcrussia.com/v3/webhooks"
payload = {
"server": "12345678",
"events": [
{
"event": "CustomCommand",
"timestamp": 1792083600,
"origin": "12345678",
"data": {
"command": ";help",
"player": "Builderman"
}
}
]
}
headers = {
"x-signature-timestamp": "<api-key>",
"x-signature-ed25519": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-signature-timestamp': '<api-key>',
'x-signature-ed25519': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
server: '12345678',
events: [
{
event: 'CustomCommand',
timestamp: 1792083600,
origin: '12345678',
data: {command: ';help', player: 'Builderman'}
}
]
})
};
fetch('https://api.erlcrussia.com/v3/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.erlcrussia.com/v3/webhooks",
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([
'server' => '12345678',
'events' => [
[
'event' => 'CustomCommand',
'timestamp' => 1792083600,
'origin' => '12345678',
'data' => [
'command' => ';help',
'player' => 'Builderman'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-signature-ed25519: <api-key>",
"x-signature-timestamp: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.erlcrussia.com/v3/webhooks"
payload := strings.NewReader("{\n \"server\": \"12345678\",\n \"events\": [\n {\n \"event\": \"CustomCommand\",\n \"timestamp\": 1792083600,\n \"origin\": \"12345678\",\n \"data\": {\n \"command\": \";help\",\n \"player\": \"Builderman\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-signature-timestamp", "<api-key>")
req.Header.Add("x-signature-ed25519", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.erlcrussia.com/v3/webhooks")
.header("x-signature-timestamp", "<api-key>")
.header("x-signature-ed25519", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"server\": \"12345678\",\n \"events\": [\n {\n \"event\": \"CustomCommand\",\n \"timestamp\": 1792083600,\n \"origin\": \"12345678\",\n \"data\": {\n \"command\": \";help\",\n \"player\": \"Builderman\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.erlcrussia.com/v3/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-signature-timestamp"] = '<api-key>'
request["x-signature-ed25519"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"server\": \"12345678\",\n \"events\": [\n {\n \"event\": \"CustomCommand\",\n \"timestamp\": 1792083600,\n \"origin\": \"12345678\",\n \"data\": {\n \"command\": \";help\",\n \"player\": \"Builderman\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "received",
"event_type": "CustomCommand",
"server_id": "12345678"
}Authorizations
Unix timestamp of the incoming webhook signature.
Ed25519 cryptographic signature of the webhook request body.
Was this page helpful?