Skip to main content

WebEvent Endpoints

These are the endpoints for managing your Web Events

Base URL: https://web-counter.azurewebsites.net

info

The endpoints below will require adding a X-API-Key Header to your request in order to authorize the request.

Create a Web Event

To add a Web Event that can be tracked

URL: /api/webevent

Method: POST

Content Type: application/json

Headers

X-API-Key: YOUR_API_KEY_GOES_HERE

Request Body

{
"name": "Page Visit"
}

Example Requests

const response = await fetch("https://web-counter.azurewebsites.net/api/webevent", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY_GOES_HERE",
},
body: JSON.stringify({
name: "Registration Click",
}),
});

Example Responses

{
"hostname": "string",
"eventName": "string"
}

Retrieve Web Events

Get All Web Events by Name

URL: /api/webevent

Method: GET

Request Parameters

Headers

X-API-Key: YOUR_API_KEY_GOES_HERE

Example Requests

const response = await fetch("https://web-counter.azurewebsites.net/api/webevent", {
method: "GET",
headers: {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY_GOES_HERE",
},
});

Example Responses

["Page Visit", "Second Event"]