Session Endpoint
This Endpoint is for checking session visits
Base URL: https://web-counter.azurewebsites.net
Increment a WebEvent Count
Increments the counter for the specified Web Event and Web Page combination
URL: /api/counter/analytics-session
Method: PUT
Content Type: application/json
Request Body
info
SessionID is optional and if not found, a new Session ID will be generated
{
"sessionId": "string",
"eventName": "Page Visit",
"pathname": "/"
}
Example Requests
- JavaScript
- cURL
const response = await fetch(
"https://web-counter.azurewebsites.net/api/counter/analytics-session",
{
method: "PUT",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
sessionId: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
eventName: "Page Visit",
pathname: "/",
}),
}
);
curl -X 'POST' \
'https://web-counter.azurewebsites.net/api/counter/analytics-session' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"sessionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"eventName": "Page Visit",
"pathname": "/",
}'
Example Responses
- 200 OK
- 204 No Content
- 400 Bad Request
A Status 201 is returned when an update was made which include the Session ID being used to track visits for the visitor.
{
"sessionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"eventName": "string",
"pathname": "string"
}
This Status Code means no changes were made as the entry was already tracked.
{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string",
"errors": {
"additionalProp1": ["string"],
"additionalProp2": ["string"],
"additionalProp3": ["string"]
},
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
}