NotifyVisitors API endpoints enable you to create and update users whenever they perform any actions on your site. But before you know how to create and update the users, it is important to identify the users to make the tracking process more feasible.

DIFFERENT API ENDPOINTS

NotifyVisitors provides different API endpoints for creating users :

Upload user profile

  • This endpoint enables you to create and update user profiles. You can create single or multiple users by this API. Upload a maximum of 100 users at an API call.
    https://analytics.notifyvisitors.com/api/v1/user/create

List of a user profile by events

  • This endpoint helps you in getting the list of user profiles. You simply have to specify the event name, date range and batch size required.
    https://analytics.notifyvisitors.com/api/v1/user/profile

Total no. of profiles matching event query

  • The following API endpoint is used to get the total number of profiles that match an event query.
    https://analytics.notifyvisitors.com/api/v1/user/count

Delete a user profile

  • This endpoint enables you to delete a user profile.
    https://analytics.notifyvisitors.com/api/v1/user/delete

Individual user profile data from user id

  • Get user profile data through this API.
    https://analytics.notifyvisitors.com/api/v1/user/userData

API RATE LIMIT

  • The API rate limit is the number of times the API can be requested per minute.
  • You can make up to 500 API requests per minute on an API.
  • If the limit exceeds, the app will throw an error in Response. All API requests are
    subject to rate limits.

How to pass the user attributes while creating or updating a user

Refer to the below example for the same

curl --request POST \
  --url https://analytics.notifyvisitors.com/api/v1/user/create \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'x-brand-id: YOUR_BRAND_ID' \
    --data '{
    "userId": "michaelclark",
    "firstName": "Michael",
    "lastName": "Clark",
    "birthDate": "1986-08-19T15:45:00-0800",
    "gender":"male",
    "email":"[email protected]",
    "phone":"+551155256325",
    "company":"Alphabet Inc.",
    "attributes": {
        "Age":"31",
      "Twitter username": "@michaelclark86",
      "Dollars spent": 461.93,
      "Points earned": 78732
      }}

👍

Note:

You can select parameters from the given table on the right to send user attributes in request body.

POINTS TO REMEMBER WHILE SETTING ATTRIBUTES:

  • The User attribute names must be less than 50 characters and string attribute
    values must be less than 1000 characters.

  • The JSON object customer value cannot be used to create segments.

  • The data type must be consistent and firm with the value you want to save against an attribute.

PARAMETERTYPEATTRIBUTE DESCRIPTIONMANDATORY
user_idStringEither user id or anonymous id is mandatory.( identifier for a known user)

User id can be of 100 characters.
Yes
nameString
first NameStringFirst name of the userNo
last NameStringLast name of the userNo
birth_dateStringBirth date in YYYY-MM-DD formatNo
genderStringGender - value can only be one of male, female, otherNo
emailStringEmail IDNo
mobileStringPhone number of the user in E.164 format
eg. +551155256325, +917850009678
No
email_opt_ininteger1 -> reachable on email 0 -> not available , 2 -> bouncedNo
sms_opt_ininteger1 -> reachable on sms , 0 -> not available , 2 -> invalidNo
whatsapp_opt_ininteger1 -> opt in for whatsapp , 0 -> no, 2 -> invalidNo
companyStringName of the company in which user worksNo
hashed_emailStringEncrypted email address for use with a private ESPNo
hashed_mobileStringEncrypted phone number for use with a private ESPNo
attributesObjectCustom attributes of the user as key-value pairs. For example:
{ "userPlan": "Premium" }
No

RETURNS:

  • When you call API to send the users’ data, you can receive the response. i..e status of the request
    as “success, queued or error.
{
    "response": {
        "status": "queued"

    }
}
  • You also get the reason if the status is shown as “ERROR” as given below :
{
  "response": {
  "message":"Error: userId and anonymousId cannot be empty.",
  "status":"error"
    }
}