Gagri Global IT services is having a team of executives who have good experience in developing applications on various platforms like SharePoint 2013/2010, Silverlight, net Framework 4.5 and Mobile tools.

Automatic whatsApp notification APIs

Posted on August 24, 2023 by Upendra

Types of APIs:

  1. Track User API
  2. Track Events API
  3. Get Users
  4. 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. This field is optional. You can pass either fullPhoneNumber OR countryCode + phoneNumber. Both are NOT allowed
    • 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


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,
Either fullPhoneNumber or phoneNumber + CountryCode is required
"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, make sure it does not contain country code or “0” (zero) in beginning of the number (required field)
    • fullPhoneNumber - User’s full phone number along with country code. This fields is optional. You can pass either fullPhoneNumber OR countryCode + phoneNumber. Both are NOT allowed
    • event - Name of the event
    • traits - key-value flat JSON object that can be used to store event attributes

Example API


POST -- 'https://api.interakt.ai/v1/public/track/events/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic ' \
{
"userId": "12035448-36a0-3aa24", //Optional
"fullPhoneNumber": "919999999999", // Optional,
Either fullPhoneNumber or phoneNumber + CountryCode is required "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 number, make sure it does not contain country code or “0” (zero) in beginning of the number (required field)
    • fullPhoneNumber - User’s full phone number along with country code. This fields is optional. You can pass either fullPhoneNumber OR countryCode + phoneNumber. Both are NOT allowed
    • callbackData - If you want to store any message level attributes, then you can use the callback_data parameter in the string format to send additional data. This will be returned to you in the corresponding webhooks. We will send an id in response to your API call. This id can be stored for future reference. This id will be referred to when webhooks are returned later. (optional string field with max length 512)
    • type - Type of message to be sent; Supported Values: Template (required field)

Template


    • name - Make sure that the template was created in Interakt. The template name to be used is the code name of the template. You will find the code name on the 'info icon'
      beside the template name in https://app.interakt.ai/templates/list.OR, if you want to use a template which was created by you in Facebook Business Manager, please click on Sync in https://app.interakt.ai/templates/list and after Sync
      is completed you will see the template appear in the list. (required field)
    • languageCode - Language code should match the language in which you had created the template. you can find all language codes here: https://developers.facebook.com/docs/whatsapp/api/messages/message-templates/ (required field)
    • fileName: applicable when document header is used for the document's file name (optional field)
    • headerValues - It can hold an array of strings and is used if header type is text & there is a variable in it OR if header type is media(document, image, etc) then used
      for putting the url for the header's media file (optional field)
    • bodyValues - It can hold an array of strings and is used for value of variables in body text (optional field)
    • buttonValues - Used in case there are any dynamic URL in the buttons (optional field). It is an object with key as button index in template (starting from 0) and its value
      as an array of string for variables in the button. Example: "buttonValues" : { "0" : ["12344"]}If the template has 2 buttons with the first being a contact number, and second being any text with dynamic value - Then the above example would look
      like "buttonValues" : { "1" : ["12344"]}
foot-logo

All design and content Copyright © 2012-2018 Gagri Global IT Services Pvt.Ltd. All rights reserved

Sitemap