Skip to main content
Contributor I
May 17, 2024
Solved

Creating multiple events using event-bulk-create-jobs fails when unique_id is added

  • May 17, 2024
  • 1 reply
  • 181 views

When using the Bulk Create Events API I am able to create multiple events for the same profile.

However, as soon as I add the unique_id property to the event object the request fails with error 500.

Example request body:

{
"data":{
"type":"event-bulk-create-job",
"attributes":{
"events-bulk-create":{
"data":[
{
"type":"event-bulk-create",
"attributes":{
"profile":{
"data":{
"type":"profile",
"attributes":{
"email":"dev@user.com",
"first_name":"Dev",
"last_name":"User"
}
}
},
"events":{
"data":[
{
"type":"event",
"attributes":{
"unique_id":"test",
"properties":{
"name":"My event"
},
"metric":{
"data":{
"type":"metric",
"attributes":{
"name":"My event",
"service":"api"
}
}
}
}
}
]
}
}
}
]
}
}
}
}

Response error

{
"errors":[
{
"id":"4bcdd0f7-f1f2-4e6e-b9d8-ab3415d88b3c",
"status":500,
"code":"error",
"title":"A server error occurred.",
"detail":"A server error occurred.",
"source":{
"pointer":"/data/"
}
}
]
}

 

    This topic has been closed for replies.
    Best answer by chloe.strange

    Hi @dennyserejo 

    Thanks for reaching out - the 500 server error you’re encountering when adding the unique_id property to the event object in your Bulk Create Events API request indicates an issue on the server-side. Here are a few steps to troubleshoot and potentially resolve this issue (also here is our API documentation):

    • Verify unique_id format: Ensure the unique_id property adheres to any specific format or constraints required by the API.
    • Test with different unique_id values: Use various unique values for unique_id to rule out conflicts or specific value-related issues.
    • Simplify and isolate: Test the request with a single event and unique_id to isolate the issue.

    ~Chloe

    1 reply

    chloe.strange
    Community Manager
    Community Manager
    May 24, 2024

    Hi @dennyserejo 

    Thanks for reaching out - the 500 server error you’re encountering when adding the unique_id property to the event object in your Bulk Create Events API request indicates an issue on the server-side. Here are a few steps to troubleshoot and potentially resolve this issue (also here is our API documentation):

    • Verify unique_id format: Ensure the unique_id property adheres to any specific format or constraints required by the API.
    • Test with different unique_id values: Use various unique values for unique_id to rule out conflicts or specific value-related issues.
    • Simplify and isolate: Test the request with a single event and unique_id to isolate the issue.

    ~Chloe