Kwegg system allows tenants to integrate via REST APIs to track their user actions on Kwegg servers. A tenant can log in to their users on the Kwegg backend and receive a back access token that can be used in subsequent APIs. Kwegg allows tenants to fetch coin balances of their users and register/trigger user actions that are rewardable as per their customization on the Kwegg admin dashboard.

Let’s test out running Kwegg locally by cloning the Quickstart app. You’ll need API keys, which you can receive by signing up in the Dashboard.
An extensive reference to integrate with Kwegg API endpoints
BaseURL
https://dev-api.kwegg.com/
Kwegg maintains your users at our servers to keep track of your user’s balance and activities that the user performs in your app. Each of your users is uniquely identified on our system by the identifier(userId) that you provide to us. This API is used to Login/Signup a tenant user on the Kwegg system and returns an access token to authenticate subsequent requests.
POST - {{BaseURL}}/userauth/user/tenant/login
Header
Parameter
|
Datatype
|
Description
|
License-Key |
String |
The license key is communicated to the customer via email. |
Platform |
String |
The platform is the client-side platform that is hitting the APIs – (ANDROID, WEB, IOS) |
Request field
Parameter
|
Datatype
|
Description
|
Mandatory
|
Example
|
userId |
String |
Your UserId to verify the user credentials |
Yes |
“12” |
Request Body Example
{
"userId":"12"
}
cURL
curl --location --request POST '{{BaseURL}}/userauth/user/tenant/login' \
--header 'License-Key: TESTONE1234' \
--header 'Platform: RAW' \
--header 'Content-Type: application/json' \
--data-raw '{
"userId":"12"
}'
Response Body Example
{
"success": true,
"message": "Login successfully",
"data": {
"accessToken": "afn770-484f0af24b2b91cc9c61a9206d0681e6",
"user": {
"userId": "12",
"balance": 0
}
}
}
Here accessToken is the token required to access other API endpoints of the system.
Kwegg server stores the balance of each of the tenant users. This API aims to fetch the balance of the user associated with a particular userId.
GET - {{BaseURL}}/userauth/user/tenant/balance?userId=12&=
Header
Parameter
|
Datatype
|
Description
|
License-Key |
String |
The license key is communicated to the customer via email. |
Platform |
String |
The platform is the client-side platform that is hitting the APIs – (ANDROID, WEB, IOS) |
Authorization |
String |
The accessToken will be used here to give authorization to the user to fetch balance. |
cURL
curl --location --request GET '{{BaseURL}}/user/tenant/balance?userId=12&=' \
--header 'License-Key: TESTONE1234' \
--header 'Platform: RAW' \
--header 'Authorization: <accessToken>' \
--data-raw ''
Response Body Example
{
"success": true,
"message": "Balance fetched successfully",
"data": {
"balance": 0
}
}
For each of the events defined in the dashboard for the user’s activity in the tenant’s app, the tenant system can trigger an event occurrence with the Kwegg server. This API is used to register/trigger an event occurrence from the tenant’s side to Kwegg’s system and required the access token that is received from the tenant user login API.
POST - {{BaseURL}}/core/user/tenant/event/occurence?=
Header
Parameter
|
Datatype
|
Description
|
License-Key |
String |
The license key will be communicated to the customer via email. |
Platform |
String |
The platform is the client-side platform that is hitting the APIs – (ANDROID, WEB, IOS) |
Authorization |
String |
The accessToken is used here to give authorization to the user to fetch balance. |
Request Fields
Parameters
|
Datatypes
|
Description
|
Mandatory
|
Example
|
userId |
String |
Your UserId to verify the user credentials. |
yes |
“12” |
event |
Object |
Event attributes by the user as key-value pairs. |
yes |
{“name”:“product_viewed”,“id”:“23”} |
name |
String |
Name of the event performed by the user. |
yes |
“product_viewed” |
params |
Object |
An array of attributes of the event occurred. |
yes |
{“id”:“1234”, “name”: “event1” } |
id |
string |
Specifies the event id of the event performed by the user. |
yes |
“1234” |
Request Body Example
{
"userId":"12",
"event":{
"name":"product_viewed",
"params":{
"id":"1234"
}
}
}
cURL
curl --location --request POST '{{BaseURL}}/core/user/tenant/event/occurence?=' \
--header 'License-Key: TESTONE1234' \
--header 'Platform: RAW' \
--header 'Authorization: <acessToken>' \
--header 'Content-Type: application/json' \
--data-raw '{
"userId":"12",
"event":{
"name":"product_viewed",
"params":{
"id":"1234"
}
}
}'
Response Body Example
{
"success": true,
"message": "Event triggered successfully",
"data": null
}
This API aims to fetch and display the transaction details (credit or debit points) of the user who encountered any event based on the application.
GET -{{BaseURL}}/core/user/tenant/transactions?page=1&numOfItems=5
Header:
Parameter
|
Datatype
|
Description
|
License-Key |
String |
The license key is communicated to the customer via email. |
Platform |
String |
The platform is the client-side platform that is hitting the APIs – (ANDROID, WEB, IOS) |
Authorization |
String |
The accessToken will be used here to give authorization to the user to fetch balance. |
cURL
curl --location --request GET 'https://dev-api.kwegg.com/core/user/tenant/transactions?page=1&numOfItems=5' \
--header 'License-Key: TESTONE1234' \
--header 'Platform: RAW' \
--header 'Authorization: <accessToken>' \
--data-raw ''
Response Body Example
{
"success": true,
"message": "Transactions fetched successfully",
"data": {
"transactions": [
{
"id": "224b96ae-5c22-4e22-b484-7a15cccaa92d",
"entry": "CREDIT",
"createdAt": "2021-02-03T16:43:06.482441Z",
"type": "EVENT_OCCURENCE",
"points": 2
}
],
"totalCount": 5
}
}
This API aims to fetch and display offers to the customers with all the associated customer details and the current status of the offer.
GET - {{eggsBaseUrl}}/userauth/admins/tenant?page=1&numOfItems=2
Header
Parameter
|
Datatype
|
Description
|
License-Key |
String |
The license key is communicated to the customer via email. |
Platform |
String |
The platform is the client-side platform that is hitting the APIs – (ANDROID, WEB, IOS) |
cURL
curl --location --request GET 'https://dev-api.kwegg.com/userauth/admins/tenant?page=1&numOfItems=2' \
--header 'License-Key: TESTONE1234' \
--header 'Platform: RAW' \
--header 'Authorization: <accessToken>'
Response Body Example
"success": true,
"message": "Admins fetched successfully",
"data": {
"admins": [
{
"id": "82204c64-864d-48a2-ab71-00501db18ccf",
"createdAt": "2020-10-21T19:30:22.495968Z",
"email": "jack@gmail.com",
"firstName": "Jack",
"lastName": "One",
"role": "VIEWER",
"status": "PENDING"
},
{
"id": "e534d8b3-6403-4fa8-89d0-261383dac3f8",
"createdAt": "2020-11-03T20:24:34.030307Z",
"email": "jack@gmail.com",
"firstName": "Jack",
"lastName": "Two",
"role": "VIEWER",
"status": "ACTIVE"
}
],
"totalCount": 4
}
}
This API aims to fetch and display offers to the customers with all the associated customer details and the current status of the offer.
GET - {{eggsBaseUrl}}/userauth/admins/tenant?page=1&numOfItems=2
Header
Parameter
|
Datatype
|
Description
|
License-Key |
String |
The license key is communicated to the customer via email. |
Platform |
String |
The platform is the client-side platform that is hitting the APIs – (ANDROID, WEB, IOS) |
cURL
curl --location --request GET 'https://dev-api.kwegg.com/userauth/admins/tenant?page=1&numOfItems=2' \
--header 'License-Key: TESTONE1234' \
--header 'Platform: RAW' \
--header 'Authorization: <accessToken>'
Response Body Example
"success": true,
"message": "Admins fetched successfully",
"data": {
"admins": [
{
"id": "82204c64-864d-48a2-ab71-00501db18ccf",
"createdAt": "2020-10-21T19:30:22.495968Z",
"email": "jack@gmail.com",
"firstName": "Jack",
"lastName": "One",
"role": "VIEWER",
"status": "PENDING"
},
{
"id": "e534d8b3-6403-4fa8-89d0-261383dac3f8",
"createdAt": "2020-11-03T20:24:34.030307Z",
"email": "jack@gmail.com",
"firstName": "Jack",
"lastName": "Two",
"role": "VIEWER",
"status": "ACTIVE"
}
],
"totalCount": 4
}
}