Vizir api documentation API Reference

Documentation de l'api de Vizir.co

API Endpoint
https://api.vizir.co
Terms of Service: https://vizir.co
Request Content-Types: application/json
Response Content-Types: application/json
Schemes: https
Version: 1.0.0

Authentication

basic_auth

type
apiKey
name
Authorization
in
header
example
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6IjVhODU1YTFkZjIwMyJ9.TTErE3QlPNOCGwI64a2uvMcfxDfQqYQMWGmDsNlPBHM

Data

Get respondent's last answer

GET /data/respondentLastAnswer?appID=XX&respondentID=ZZ

Permet de récupérer la dernière réponse d'un user pour une application particulière

respondentID
in query
string

RespondentID

appID
in query
string

appID

200 OK

lastResponse

type
object
default

unexpected error

Response Content-Types: application/json
Response Example (200 OK)
{
  "lastResponse": "john@snow.com"
}
Response Example (default )
{
  "status": 304,
  "message": "Some parameters are missing or not valid"
}

Get all respondents

GET /data/respondentsList?appID=XX&

Permet de récupérer la liste de tous les respondentID des utilisateurs qui ont parlé avec votre bot.

appID
in query
string

appID

skip
in query
Integer

Permet de ne pas récupérer l'id d'un certains nombre d'utilisateurs

200 OK

Liste des respondentID

type
array
default

Some parameters are missing or not valid

Response Content-Types: application/json
Response Example (200 OK)
[
  "id_1",
  "id_2"
]
Response Example (default )
{
  "status": 304,
  "message": "Some parameters are missing or not valid"
}

Get active respondents

GET /data/respondentsListActive?appID=543524&date=1518003316009

Permet de récupérer la liste des utilisateurs ayant intéragi avec le chatbot depuis une date

date
in query
string

Date au format javascript Date.now()

appID
in query
string

appID

200 OK

Liste des respondentID

type
array
default

unexpected error

Response Content-Types: application/json
Response Example (200 OK)
[
  "id_1",
  "id_2"
]
Response Example (default )
{
  "status": 304,
  "message": "Some parameters are missing or not valid"
}

Get respondents' answers by feature

GET /data/featureByRespondent?respondentID=62341&appID=524&featureID=d27

Permet de récupérer les réponse d'un utilisateur pour l'une des fonctionnalité du chatbot.

respondentID
in query
string

RespondentID

appID
in query
string

appID

featureID
in query
string

featureID

OK

default

unexpected error

Response Content-Types: application/json
Response Example (200 OK)
{
  "appID": "string",
  "respondentID": "string",
  "featureID": "string",
  "answers": {
    "questionIndex": "integer",
    "questionID": "string",
    "timestamp": "date",
    "response": [
      "answer_1",
      "answer_2"
    ]
  }
}
Response Example (default )
{
  "status": 304,
  "message": "Some parameters are missing or not valid"
}

Get conversations data

GET /data/application/:appID?from=date_1&to=data_2

Récupérer les data de conversation par date

appID
in params
string

appID

from
in query
timestamp

Date in timestamp (ms from jan 1970)

to
in query
timestamp

Date in timestamp (ms from jan 1970)

200 OK

OK

type
object
default

unexpected error

Response Content-Types: application/json
Response Example (200 OK)
{
  "appID": "5bfe66b59e2fef003024D34",
  "from": "2019-02-01T14:24:37.000Z",
  "to": "2019-02-21T14:24:37.000Z",
  "current_period": {
    "_id": {
      "appID": "5bfe66b59e2fef003024D34"
    },
    "nb_users": 7,
    "nb_messages": 49,
    "nb_live_messages": 7,
    "nb_conversations": 7
  },
  "last_period": {
    "_id": {
      "appID": "5bfe66b59e2fef003024D34"
    },
    "nb_users": 11,
    "nb_messages": 0,
    "nb_live_messages": 11,
    "nb_conversations": 11
  },
  "graph": {
    "users": [
      {
        "date": 1234567,
        "value": 12
      }
    ],
    "conversations": [
      {
        "date": 1234567,
        "value": 12
      }
    ],
    "messages": [
      {
        "date": 1234567,
        "value": 12
      }
    ],
    "liveMessages": [
      {
        "date": 1234567,
        "value": 12
      }
    ]
  },
  "period": 20
}
Response Example (default )
{
  "status": 304,
  "message": "Some parameters are missing or not valid"
}

Get statistics from attributes

PUT /data/attribute/:appID

Récupérer les data à partir des attributes, tag et event des users

appID
in params
string

appID

Request Example
{
  "operation": "count",
  "groupBy": {
    "type": "attribute",
    "value": "P1"
  },
  "filters": {
    "attribute": {
      "contract-amount": {
        "operator": "isDefined",
        "value": "dkfqdjfqdk"
      }
    }
  }
}
200 OK

OK, you will have either repartition or count depending of the operation used

type
object
default

unexpected error

Response Content-Types: application/json
Response Example (200 OK)
{
  "appID": "5bfe66b59e2fef003024D34",
  "repartition": [
    {
      "_id": "answer_1",
      "nb_users": 1
    },
    {
      "_id": "answer_2",
      "nb_users": 1
    }
  ],
  "count": 34
}
Response Example (default )
{
  "status": 304,
  "message": "Some parameters are missing or not valid"
}

Get filtered respondents

POST /data/respondents/:appID?page=1

Get the respondents that match some criteria

Filter

page
in query
string

page number

appID
in params
string

appID

Request Example
{
  "appID": "string",
  "respondentID": "string",
  "attribute": {
    "your_properties_name_1": "string",
    "your_properties_name_2": "string"
  },
  "tag": {
    "favorite_sports": {
      "add": [
        "soccer",
        "skiing"
      ],
      "remove": [
        "natation"
      ]
    }
  },
  "event": {
    "dollar_spent": {
      "inc": 3
    },
    "last_login": "Date.now()"
  }
}
200 OK

OK

type
string
default

unexpected error

Response Content-Types: application/json
Response Example (200 OK)
"OK"
Response Example (default )
{
  "status": 304,
  "message": "Some parameters are missing or not valid"
}

Get feature's data

GET /data/feature?featureID=d27...

Permet de récupérer un tableau avec les réponses de tous les utilisateurs pour une feature définie

featureID
in query
string

featureID

200 OK

OK

type
array
default

unexpected error

Response Content-Types: application/json
Response Example (200 OK)
[
  {
    "ressourceID": "answerValue",
    "respondentID": "respondentID"
  }
]
Response Example (default )
{
  "status": 304,
  "message": "Some parameters are missing or not valid"
}

UserProfile

Get User Profile attribute

GET /data/attribute?respondentID=62341&appID=524

Permet de réucpérer les informations d'un utilisateur stockées dans le userProfile

respondentID
in query
string

RespondentID

appID
in query
string

appID

OK

default

unexpected error

Response Content-Types: application/json
Response Example (200 OK)
{
  "your_properties_name_1": "string",
  "your_properties_name_2": "string"
}
Response Example (default )
{
  "status": 304,
  "message": "Some parameters are missing or not valid"
}

Get User Profile

GET /data/userProfile?respondentID=342&appID=534

Permet de récupérer les informations d'un utilisateur stockées dans le userProfile

respondentID
in query
string

RespondentID

appID
in query
string

appID

200 OK

OK

type
object
default

unexpected error

Response Content-Types: application/json
Response Example (200 OK)
{
  "appID": "4325",
  "respondentID": "john-doe-4352",
  "attribute": {},
  "tag": {},
  "event": {}
}
Response Example (default )
{
  "status": 304,
  "message": "Some parameters are missing or not valid"
}

Update User Profile

POST /data/userProfile?respondentID=342&appID=534

The users data endpoint allows you to set user profile information

Filter

Request Example
{
  "appID": "string",
  "respondentID": "string",
  "attribute": {
    "your_properties_name_1": "string",
    "your_properties_name_2": "string"
  },
  "tag": {
    "favorite_sports": {
      "add": [
        "soccer",
        "skiing"
      ],
      "remove": [
        "natation"
      ]
    }
  },
  "event": {
    "dollar_spent": {
      "inc": 3
    },
    "last_login": "Date.now()"
  }
}
200 OK

OK

type
string
default

unexpected error

Response Content-Types: application/json
Response Example (200 OK)
"OK"
Response Example (default )
{
  "status": 304,
  "message": "Some parameters are missing or not valid"
}

Reset User Profile

POST /data/userProfile/reset

Reset the userProfil information

Request Example
{
  "appID": "appID",
  "respondentID": "respondentID"
}
200 OK

OK

type
string
default

unexpected error

Response Content-Types: application/json
Response Example (200 OK)
"OK"
Response Example (default )
{
  "status": 304,
  "message": "Some parameters are missing or not valid"
}

Bot Respondent

Get respondent

GET /data/botrespondent?respondentID=62341&appID=524

Permet de récupérer toutes les informations d'un utilisateur

respondentID
in query
string

RespondentID

appID
in query
string

appID

200 OK

OK

type
object
default

unexpected error

Response Content-Types: application/json
Response Example (200 OK)
{
  "appID": "4325",
  "respondentID": "john-doe-4352",
  "attribute": {},
  "tag": {},
  "event": {},
  "source": "web"
}
Response Example (default )
{
  "status": 304,
  "message": "Some parameters are missing or not valid"
}

Create Respondent

POST /data/botrespondent/create

Create a botRespondent Obj before he talks to the bot. Allow to create context even before he starts the conversation

Request Example
{
  "appID": "appID",
  "respondentID": "respondentID",
  "featureID": "startingFeatureID",
  "attribute": {
    "tel": "0600000000"
  },
  "tag": {
    "books_read": [
      "book_1",
      "book_2"
    ]
  },
  "event": {
    "numMessages": 0,
    "numConversations": 0
  }
}
200 OK

OK

type
string
default

unexpected error

Response Content-Types: application/json
Response Example (200 OK)
"OK"
Response Example (default )
{
  "status": 304,
  "message": "Some parameters are missing or not valid"
}

Go To live

POST /data/botrespondent/live

Force a botrespondent status to live chat

Request Example
{
  "appID": "appID",
  "respondentID": "respondentID"
}
200 OK

OK

type
string
default

unexpected error

Response Content-Types: application/json
Response Example (200 OK)
"OK"
Response Example (default )
{
  "status": 304,
  "message": "Some parameters are missing or not valid"
}

Go To Bot

POST /data/botrespondent/chatbot

Force a botrespondent to go back to the chatbot

Request Example
{
  "appID": "appID",
  "respondentID": "respondentID"
}
200 OK

OK

type
string
default

unexpected error

Response Content-Types: application/json
Response Example (200 OK)
"OK"
Response Example (default )
{
  "status": 304,
  "message": "Some parameters are missing or not valid"
}

Conversation

Handle conversation

POST /data/botrespondent/bot

Reprendre la conversation pour un user avec un nouveau bot

Request Example
{
  "appID": "appID",
  "respondentID": "respondentID",
  "featureID": "new featureID to send",
  "source": "web || fb || sms"
}
200 OK

OK

type
string
default

unexpected error

Response Content-Types: application/json
Response Example (200 OK)
"OK"
Response Example (default )
{
  "status": 304,
  "message": "Some parameters are missing or not valid"
}

Change respondentID

POST /conversation/changeRespondentID

Permet de changer le respondentID d'un utilisateur et de le rediriger vers une nouvelle feature

Request Example
{
  "recipient": {
    "id": "john@doe.com"
  },
  "newRecipient": {
    "id": "john@doejunior.com"
  },
  "newBotID": "featureID of the next feature"
}
200 OK

OK

type
string
default

unexpected error

Response Content-Types: application/json
Response Example (200 OK)
"OK"
Response Example (default )
{
  "status": 304,
  "message": "Some parameters are missing or not valid"
}

Close webview

POST /conversation/closeWebview

Permet de fermer la webview ouverte par un utilisateur sur le web

Request Example
{
  "respondentID": "john@doe.com"
}
200 OK

OK

type
string
default

unexpected error

Response Content-Types: application/json
Response Example (200 OK)
"OK"
Response Example (default )
{
  "status": 304,
  "message": "Some parameters are missing or not valid"
}

Typing

POST /conversation/typing

Start or stop typing (only web for now)
sender_action can be typingon or typingoff

Request Example
{
  "recipient": {
    "id": "respondentID"
  },
  "sender_action": "typingon"
}
200 OK

OK

type
string
default

unexpected error

Response Content-Types: application/json
Response Example (200 OK)
"OK"
Response Example (default )
{
  "status": 304,
  "message": "Some parameters are missing or not valid"
}

Notification

Send Notification

POST /notificationapi/api/sendCampaign

Envoyer une Notification

json valide de la notification

Request Example
{
  "appID": "string",
  "featureID": "string",
  "timestamp": "string",
  "type": "string",
  "filters": {
    "_id": "uniquestring",
    "owner": "uniquestring",
    "appID": "AppID de l'app",
    "respondents": [
      "string"
    ],
    "attribute": {
      "your_properties_name_1": {
        "operator": "=",
        "value": "John"
      }
    },
    "event": {
      "last_login": {
        "operator": "<",
        "value": "2017-10-30T18:22:44.598+0000",
        "type": "date"
      }
    },
    "tag": {
      "favorite_sports": {
        "operator": "OR",
        "value": [
          "natation",
          "soccer"
        ]
      }
    }
  },
  "messages": [
    {
      "type": "string",
      "text": "string",
      "url": "string",
      "carousel": [
        {
          "value": "string",
          "textDescriptiuon": "string",
          "mediaDescription": "Need to be a valid URL",
          "answers": [
            {
              "value": "string",
              "title": "string",
              "answerID": "string",
              "type": "string",
              "payload": "string",
              "url": "string",
              "goToPage": "number",
              "nextRessource": {
                "title": "Titre de la ressources",
                "ressourceID": "ID de la ressource suivante"
              },
              "goToBot": "string",
              "keywords": [
                "abc",
                "def"
              ],
              "filters": {
                "_id": "uniquestring",
                "owner": "uniquestring",
                "appID": "AppID de l'app",
                "respondents": [
                  "string"
                ],
                "attribute": {
                  "your_properties_name_1": {
                    "operator": "=",
                    "value": "John"
                  }
                },
                "event": {
                  "last_login": {
                    "operator": "<",
                    "value": "2017-10-30T18:22:44.598+0000",
                    "type": "date"
                  }
                },
                "tag": {
                  "favorite_sports": {
                    "operator": "OR",
                    "value": [
                      "natation",
                      "soccer"
                    ]
                  }
                }
              }
            }
          ],
          "filters": {
            "_id": "uniquestring",
            "owner": "uniquestring",
            "appID": "AppID de l'app",
            "respondents": [
              "string"
            ],
            "attribute": {
              "your_properties_name_1": {
                "operator": "=",
                "value": "John"
              }
            },
            "event": {
              "last_login": {}
            }
          }
        }
      ]
    }
  ]
}
200 OK

NotificationID

default

Some parameters are missing or not valid

Response Content-Types: application/json
Response Example (default )
{
  "status": 304,
  "message": "Some parameters are missing or not valid"
}

Get statistics

POST /notificationapi/api/getStatisticsCampaignSent/:notificationID

Statistique d'une Notification

notificationID
in path
object

notificationID

200 OK

OK

default

Some parameters are missing or not valid

Response Content-Types: application/json
Response Example (default )
{
  "status": 304,
  "message": "Some parameters are missing or not valid"
}

Schema Definitions

Application: object

appID: string

appID de la feature

title: string

Titre de la feature

description: string

Description de la feature

access_token: string

Access_token de la feature (pour les IM)

initSurveyID: string

initSurveyID de la feature

menuSurveyID: string

menu de la feature

AIgeneric: string

AIgeneric de la feature

features: FeatureResume
filters: Filter
design: object

Option de design pour le bot web

updatedAt: string

Date de la dernière mise à jour

createdAt: string

Date de création

owner: string

UserID du propriétaire

editors: array

john@doe.com, mark@fb.com

persistent_menu: PersistentMenu
payload: CallToAction
filterAvailable: object

Liste des filtres qui ont été définis pour cette application

Example
{
  "appID": "string",
  "title": "string",
  "description": "string",
  "access_token": "string",
  "initSurveyID": "string",
  "menuSurveyID": "string",
  "AIgeneric": "string",
  "features": [
    {
      "title": "string",
      "featureID": "string",
      "IAactive": "boolean"
    }
  ],
  "filters": {
    "_id": "uniquestring",
    "owner": "uniquestring",
    "appID": "AppID de l'app",
    "respondents": [
      "string"
    ],
    "attribute": {
      "your_properties_name_1": {
        "operator": "=",
        "value": "John"
      }
    },
    "event": {
      "last_login": {
        "operator": "<",
        "value": "2017-10-30T18:22:44.598+0000",
        "type": "date"
      }
    },
    "tag": {
      "favorite_sports": {
        "operator": "OR",
        "value": [
          "natation",
          "soccer"
        ]
      }
    }
  },
  "design": {
    "logo": {
      "url": "https://image.vizir.co/logo.png"
    },
    "picto": {
      "url": "https://image.vizir.co/logo.png"
    },
    "color": "#3BDDB8"
  },
  "updatedAt": "string",
  "createdAt": "string",
  "owner": "string",
  "editors": "array",
  "persistent_menu": {
    "locale": "fr",
    "composer_input_disabled": true,
    "call_to_actions": {
      "type": "fr",
      "title": "title",
      "payload": "PAYLOAD",
      "url": "Valid url",
      "call_to_actions": "a valid call_to_actions object",
      "goToBot": "Valid feature ID",
      "nextRessource": "Valid ressource ID"
    }
  },
  "payload": {
    "type": "fr",
    "title": "title",
    "payload": "PAYLOAD",
    "url": "Valid url",
    "call_to_actions": "a valid call_to_actions object",
    "goToBot": "Valid feature ID",
    "nextRessource": "Valid ressource ID"
  },
  "filterAvailable": {
    "list": [],
    "tag": {
      "list": [],
      "details": []
    },
    "attribute": {
      "list": [],
      "details": []
    },
    "event": {
      "list": [],
      "details": []
    }
  }
}

Feature: object

Voici le json de la feature.
feature: {isInProduction: true, json: json}

title: string

Titre de la feature

featureID: string

featureID de la feature

userID: string

Id du propriétaire de cette feature

app: string

Id de l'app'

helpText: HelpObject
questions: Ressource
filters: Filter
notDisplayFeatureID: string

Id de la feature à afficher si le user est filtré

Example
{
  "title": "string",
  "featureID": "string",
  "userID": "string",
  "app": "string",
  "helpText": {
    "invalidAnswer": "Oups ! Il semblerait que votre réponse n'est pas valide, pouvez vous la renseigner de nouveau",
    "date_validation": "Oups ! Il semblerait que la date soit erronée. Pourrais-tu le renseigner à nouveau au format DD/MM/YYYY ?",
    "email_validation": "Oups ! Il semblerait que ton email soit erroné. Pourrais-tu le renseigner à nouveau au format nom@entreprise.com ?",
    "number_validation": "Oups ! Il semblerait que ton numéro de téléphone soit erroné. Pourrais-tu le renseigner à nouveau au format 0600000000 ?"
  },
  "questions": [
    {
      "ressourceID": "135435T24",
      "title": "Intro name",
      "owner": "ID du createur de la ressource",
      "messages": [
        {
          "type": "string",
          "text": "string",
          "url": "string",
          "carousel": [
            {
              "value": "string",
              "textDescriptiuon": "string",
              "mediaDescription": "Need to be a valid URL",
              "answers": [
                {
                  "value": "string",
                  "title": "string",
                  "answerID": "string",
                  "type": "string",
                  "payload": "string",
                  "url": "string",
                  "goToPage": "number",
                  "nextRessource": {
                    "title": "Titre de la ressources",
                    "ressourceID": "ID de la ressource suivante"
                  },
                  "goToBot": "string",
                  "keywords": [
                    "abc",
                    "def"
                  ],
                  "filters": {
                    "_id": "uniquestring",
                    "owner": "uniquestring",
                    "appID": "AppID de l'app",
                    "respondents": [
                      "string"
                    ],
                    "attribute": {
                      "your_properties_name_1": {
                        "operator": "=",
                        "value": "John"
                      }
                    },
                    "event": {
                      "last_login": {
                        "operator": "<",
                        "value": "2017-10-30T18:22:44.598+0000",
                        "type": "date"
                      }
                    },
                    "tag": {
                      "favorite_sports": {
                        "operator": "OR",
                        "value": [
                          "natation",
                          "soccer"
                        ]
                      }
                    }
                  }
                }
              ],
              "filters": {
                "_id": "uniquestring",
                "owner": "uniquestring",
                "appID": "AppID de l'app",
                "respondents": [
                  "string"
                ],
                "attribute": {
                  "your_properties_name_1": {
                    "operator": "=",
                    "value": "John"
                  }
                },
                "event": {
                  "last_login": {
                    "operator": "<",
                    "value": "2017-10-30T18:22:44.598+0000",
                    "type": "date"
                  }
                },
                "tag": {
                  "favorite_sports": {
                    "operator": "OR",
                    "value": [
                      "natation",
                      "soccer"
                    ]
                  }
                }
              }
            }
          ],
          "filters": {
            "_id": "uniquestring",
            "owner": "uniquestring",
            "appID": "AppID de l'app",
            "respondents": [
              null
            ]
          }
        }
      ]
    }
  ]
}

FeatureResume: object

title: string

Titre de la feature

featureID: string

featureID de la feature

IAactive: boolean
Example
{
  "title": "string",
  "featureID": "string",
  "IAactive": "boolean"
}

Ressource: object

ressourceID: string

QuestionID

title: string

Title of your ressource

owner: string

ID du createur de la ressource

messages: Message
answers: Answer
askIfKnown: boolean

true if not defined

validate: ValidationObject
properties: PropertiesObject
helpText: HelpObject
actions: ActionObject
Example
{
  "ressourceID": "135435T24",
  "title": "Intro name",
  "owner": "ID du createur de la ressource",
  "messages": [
    {
      "type": "string",
      "text": "string",
      "url": "string",
      "carousel": [
        {
          "value": "string",
          "textDescriptiuon": "string",
          "mediaDescription": "Need to be a valid URL",
          "answers": [
            {
              "value": "string",
              "title": "string",
              "answerID": "string",
              "type": "string",
              "payload": "string",
              "url": "string",
              "goToPage": "number",
              "nextRessource": {
                "title": "Titre de la ressources",
                "ressourceID": "ID de la ressource suivante"
              },
              "goToBot": "string",
              "keywords": [
                "abc",
                "def"
              ],
              "filters": {
                "_id": "uniquestring",
                "owner": "uniquestring",
                "appID": "AppID de l'app",
                "respondents": [
                  "string"
                ],
                "attribute": {
                  "your_properties_name_1": {
                    "operator": "=",
                    "value": "John"
                  }
                },
                "event": {
                  "last_login": {
                    "operator": "<",
                    "value": "2017-10-30T18:22:44.598+0000",
                    "type": "date"
                  }
                },
                "tag": {
                  "favorite_sports": {
                    "operator": "OR",
                    "value": [
                      "natation",
                      "soccer"
                    ]
                  }
                }
              }
            }
          ],
          "filters": {
            "_id": "uniquestring",
            "owner": "uniquestring",
            "appID": "AppID de l'app",
            "respondents": [
              "string"
            ],
            "attribute": {
              "your_properties_name_1": {
                "operator": "=",
                "value": "John"
              }
            },
            "event": {
              "last_login": {
                "operator": "<",
                "value": "2017-10-30T18:22:44.598+0000",
                "type": "date"
              }
            },
            "tag": {
              "favorite_sports": {
                "operator": "OR",
                "value": [
                  "natation",
                  "soccer"
                ]
              }
            }
          }
        }
      ],
      "filters": {
        "_id": "uniquestring",
        "owner": "uniquestring",
        "appID": "AppID de l'app",
        "respondents": [
          "string"
        ],
        "attribute": {
          "your_properties_name_1": {
            "operator": "=",
            "value": "John"
          }
        },
        "event": {
          "last_login": {
            "operator": "<",
            "value": "2017-10-30T18:22:44.598+0000"
          }
        }
      }
    }
  ]
}

Message: object

type: string

Le type peut être text, image, video, audio ou carousel

text: string

Obligatoire dans le cas d'un message de type text

url: string

Obligatoire dans le cas d'un message de type image, vidéo ou audio

carousel: CarouselEntry

Obligatoire dans le cas d'un message de type carousel

filters: Filter

Permet d'affiche la réponse que à certains utilisateurs

Example
{
  "type": "string",
  "text": "string",
  "url": "string",
  "carousel": [
    {
      "value": "string",
      "textDescriptiuon": "string",
      "mediaDescription": "Need to be a valid URL",
      "answers": [
        {
          "value": "string",
          "title": "string",
          "answerID": "string",
          "type": "string",
          "payload": "string",
          "url": "string",
          "goToPage": "number",
          "nextRessource": {
            "title": "Titre de la ressources",
            "ressourceID": "ID de la ressource suivante"
          },
          "goToBot": "string",
          "keywords": [
            "abc",
            "def"
          ],
          "filters": {
            "_id": "uniquestring",
            "owner": "uniquestring",
            "appID": "AppID de l'app",
            "respondents": [
              "string"
            ],
            "attribute": {
              "your_properties_name_1": {
                "operator": "=",
                "value": "John"
              }
            },
            "event": {
              "last_login": {
                "operator": "<",
                "value": "2017-10-30T18:22:44.598+0000",
                "type": "date"
              }
            },
            "tag": {
              "favorite_sports": {
                "operator": "OR",
                "value": [
                  "natation",
                  "soccer"
                ]
              }
            }
          }
        }
      ],
      "filters": {
        "_id": "uniquestring",
        "owner": "uniquestring",
        "appID": "AppID de l'app",
        "respondents": [
          "string"
        ],
        "attribute": {
          "your_properties_name_1": {
            "operator": "=",
            "value": "John"
          }
        },
        "event": {
          "last_login": {
            "operator": "<",
            "value": "2017-10-30T18:22:44.598+0000",
            "type": "date"
          }
        },
        "tag": {
          "favorite_sports": {
            "operator": "OR",
            "value": [
              "natation",
              "soccer"
            ]
          }
        }
      }
    }
  ],
  "filters": {
    "_id": "uniquestring",
    "owner": "uniquestring",
    "appID": "AppID de l'app",
    "respondents": [
      "string"
    ],
    "attribute": {
      "your_properties_name_1": {
        "operator": "=",
        "value": "John"
      }
    },
    "event": {
      "last_login": {
        "operator": "<",
        "value": "2017-10-30T18:22:44.598+0000",
        "type": "date"
      }
    },
    "tag": {
      "favorite_sports": {
        "operator": "OR"
      }
    }
  }
}

Answer: object

value: string
title: string
answerID: string
type: string

Type peut être égal à: location, button, url, share (only in carousel message)

payload: string

Permet d'envoyer au serveur une autre valeur que la valeur indiqué sur le bouton.
Required dans le cas d'une réponse dans un carousel

url: string

Afficher uniquement pour les type de réponse url. L'url doit être valide.

goToPage: number
nextRessource: object

On peut indiquer directement

  • l'id de la ressource,

goToBot: string

On peut indiquer directement

  • l'id de la feature,
  • previous_feature: qui renvoie vers la feature précédente,
  • d2745253__currentindex: renvoie vers la feature indiqué à l'index ou le user s'est arreté s'il a déjà répondu à cette feature

keywords: Array

Permet d'accepter d'autres valeurs que la valeur indiqué dans le bouton. Si la valeur est oui, on peut accepter sans souci les réponse yes, ok, ...

filters: Filter

Permet d'affiche la réponse que à certains utilisateurs

Example
{
  "value": "string",
  "title": "string",
  "answerID": "string",
  "type": "string",
  "payload": "string",
  "url": "string",
  "goToPage": "number",
  "nextRessource": {
    "title": "Titre de la ressources",
    "ressourceID": "ID de la ressource suivante"
  },
  "goToBot": "string",
  "keywords": [
    "abc",
    "def"
  ],
  "filters": {
    "_id": "uniquestring",
    "owner": "uniquestring",
    "appID": "AppID de l'app",
    "respondents": [
      "string"
    ],
    "attribute": {
      "your_properties_name_1": {
        "operator": "=",
        "value": "John"
      }
    },
    "event": {
      "last_login": {
        "operator": "<",
        "value": "2017-10-30T18:22:44.598+0000",
        "type": "date"
      }
    },
    "tag": {
      "favorite_sports": {
        "operator": "OR",
        "value": [
          "natation",
          "soccer"
        ]
      }
    }
  }
}

CarouselEntry: object

value: string
textDescriptiuon: string
mediaDescription: string
answers: Answer

Pour les réponses de carousel: value, type et postback ou url sont obligatoire. On ne peut pas avoir en même temps un postback et une url

filters: Filter

Permet d'affiche la réponse que à certains utilisateurs

Example
{
  "value": "string",
  "textDescriptiuon": "string",
  "mediaDescription": "Need to be a valid URL",
  "answers": [
    {
      "value": "string",
      "title": "string",
      "answerID": "string",
      "type": "string",
      "payload": "string",
      "url": "string",
      "goToPage": "number",
      "nextRessource": {
        "title": "Titre de la ressources",
        "ressourceID": "ID de la ressource suivante"
      },
      "goToBot": "string",
      "keywords": [
        "abc",
        "def"
      ],
      "filters": {
        "_id": "uniquestring",
        "owner": "uniquestring",
        "appID": "AppID de l'app",
        "respondents": [
          "string"
        ],
        "attribute": {
          "your_properties_name_1": {
            "operator": "=",
            "value": "John"
          }
        },
        "event": {
          "last_login": {
            "operator": "<",
            "value": "2017-10-30T18:22:44.598+0000",
            "type": "date"
          }
        },
        "tag": {
          "favorite_sports": {
            "operator": "OR",
            "value": [
              "natation",
              "soccer"
            ]
          }
        }
      }
    }
  ],
  "filters": {
    "_id": "uniquestring",
    "owner": "uniquestring",
    "appID": "AppID de l'app",
    "respondents": [
      "string"
    ],
    "attribute": {
      "your_properties_name_1": {
        "operator": "=",
        "value": "John"
      }
    },
    "event": {
      "last_login": {
        "operator": "<",
        "value": "2017-10-30T18:22:44.598+0000",
        "type": "date"
      }
    },
    "tag": {
      "favorite_sports": {
        "operator": "OR",
        "value": [
          "natation",
          "soccer"
        ]
      }
    }
  }
}

Filter: object

Il est possible de filtrer les utilisateurs suivant plusieurs paramètres:

  • respondents: Permet d'envoyer des notifications à des utilisateurs ciblé avec leur respondentID.
  • attribute: Permet de segmenter ses utilisateurs en fonction des attributs des utilisateurs que nous avons stocker dans le profil de l'utilisateur. Les attributs sont des varibales 'invariables' pour chaque utilisateur, c'est à dire que cette value ne doit pas être amené à varié au cours du temps (prénom, nom, date de naissance, ...)
  • tag: Permet de segementer en fonction des tags que vous avez ajouter au profil utilisateur. Les tags sont utilisés de la même façon que les tags sur des site e-commerce. Ils permettent par exemple de recenser les activités pratiquées par un utilisateur.
  • event: Event permet de segmenter sa base utilisateur en fonction d'événements liés aux actions des utilisateurs du bot. Event permet de stocker la date de dernière connexion, le montant dépenser dépenser par un utilisateur, ....

Pour renseigner ces informations dans le profil utilisateur voir la section sur le user Profile

_id: string
owner: string
appID: string

needed to preview the list of respondents

respondents: string[]
attribute: AttributeFilter
event: EventFilter
tag: TagFilter
Example
{
  "_id": "uniquestring",
  "owner": "uniquestring",
  "appID": "AppID de l'app",
  "respondents": [
    "string"
  ],
  "attribute": {
    "your_properties_name_1": {
      "operator": "=",
      "value": "John"
    }
  },
  "event": {
    "last_login": {
      "operator": "<",
      "value": "2017-10-30T18:22:44.598+0000",
      "type": "date"
    }
  },
  "tag": {
    "favorite_sports": {
      "operator": "OR",
      "value": [
        "natation",
        "soccer"
      ]
    }
  }
}

Notification: object

appID: string
featureID: string
timestamp: string
type: string

message, specific, recurrent

filters: Filter
messages: Message
answers: Answer
startTime: string

Only for recurrent

delay: number

Only for recurrent

newActiveStatus: boolean
doNotTurnOff: boolean
isSent: boolean

Permet de savoir si la notification à été envoyée

numRecipients: number

Permet de savoir si la notification à été envoyée

createdAt: date
updatedAt: date
Example
{
  "appID": "string",
  "featureID": "string",
  "timestamp": "string",
  "type": "string",
  "filters": {
    "_id": "uniquestring",
    "owner": "uniquestring",
    "appID": "AppID de l'app",
    "respondents": [
      "string"
    ],
    "attribute": {
      "your_properties_name_1": {
        "operator": "=",
        "value": "John"
      }
    },
    "event": {
      "last_login": {
        "operator": "<",
        "value": "2017-10-30T18:22:44.598+0000",
        "type": "date"
      }
    },
    "tag": {
      "favorite_sports": {
        "operator": "OR",
        "value": [
          "natation",
          "soccer"
        ]
      }
    }
  },
  "messages": [
    {
      "type": "string",
      "text": "string",
      "url": "string",
      "carousel": [
        {
          "value": "string",
          "textDescriptiuon": "string",
          "mediaDescription": "Need to be a valid URL",
          "answers": [
            {
              "value": "string",
              "title": "string",
              "answerID": "string",
              "type": "string",
              "payload": "string",
              "url": "string",
              "goToPage": "number",
              "nextRessource": {
                "title": "Titre de la ressources",
                "ressourceID": "ID de la ressource suivante"
              },
              "goToBot": "string",
              "keywords": [
                "abc",
                "def"
              ],
              "filters": {
                "_id": "uniquestring",
                "owner": "uniquestring",
                "appID": "AppID de l'app",
                "respondents": [
                  "string"
                ],
                "attribute": {
                  "your_properties_name_1": {
                    "operator": "=",
                    "value": "John"
                  }
                },
                "event": {
                  "last_login": {
                    "operator": "<",
                    "value": "2017-10-30T18:22:44.598+0000",
                    "type": "date"
                  }
                },
                "tag": {
                  "favorite_sports": {
                    "operator": "OR",
                    "value": [
                      "natation",
                      "soccer"
                    ]
                  }
                }
              }
            }
          ],
          "filters": {
            "_id": "uniquestring",
            "owner": "uniquestring",
            "appID": "AppID de l'app",
            "respondents": [
              "string"
            ],
            "attribute": {
              "your_properties_name_1": {
                "operator": "=",
                "value": "John"
              }
            },
            "event": {
              "last_login": {
                "operator": "<"
              }
            }
          }
        }
      ]
    }
  ]
}

FilterSetter: object

appID: string
respondentID: string
attribute: AttributeSetter
tag: TagSetter
event: EventSetter
Example
{
  "appID": "string",
  "respondentID": "string",
  "attribute": {
    "your_properties_name_1": "string",
    "your_properties_name_2": "string"
  },
  "tag": {
    "favorite_sports": {
      "add": [
        "soccer",
        "skiing"
      ],
      "remove": [
        "natation"
      ]
    }
  },
  "event": {
    "dollar_spent": {
      "inc": 3
    },
    "last_login": "Date.now()"
  }
}

AttributeSetter: object

your_properties_name_1: string
your_properties_name_2: string
Example
{
  "your_properties_name_1": "string",
  "your_properties_name_2": "string"
}

AttributeFilter: object

your_properties_name_1: AttributeFilterDetail
Example
{
  "your_properties_name_1": {
    "operator": "=",
    "value": "John"
  }
}

AttributeFilterDetail: object

Operator can be =, <>, <, > with the following definition

  • =: Equal to
  • <>: Different of
  • >: > to (only for number)
  • <: < to (only for number)
  • isDefined: all the users whom the value is defined, put value: null in this case
  • isNotDefined: all the users whom the value is not set, put value: null in this case

operator: string
value: string | number
Example
{
  "operator": "=",
  "value": "John"
}

TagSetter: object

favorite_sports: TagSetterDetail
Example
{
  "favorite_sports": {
    "add": [
      "soccer",
      "skiing"
    ],
    "remove": [
      "natation"
    ]
  }
}

TagSetterDetail: object

operator can be add or remove

add: array
remove: array
Example
{
  "add": [
    "soccer",
    "skiing"
  ],
  "remove": [
    "natation"
  ]
}

TagFilter: object

favorite_sports: TagFilterDetail
Example
{
  "favorite_sports": {
    "operator": "OR",
    "value": [
      "natation",
      "soccer"
    ]
  }
}

TagFilterDetail: object

Operator can be OR, AND with the following definition

  • OR: Contains any of '$value'
  • AND: Contains all of '$value'

operator: string
value: array
Example
{
  "operator": "OR",
  "value": [
    "natation",
    "soccer"
  ]
}

EventSetter: object

dollar_spent: EventSetterDetailInc
last_login: Date
Example
{
  "dollar_spent": {
    "inc": 3
  },
  "last_login": "Date.now()"
}

EventFilter: object

last_login: EventFilterDetail
Example
{
  "last_login": {
    "operator": "<",
    "value": "2017-10-30T18:22:44.598+0000",
    "type": "date"
  }
}

EventFilterDetail: object

Operator can be >, <, = with the following definition

  • >: is greater (or posterior to if date) than '$value'
  • =: is equal to '$value'
  • <: is less than (or anteriror to if date) '$value'

operator: string
value: string (for date) | number
type: date or number
Example
{
  "operator": "<",
  "value": "2017-10-30T18:22:44.598+0000",
  "type": "date"
}

EventSetterDetailInc: object

operator can be inc or dec or Date at javascript format new Date()

inc: number
Example
{
  "inc": 3
}

ValidationObject: object

active: boolean

Est ce qu'on active la validation de la réponse du user

type: string

email, nombre, phone-fr, api, regex

rule: string

Permet de personnaliser sa propre règle de personnalisation regex, afficher si le type est perso

api: string

url de l'api à appeler pour faire la verification, l'api doit simplement retourner 200 si la réponse est valide ou 304 si la réponse est invalide

Example
{
  "active": "boolean",
  "type": "string",
  "rule": "string",
  "api": "string"
}

PropertiesObject: object

active: boolean

Est ce qu'on active la validation de la réponse du user

type: string

email, nombre, phone-fr ou perso ou api

rule: string

Permet de personnaliser sa propre règle de personnalisation regex, afficher si le type est perso

api: string

url de l'api à appeler pour faire la verification, l'api doit simplement retourner 200 si la réponse est valide ou 304 si la réponse est invalide

attribute: AttributeSetter
tag: TagSetter
event: EventSetter
Example
{
  "active": "boolean",
  "type": "string",
  "rule": "string",
  "api": "string",
  "attribute": {
    "your_properties_name_1": "string",
    "your_properties_name_2": "string"
  },
  "tag": {
    "favorite_sports": {
      "add": [
        "soccer",
        "skiing"
      ],
      "remove": [
        "natation"
      ]
    }
  },
  "event": {
    "dollar_spent": {
      "inc": 3
    },
    "last_login": "Date.now()"
  }
}

ActionObject: object

active: boolean
webhook: webhookObj
Example
{
  "active": true,
  "webhook": {
    "active": true,
    "type": "POST",
    "url": "https://api.test.com",
    "params": [
      {
        "title": "name",
        "value": "John"
      }
    ]
  }
}

webhookObj: object

active: boolean
type: string
url: string
params: array
Example
{
  "active": true,
  "type": "POST",
  "url": "https://api.test.com",
  "params": [
    {
      "title": "name",
      "value": "John"
    }
  ]
}

HelpObject: object

invalidAnswer: boolean
date_validation: string
email_validation: string
number_validation: string
Example
{
  "invalidAnswer": "Oups ! Il semblerait que votre réponse n'est pas valide, pouvez vous la renseigner de nouveau",
  "date_validation": "Oups ! Il semblerait que la date soit erronée. Pourrais-tu le renseigner à nouveau au format DD/MM/YYYY ?",
  "email_validation": "Oups ! Il semblerait que ton email soit erroné. Pourrais-tu le renseigner à nouveau au format nom@entreprise.com ?",
  "number_validation": "Oups ! Il semblerait que ton numéro de téléphone soit erroné. Pourrais-tu le renseigner à nouveau au format 0600000000 ?"
}

User: object

last_name: string
first_name: string
created_at: string
avatar_url: string
Example
{
  "last_name": "John",
  "first_name": "Doe",
  "created_at": "2018-03-30T08:08:43.058Z",
  "avatar_url": "https://myprolie.jpg"
}

LoginSuccess: object

status: string
token: string
Example
{
  "status": "ok",
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9....."
}

ForgetPasswordSuccess: object

status: string
message: string
Example
{
  "status": "ok",
  "message": "The email to reinitialize your password was sent"
}

PersistentMenu: object

locale: string
composer_input_disabled: boolean
call_to_actions: CallToAction
Example
{
  "locale": "fr",
  "composer_input_disabled": true,
  "call_to_actions": {
    "type": "fr",
    "title": "title",
    "payload": "PAYLOAD",
    "url": "Valid url",
    "call_to_actions": "a valid call_to_actions object",
    "goToBot": "Valid feature ID",
    "nextRessource": "Valid ressource ID"
  }
}

CallToAction: object

type: string

can be postback, web_url, nested

title: string
payload: string

Needed if type is postback

url: string

Needed if type is web_url

call_to_actions: array

Needed if type is nested

goToBot: string

Only for type postback

nextRessource: string

Only for type postback

Example
{
  "type": "fr",
  "title": "title",
  "payload": "PAYLOAD",
  "url": "Valid url",
  "call_to_actions": "a valid call_to_actions object",
  "goToBot": "Valid feature ID",
  "nextRessource": "Valid ressource ID"
}

AnswerByFeature: object

appID: string
respondentID: string
featureID: string
answers: Answers
Example
{
  "appID": "string",
  "respondentID": "string",
  "featureID": "string",
  "answers": {
    "questionIndex": "integer",
    "questionID": "string",
    "timestamp": "date",
    "response": [
      "answer_1",
      "answer_2"
    ]
  }
}

Answers: array

Example
{
  "questionIndex": "integer",
  "questionID": "string",
  "timestamp": "date",
  "response": [
    "answer_1",
    "answer_2"
  ]
}

ApplicationStatistics: object

status: string
data: object
Example
{
  "status": "OK",
  "data": {
    "total": 0,
    "daily": 0,
    "weekly": 0
  }
}

ErrorModel: object

status: integer (int32)
message: string
Example
{
  "status": 304,
  "message": "Some parameters are missing or not valid"
}