Back to Others
Automatic WhatsApp Notification APIs
Messaging Architecture

Automatic WhatsApp
Notification APIs.

Author

Upendra

Published

August 24, 2023

Types of APIs

Track User API
Track Events API
Get Users
Template APIs
Send-Templates-NoHeader
Send-Template-Text Header with Variable
Send-Template-Document-Header
Send-Template-Image-Header
Send-Template-Dynamic-CTA

Description of APIs

This section provides descriptions of various APIs related to WhatsApp notifications.

1. Track User API

  • User Id: Custom user ID that can be assigned to the customer.
  • country Code: Country code of the user's phone (required field).
  • phone Number: User's phone number, make sure it does not contain country code or "0" (zero) in beginning of the number (required field).
  • Full PhoneNumber: User's full phone number along with country code. Optional.
  • traits: key-value flat JSON object that can be used to store customer attributes.
  • tags: List of tags to apply to the customer.
Example API - Track User
POST-- 'https://api.interakt.ai/v1/public/track/users/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic ' \
{
  "userId": "12035448-36a0-3aa24", // Optional
  "fullPhoneNumber": "919999999999", // Optional
  "phoneNumber": "9999999999", 
  "CountryCode": "+91",
  "traits": {
    "Name": "John Doe", 
    "email": "johndoe@gmail.com" 
  },
  "tags": ["sample-tag-1", "sample-tag-2"]
}

2. Track Events API

userId: Custom user ID that can be assigned to the customer.

phoneNumber: User’s phone number (Required).

fullPhoneNumber: User’s full phone number along with country code (Optional).

event: Name of the event (e.g., "Product Added To Cart").

traits: key-value flat JSON object to store event attributes.

Example API - Track Events
POST -- 'https://api.interakt.ai/v1/public/track/events/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic ' \
{
  "userId": "12035448-36a0-3aa24", //Optional
  "fullPhoneNumber": "919999999999", 
  "phoneNumber": "9999999999", 
  "countryCode": "+91",
  "event": "Product Added To Cart",
  "traits": {
    "productName": "Shoes", 
    "quantity": 2, 
    "price": 500, 
    "currency": "INR"
  }
}

3. Get Users

POST --'https://api.interakt.ai/v1/public/apis/users/?offset=0&limit=100' \
--header 'Authorization: Basic {{API_KEY}}' \
--data '{
  "filters": [{"trait":"created_at_utc","op":"gt","val":"2021-08-27"}]
}'

4. Template APIs

API Keys Description

countryCode
Country code of the user’s phone (required field)
phoneNumber
User’s phone (required field)
fullPhoneNumber
User’s full phone number along with country code (Optional)
callbackData
Message level attributes in string format (optional string field with max length 512)
type
Type of message to be sent; Supported Values: Template (required)

Template Configuration

name
The code name of the template from Interakt dashboard (required)
languageCode
Matching the language code of the created template (required)
headerValues
Array of strings for text variables or media URLs (media header types)
bodyValues
Array of strings for body text variables
buttonValues
Map of button index (starting from 0) to variable arrays