Skip to main content

WebPage Endpoints

These are the endpoints for managing your Web Pages

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 Page

To add pages (web paths) that you would like to be tracked in your website

URL: /api/webpage

Method: POST

Content Type: application/json

Headers

X-API-Key: YOUR_API_KEY_GOES_HERE

Request Body

{
"pathname": "/about"
}

Example Requests

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

Example Responses

{
"hostname": "string",
"pathname": "string"
}

Retrieve Web Pages

Get All Web Pages that are being tracked

URL: /api/webpage

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/webpage", {
method: "GET",
headers: {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY_GOES_HERE",
},
});

Example Responses

["/", "browse", "login"]