Skip to main content
GET
/
events
/
{event_id}
Get an event using event id
curl --request GET \
  --url https://api.togai.com/events/{event_id} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.togai.com/events/{event_id}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.togai.com/events/{event_id}', 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.togai.com/events/{event_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

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

func main() {

url := "https://api.togai.com/events/{event_id}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.togai.com/events/{event_id}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.togai.com/events/{event_id}")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "events": [
    {
      "eventPayload": {
        "timestamp": "2023-02-23T14:25:10Z",
        "schemaName": "travelCompletedEvent",
        "referenceId": "event.dsvhk32.234n3",
        "id": "c0b1306d-f506-43a6-856b-69221efaee6b",
        "accountId": "1",
        "attributes": [
          {
            "name": "distanceTravelled",
            "value": "50",
            "unit": "Miles"
          },
          {
            "name": "timeSpent",
            "value": "60",
            "unit": "Minutes"
          }
        ],
        "dimensions": {
          "location": "Seattle",
          "costCenterCode": "1234",
          "travelType": "Business"
        }
      },
      "eventPipelineInfo": {
        "eventSchema": {
          "name": "Rides",
          "version": 1
        },
        "usageMeters": [
          {
            "id": "23bh55ZZdifACTAV9WEV",
            "name": "rides_distance",
            "version": 1,
            "status": "PROCESSED_UNITS_COMPUTED",
            "units": 10.42
          },
          {
            "id": "23bh55ZZdifACTAV9WEV",
            "name": "rides_time",
            "version": 1,
            "status": "PROCESSED_FILTERED_OUT"
          }
        ],
        "pricePlans": [
          {
            "name": "pro-plan",
            "id": "68551191-982b-4663-92fa-38a6f8313e91",
            "scheduleId": "c0b1306d-f506-43a6-856b-69221efaee6b",
            "cycleStart": "04-03-2022",
            "cycleEnd": "04-04-2022"
          }
        ],
        "account": {
          "id": "acme-prod"
        },
        "customer": {
          "id": "acme_inc"
        }
      },
      "ingestionStatus": {
        "status": "INGESTION_COMPLETED_EVENT_NOT_METERED",
        "statusDescription": "Event ingestion completed successfully but the event is not associated with any bill plan."
      },
      "createdAt": "2021-03-04T14:25:10Z"
    }
  ]
}
{
"message": "<string>"
}
{
"message": "<string>"
}
{
"message": "<string>"
}
{
"message": "<string>"
}
{
"message": "<Reason message>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

event_id
string
required
Maximum string length: 50
Example:

"f4a52f2d-b798-4e08-8b24-db0a5a468ba3"

Response

Success response

Get single event response

events
object[]
required