Send Events
curl --request POST \
--url https://api.gameball.co/api/v4.0/integrations/events \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"customerId": "1848877205",
"events": {
"write_review": {
"product_id": "1653503260",
"review": "5 Stars Product"
}
}
}
'const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customerId: '1848877205',
events: {write_review: {product_id: '1653503260', review: '5 Stars Product'}}
})
};
fetch('https://api.gameball.co/api/v4.0/integrations/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.gameball.co/api/v4.0/integrations/events"
payload = {
"customerId": "1848877205",
"events": { "write_review": {
"product_id": "1653503260",
"review": "5 Stars Product"
} }
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://api.gameball.co/api/v4.0/integrations/events");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("apikey", "<api-key>");
request.AddJsonBody("{\n \"customerId\": \"1848877205\",\n \"events\": {\n \"write_review\": {\n \"product_id\": \"1653503260\",\n \"review\": \"5 Stars Product\"\n }\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gameball.co/api/v4.0/integrations/events"
payload := strings.NewReader("{\n \"customerId\": \"1848877205\",\n \"events\": {\n \"write_review\": {\n \"product_id\": \"1653503260\",\n \"review\": \"5 Stars Product\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gameball.co/api/v4.0/integrations/events",
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([
'customerId' => '1848877205',
'events' => [
'write_review' => [
'product_id' => '1653503260',
'review' => '5 Stars Product'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.gameball.co/api/v4.0/integrations/events")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": \"1848877205\",\n \"events\": {\n \"write_review\": {\n \"product_id\": \"1653503260\",\n \"review\": \"5 Stars Product\"\n }\n }\n}")
.asString();{
"success": true,
"message": "Events processed"
}Send Events
Record customer actions with metadata to power rewards and engagement.
POST
/
api
/
v4.0
/
integrations
/
events
Send Events
curl --request POST \
--url https://api.gameball.co/api/v4.0/integrations/events \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"customerId": "1848877205",
"events": {
"write_review": {
"product_id": "1653503260",
"review": "5 Stars Product"
}
}
}
'const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customerId: '1848877205',
events: {write_review: {product_id: '1653503260', review: '5 Stars Product'}}
})
};
fetch('https://api.gameball.co/api/v4.0/integrations/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.gameball.co/api/v4.0/integrations/events"
payload = {
"customerId": "1848877205",
"events": { "write_review": {
"product_id": "1653503260",
"review": "5 Stars Product"
} }
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://api.gameball.co/api/v4.0/integrations/events");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("apikey", "<api-key>");
request.AddJsonBody("{\n \"customerId\": \"1848877205\",\n \"events\": {\n \"write_review\": {\n \"product_id\": \"1653503260\",\n \"review\": \"5 Stars Product\"\n }\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gameball.co/api/v4.0/integrations/events"
payload := strings.NewReader("{\n \"customerId\": \"1848877205\",\n \"events\": {\n \"write_review\": {\n \"product_id\": \"1653503260\",\n \"review\": \"5 Stars Product\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gameball.co/api/v4.0/integrations/events",
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([
'customerId' => '1848877205',
'events' => [
'write_review' => [
'product_id' => '1653503260',
'review' => '5 Stars Product'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.gameball.co/api/v4.0/integrations/events")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": \"1848877205\",\n \"events\": {\n \"write_review\": {\n \"product_id\": \"1653503260\",\n \"review\": \"5 Stars Product\"\n }\n }\n}")
.asString();{
"success": true,
"message": "Events processed"
}Send events to capture customer actions. Each event has a name (for example,
place_order) and optional metadata.
Security: Provide
apikey header.Automatic Customer Creation: If the customer specified by
customerId doesn’t exist in Gameball, a new customer profile will be automatically created when using this API. You don’t need to create the customer separately before sending events.Authorizations
Body
application/json
Event payload containing the customerId and one or more events with metadata.
Was this page helpful?
⌘I