Skip to main content
POST/product-event-creation/:custom_id/

Create product event (alternative)

There's an alternative endpoint for creating a product event assigned to a specific user.
If your products have custom IDs with "/" character, the standard endpoint will not work and you need to use the endpoint given below:

AttributesTypeRequiredDescription
user_idintegeryesA unique identifier for the user which is given by User.com automatically.
user_custom_idstringyesThe unique identifier for the user which is provided by the client.
custom_idstringnoA unique identifier for the product provided by the client.
datajsonyesA valid JSON object with additional data (attributes). Special "custom_data" key may contain additional custom json defined data unique per product event occurence.
event_typestringyesA prefined event type. Find defined choices: https://docs.user.com/how-to-create-product-events/
timestamptimestampyesA datetime when an event occured in UNIX format.

Request​

curl -X POST
"https://<your_app_subdomain>.user.com/api/public/product-event-creation/:custom_id/"
-H 'authorization: Token <your_64_char_api_key>'
-H 'content-type: application/json'
-d '{
"user_id": 431, // OR use user_custom_id
"event_type": "order",
"timestamp": 1426967129,
"data": {
"create attribute for product": "my value",
"custom_data": {
"custom attr": "json data"
}
}
}'

Response​

{
"id": 388
}