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
  1. Loyalty System

API from server

This API is used to Post Events from your server directly to Conscent.ai This is the recommended way of Posting an Event.

Authorization :

POST https://api.Conscent.club/reward/{partner_id}/api/user_event

Header: {API Key}

Path Parameters

Name
Type
Description

partner_id*

String

Unique Identifier for the Partner

Request Body

Name
Type
Description

RAW_BODY*

Object

Provide an Event Object

curl --request POST \
     --url https://api.Conscent.club/reward/partner_id/api/user_event \
     --header 'X-API-KEY: {API Key}' \
     --header 'accept: text/plain' \
     --header 'content-type: application/json' \
     --data '
{
  "eventType": "ORDER_PLACED",
  "userId": "42bede01c83fa3947"
}
'
const options = {
  method: 'POST',
  headers: {
    accept: 'text/plain',
    'content-type': 'application/json',
    'X-API-KEY': '{API Key}'
  },
  body: JSON.stringify({eventType: 'ORDER_PLACED', userId: '42bede01c83fa3947'})
};

fetch('https://api.Conscent.club/reward/partner_id/api/user_event', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));

Installation:

$ composer require guzzlehttp/guzzle
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.Conscent.club/reward/partner_id/api/user_event', [
  'body' => '{"eventType":"ORDER_PLACED","userId":"42bede01c83fa3947"}',
  'headers' => [
    'X-API-KEY' => '{API Key}',
    'accept' => 'text/plain',
    'content-type' => 'application/json',
  ],
]);

echo $response->getBody();

Installation:

$ npm install api --save
const request = require('request');

const options = {
  method: 'POST',
  url: 'https://api.Conscent.club/reward/partner_id/api/user_event',
  headers: {
    accept: 'text/plain',
    'content-type': 'application/json',
    'X-API-KEY': '{API Key}'
  },
  body: {eventType: 'ORDER_PLACED', userId: '42bede01c83fa3947'},
  json: true
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

PreviousFlutter SDK

Last updated 1 year ago