Search results for "{{ search.query }}"

No results found for "{{search.query}}". 
View All Results

Create an event

POST /v1/accounts/{license_code}/events
Host: api.webengage.com

Request

Parameter
Type
Description
Mandatory

userId

String

UserId to identify a user uniquely. Either userId or anonymousId is mandatory.

No

eventName

String

Name of the event

Yes

eventTime

String

Date and Time when the event occurred in a valid date format

No

eventData

Object

Event attributes in key:value pair.
For example:
{"number_of_items": 5, "category": "Clothes"}

No

anonymousId

String

Id to identify anonymous users, those who've not logged in yet. Either userId or anonymousId is mandatory. In case both ids are sent, anonymous id will be ignored.

No

Sample Request

{
    "userId": "~13410605b",
    "eventName": "Flight Searched",
    "eventTime": "",
    "eventData": {
        "from": "Mumbai",
        "to": "Delhi",
        "Number Of Passengers": 2,
        "type": "Domestic"
    }
}
{
    "anonymousId": "a4775fe7-edcd-4bd1-b226-516a7acf30d3",
    "eventName": "Flight Searched",
    "eventData": {
        "from": "Mumbai",
        "to": "Delhi",
        "Number Of Passengers": 2,
        "type": "Domestic"
    }
}

Response

HTTP Status 201 - application/json.

{
    "response": {
        "status": "success"
    }
}

HTTP Status 400 - application/json. If the userId or eventName is missing or the eventTime is not in a valid date format.

{
    "response": {
        "message": "{ERROR_MESSGAE}", //e.g. "Error: userId cannot be empty"
        "status": "error"
    }
}

Events