Skip to main content

I'm getting this error:

Response body: {"errors":[{"id":"51c07451-b09a-4e77-a460-13cd0b920a28","status":400,"code":"invalid","title":"Invalid input.","detail":"The payload provided in the request is invalid.","source":{"pointer":"/data"},"meta":{}}]}

 

When trying to call:

@event = KlaviyoAPI::Events.create_event(body)

My body object looks like this:

body = {
    data: {
        type: 'event',
        attributes: {
            properties: {
                registryID: @registry.id,
                registryKind: @registry.kind
            },
            time: DateTime.now.new_offset(0).iso8601,
            value: 0,
            metric: {
                data: {
                    type: 'metric',
                    attributes: {
                        name: "Created Registry"
                    }
                }
            },
            profile: @profile
        }
    }
}

Any idea what the issue is with my body structure?
 

My issue is resolved, see here: https://github.com/klaviyo/klaviyo-api-ruby/issues/15


Hi @gadabout!

Glad to hear the issue was resolved! Thank you for sharing your solution with the Community!
 

- Brian


Reply