Conscent.ai Developer Documentation
  • Version 2.0
    • Using Conscent.ai
    • Web SDK
    • Login
    • Logout
    • User Details Drawer
    • Google One Tap
    • Mobile SDK
      • iOS(Swift)
        • In-App Purchases with Conscent
      • Android SDK
      • React Native SDK
      • Google In-App Purchases with Conscent
      • Apple In-App Purchases with Conscent
    • Facebook SSO Integration Guide
    • Landing Page API v 2.0
    • AMP Integration
    • Integrating APIs(v2)
      • Purchase Details
      • User Registered Or Not
      • User Registrations
      • Subscription Plans Details
      • Get User Details
      • Add Subscription If User Registered
      • Update UserDetails
      • Update SubscriptionDetails
      • Get All Transaction Details
    • IAM System API Documentation
  • Version 1.0
    • Getting Started
    • On Board
    • Using Conscent.ai
    • Authentication
    • Web SDK
    • Login
    • Logout
    • Amp Documentation
    • Mobile SDK
      • Android
      • Flutter
      • iOS(Swift)
      • React Native SDK
    • Auto Login
    • Creating External Purchases
    • Landing Page API
  • Login Screen Customization
  • Integrating Client Payment Gateway
  • Integrating with APIs
    • User Details and Subscriptions Information
    • Purchased Subscriptions
    • User and Purchase Details
    • Client Purchases
    • Client Micropayments
    • Client Passes
    • Cancel Active Subscriptions
    • Delete User
  • Events API Docs
    • Different Types of Events
    • SSO Login Flow
  • Discount Coupon
    • Dynamic Coupon API Generation:
  • New Webhooks
    • Meter Banner Webhook
    • Paywall Webhook
    • SignUp Webhook
    • Refund Webhook
    • Purchase Webhook
    • Subscription Landing Page Webhook
    • Popup Webhook
    • User Update Webhook
    • Payment Gateway Webhook
    • Review Page Webhook
    • Transaction Webhook
    • Login Webhook
    • Cancel Subscription Webhook
  • Old Webhooks
    • Sign Up Webhook
    • Login Webhook
    • Subscription Payment Webhook
    • Subscription Cancelled Webhook
    • Pass Payment Webhook
    • Subscription Bundle Payment Webhook
    • Review Subscription Webhook
    • Micro Payment Webhook
    • How to validate Webhooks?
  • Registering The Content
    • Create Content
    • Edit Content
    • View Content
  • Country Code List
  • Supported Currencies and Payment Gateways
    • Stripe Supported Country with Currency
    • Razorpay Supported Country with Currency
    • Paypal Supported Country with Currency
  • Errors
  • Loyalty System
    • Web SDK
    • iOS SDK
    • Android SDK
    • Flutter SDK
    • API from server
Powered by GitBook
On this page

Events API Docs

The Event Collection API enables users to track and record events via a simple HTTP POST request to /collect/event endpoint. This facilitates insights into user interactions and behavior for analytics

Base URL

The base URL for making requests to the Event Collection API is:

SANDBOX
PRODUCTION
API Endpoints:

Endpoint: /collect/event

Method: POST

Description: The /collect/event endpoint is used to collect and store events in the system. Clients can send event data as JSON in the request body. The server will process the incoming event data and store it for further analysis.

Request Body:

The request body must contain a JSON object representing the event data. The JSON object can include the following properties:

  • messageBody ([Event], required): An array containing one or more event objects, each representing an individual event.

  • messageheader (Object, optional): A key-value pair object containing additional headers for the event collection.

* Example Request: (HTTP request RAW) *

POST /collect/event HTTP/1.1
Host: example.com
Content-Type: application/json
{
  "messageBody": 
  [
		{
			...properties
		},
		{
			...properties
		}
  ],
  "messageHeaders": 
	        {
		        ...headers
	        }
}

Response:

  • Status Code: 201 OK

  • Content-Type: application/json

Example Response:

[
	{
		"headers": {},
		"value": "{\"pingId\": \"c523aa41-9f0f-4fc2-bc96-5a8ff5520b78\"}" 
	}
]
Error Handling:

If there's an issue with the request or the server cannot process the event data, an appropriate error response will be returned.

Example Error Response:

{
  "error": "Bad Request",
  "message": "invalid event type",
	"statusCode": 400
}

Error Codes:

The API may return various HTTP status codes to indicate the success or failure of a request. Here are some of the common status codes:

ERROR CODE
DESCRIPTION

201 OK

The request was successful, and the event data was collected.

400 Bad Request

The request was malformed or had invalid parameters.

429 Too Many Requests

The client has exceeded the rate limit for the /collect/event endpoint.

500 Internal Server Error

An unexpected server error occurred.

Rate Limits:

To maintain fair usage and prevent abuse, rate limits are imposed on the /collect/event endpoint. If a client surpasses the permitted number of requests within a specific time window, the API will respond with a rate-limiting error.

Example Response Headers:

HTTP/1.1 429 Too Many Requests
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1672766785

Rate Limit Headers:

Rate Limit Name
Description

X-RateLimit-Limit

The maximum number of requests allowed within the current time window.

X-RateLimit-Remaining

The number of remaining requests allowed within the current time window.

X-RateLimit-Reset

The time at which the rate limit will be reset (usually in UTC timestamp).

PreviousDelete UserNextDifferent Types of Events

Last updated 1 year ago

https://sandbox-collection.conscent.in
https://collections.conscent.in