Events

GET /events

Retrieve a list events

Parameter

Type

Required

Description

limit

query

No

Items per page returned. Default: 25, Max: 100

page

query

No

Number of the page returned. Default: 0

Example

curl -X GET \
'https://api.woowup.com/apiv3/events?limit=100&page=0' \
-H 'accept: application/json' \
-H 'authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
-H 'cache-control: no-cache'

Response

[
{
"id": 1234,
"name": "view-product",
"createtime": "2017-05-10 14:32:12"
},
{
"id": 1235,
"name": "view-category",
"createtime": "2017-05-10 14:32:12"
},
{
"id": 1236,
"name": "purchase-product",
"createtime": "2017-05-10 14:32:12"
}
]

Errors

HttpCode

HttpCode Name

Code

Description

200

ok

ok

Request successful

400

bad request

bad_request

Invalid parameters, view message for more details

500

internal error

internal_error

Unexpected error

POST /events

Create a new event.

Parameter

Required

Description

name

Yes

Event name, only accepted alphanumeric characters and "-"

JSON Body format

{
"name": "view-product"
}

Example

This is a curl example:

curl -X POST \
https://api.woowup.com/apiv3/events \
-H 'accept: application/json' \
-H 'authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
-H 'cache-control: no-cache' \
-d '{
"name": "view-product"
}'

Response

This is a curl example:

{
"id": 1234
"name": "view-product",
"createtime": "2017-07-21 13:43:29"
}

Errors

HttpCode

HttpCode Name

Code

Description

200

ok

ok

Request successful

400

bad request

bad_request

Invalid parameters or duplicated event, view message for more details

500

internal error

internal_error

Unexpected error

POST /user-events

Associate an event to user

JSON Body format

{
"event": "view-product",
"service_uid": "example@email.com",
"datetime": "2017-06-21 09:52:12",
"metadata": {
"campo 1": "valor 1",
"campo 2": "valor 2",
}
}

Recuerda que el "service_uid" puede variar. Hay cuentas que utilizan el correo y otras que pueden usar el documento o un id interno. Utilizar el indicado para tu cuenta, en caso de no saber cual es consulta con el equipo de soporte.

Si se envia el campo "datetime" en el formato del ejemplo, por default interpreta que esta en UTC. Para utilizar tu timezone, es necesario formatear la fecha bajo el standard ISO 8601.

Ejemplo GMT-5: 2004-02-12T15:19:21-05:00

Example

This is a curl example:

curl -X POST \
https://api.woowup.com/apiv3/user-events \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
-H 'cache-control: no-cache' \
-d '{ "event": "view-product", "service_uid": "example@email.com", "datetime": "2017-06-21 09:52:12", "metadata": { "campo 1": "valor 1" } }'

Errors

HttpCode

HttpCode Name

Code

Description

200

ok

ok

Request successful

400

bad request

bad_request

Invalid parameters or duplicated event, view message for more details

404

not found

not_found

Event or user not found, view message for more details

500

internal error

internal_error

Unexpected error

GET /user-events

Retrieve a list of user events

Parameter

Type

Required

Description

limit

query

No

Items per page returned. Default: 25, Max: 100

page

query

No

Number of the page returned. Default: 0

service_uid

query

No

service_uid of user

event

query

No

event name

Example

curl -X GET \
'https://api.woowup.com/apiv3/user-events' \
-H 'accept: application/json' \
-H 'authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
-H 'cache-control: no-cache'

Response

{
"payload": [
{
"id": 1,
"event": {
"id": 1,
"name": "ingreso-club",
"createtime": "2017-07-18 12:54:37"
},
"user": {
"userapp_id": 37679,
"user_id": 37791,
"service_uid": "user@customer.com",
"email": "user@customer.com"
},
"datetime": "2017-07-18 10:05:03",
"metadata": null
},
{
"id": 2,
"event": {
"id": 1,
"name": "ingreso-club",
"createtime": "2017-07-18 12:54:37"
},
"user": {
"userapp_id": 37679,
"user_id": 37791,
"service_uid": "user@customer.com",
"email": "user@customer.com"
},
"datetime": "2017-07-18 10:05:38",
"metadata": null
}
],
"message": "ok",
"code": "ok",
"time": "1159ms"
}

Errors

HttpCode

HttpCode Name

Code

Description

200

ok

ok

Request successful

400

bad request

bad_request

Invalid parameters or duplicated event, view message for more details

500

internal error

internal_error

Unexpected error

delete
Delete event

https://api.woowup.com/apiv3/events/{id}
Delete an event
Request
Response
Request
Response
200: OK
{
"payload": [],
"message": "",
"code": "ok",
"time": "52ms"
}
404: Not Found
{
"payload": [],
"message": "event not found",
"code": "not_found",
"time": "39ms"
}
500: Internal Server Error
{
"payload": [],
"message": "",
"code": "internal_error",
"time": "72ms"
}

Example

curl -X DELETE \
https://api.woowup.com/apiv3/events/999999 \
-H 'Accept: application/json' \
-H 'Authorization: Basic XXXXXXXXXXXXXXXXXXXX' \
-H 'Content-Type: application/json' \

Response

{
"payload": [],
"message": "",
"code": "ok",
"time": "52ms"
}

delete
Delete user events (bulk)

https://api.woowup.com/apiv3/user-events/bulk
Request
Response
Request
Body Parameters
event_name
required
string
from
required
string
date format YYYY-MM-DD hh:mm:ss
to
required
string
date format YYYY-MM-DD hh:mm:ss
notify_to
optional
string
email to receive the confirmation
Response
200: OK
will be receive an email when the deletion process is finished
{
"payload": {
"request_id": "XXX"
},
"message": "ok",
"code": "ok",
"time": "111ms"
}
400: Bad Request
//bad_request
{
"payload": {
"errors": [
"Failed matching any of the provided schemas."
]
},
"message": "bad request",
"code": "bad_request",
"time": "38ms"
}
//invalid_email
{
"payload": [],
"message": "Invalid email to notify",
"code": "invalid_email",
"time": "48ms"
}
403: Forbidden
{
"payload": [],
"message": "forbidden: authentication failed",
"code": "forbidden",
"time": "7ms"
}
404: Not Found
{
"payload": {
"errors": [
"event not found"
]
},
"message": "event not found",
"code": "not_found",
"time": "51ms"
}
500: Internal Server Error
{
"payload": [],
"message": "",
"code": "internal_error",
"time": "72ms"
}

Example

curl -X DELETE \
https://api.woowup.com/apiv3/user-events/bulk \
-H 'Accept: application/json' \
-H 'Authorization: Basic XXXXXXXXXXXXXXXXXXXX' \
-H 'Content-Type: application/json' \
-d '{
"event-name": "eventExample"
"from": "2019-07-01",
"to": "2019-07-31",
"notify_to": "test@email.com"
}'

Response

{
"payload": {
"request_id": "XXX"
},
"message": "ok",
"code": "ok",
"time": "111ms"
}