REST APIs

APIs are the messenger or mediators which transfers the data from Server to Server whenever a user performs an action on the site. You can call requests on these APIs to send the data to the provider and receive the response in return.

NotifyVisitors provide the endpoints along with the specific requirements which perform these actions that mean returns the data. With the help of this data, you can easily track the actions performed by the users along with data associated.

NOTIFYVISITORS API ENDPOINT

You can access all the resources available via API over the HTTPS server. Whenever an API requests to access data from a web application or server, a response is always sent back.

ACCESS DATA VIA API

You can send and receive the data by calling on the below API Endpoints.

  • You can call the below Endpoint for collecting and sending data regarding the push notifications.
    https://push.notifyvisitors.com/api/v1/

  • You can call the below endpoint for for adding users and events to NotifyVisitors.
    https://analytics.notifyvisitors.com/api/v1/

API RATE LIMIT

  • The API rate limit is the number of time 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 error in Response. All API requests are subject to rate limits.

πŸ“˜

CONTACT SUPPORT :

If you want to increase this limit, feel free to contact us on [email protected]

HOW TO SEND THE DATA

  • You can send the data in JSON format.

  • You can send the data by passing the Format parameter in the URL as JSON.

  • You can pass any parameters as HTTP query string parameters in the API URLs.

WHAT IS THE DATE FORMAT

The timestamps for the data will be in the following format :

πŸ“˜

yyyy-MM-ddTHH:mm:ss

2013-01-26T07:31+0000

HOW TO RECEIVE THE API RESPONSE

API Response is usually received in the following format or container: i.e. response.

This API response has the following properties:

Status: It will either be shown as an error as success depending upon the response of the server.

Data: It will contain the data for the requested resource.

Message: The said property will determine the reason for the corresponding status.

{
    "response" : {
        "data" : {
            ...
        },
        "message" : "success",
        "status" : "success"
    }
}

HOW TO GET API CREDENTIALS

  • Login to the NotifyVisitors account.

  • Navigate to the Profile > STORE INTEGRATION

ACCESS THE NOTIFYVISITORS API USING API KEY

  • Login to the NotifyVisitors account.

  • Navigate to the Profile > INTEGRATION

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 '{"nv":[{"userID":"1234"",user_attributes":{name:'John', email:'john@gmail.com', mobile:'+919899999999'
  }}]}'

πŸ“˜

Note:

  • Replace YOUR_API_KEY with NotifyVisitors' API key.
  • Replace YOUR_BRAND_ID with NotifyVisitors' Brand id .

ACCESS THE NOTIFYVISITORS API USING ACCESS TOKEN (Oauth)

To access this API using access token, pass access token in Authorization token. This is mainly for NotifyVisitors partner who wants to use this API on behalf of their client. Follow this link to know more about oauth flow.

curl --request POST \
  --url https://analytics.notifyvisitors.com/api/v1/user/create \
  --header 'content-type: application/json' \
  --header 'Authorization: Bearer ACCESS_TOKEN' \
  --data '{"nv":[{"userID":"1234"",user_attributes":{name:'John', email:'john@gmail.com', mobile:'+919899999999'
  }}]}'

ERRORS

Errors will be shown using the standard HTTP error code syntax. Find the below description for the error codes :

400Invalid resource
401Invalid auth
404Invalid URL