Skip to main content
Solved

Empty event is created with 202 by klaviyo api gem

  • March 10, 2024
  • 5 replies
  • 91 views

Forum|alt.badge.img

Hi Folks,

 

I am using https://github.com/klaviyo/klaviyo-api-ruby to integrate with our app and create events.

I am using version 6.0.0 of the gem.

The response i get is 202 as shown below when i call the createEvent API with the payload shown below

The payload being sent as part of create event api is as follows:


  {"data"=>
    {"type"=>"event",
     "attributes"=>
      {"time"=>"2024-03-10T18:58:28.525Z",
       "metric"=>{"data"=>{"type"=>"metric", "attributes"=>{"name"=>"record.create"}}},
       "profile"=>
        {"data"=>
          {"type"=>"profile",
           "attributes"=>
            {"email"=>"john@gmail.com",
             "first_name"=>"John Doe",
             "last_name"=>nil,
             "id"=>"7c424f7b-e07f-41b6-922e-06169081e9fe",
             "properties"=>{"$profile.id"=>"7c424f7b-e07f-41b6-922e-06169081e9fe", "$profile.account.id"=>"79f7fc83-f706-47cd-9181-e4bf4a54e7cd"}}}},
       "properties"=>
        {"event.action"=>"create",
         "record.id"=>"8e0f3513-d6ea-4ba5-b31d-60ddfe125a90",
         "record.account.id"=>"79f7fc83-f706-47cd-9181-e4bf4a54e7cd",
         "record.subject.first_name"=>”John Does",
         "record.subject.last_name"=>nil,
         "record.subject.date_of_birth"=>nil,
         "record.subject.date_of_kindergarten"=>nil}}}}
 

 

However, It ends up creating an empty event with no metric as shown below:

 

Could please let me know what could be wrong with the data?

Best answer by Brian Turcotte

Hi @sharat94!

My apologies for the delay here!

Is this still occurring for you?

- Brian

View original
Did this topic or the replies in the thread help you find an answer to your question?

5 replies

Brian Turcotte
Forum|alt.badge.img+37

Hi @sharat94!

I’ll check on this internally and update the thread ASAP!

Best,
Brian


Forum|alt.badge.img
  • Author
  • Contributor I
  • 1 reply
  • March 18, 2024

Hey @Brian Turcotte . Hope all is well at your end. Just checking in to see if you were able to take a look at this perhaps?

 

Regards,

Sharat


Brian Turcotte
Forum|alt.badge.img+37
  • Klaviyo Alum
  • 1393 replies
  • Answer
  • April 25, 2024

Hi @sharat94!

My apologies for the delay here!

Is this still occurring for you?

- Brian


  • Contributor I
  • 1 reply
  • June 27, 2024

I have the same problem (create event returns a 202, doesn’t create the event metrics, but does update parts of the profile). No solution after 2 months?


Kim Strauch
Klaviyo Employee
Forum|alt.badge.img+9
  • Klaviyo Employee
  • 91 replies
  • June 28, 2024

Hey  @sharat94, it’s possible you’re running into a similar issue to the one discussed in 

The profile ID is optional. If you don’t know the profile ID and only have the email, you should just provide the email alone as a profile identifier when creating these events. 



@KeithB, can you provide a little more context on what you’ve tried here so our team / the community can better assist you?
We had another similar thread recently, where the issue turned out to be due to using certain fake email address domains: 

 

If it’s neither of the above issues, sharing more details on your request payload, revision, and your 6-character public API key will allow us to dig in here.