Skip to main content

Solved

12578 Topics
Getting error when passing body object - klaviyo-api-ruby

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?Â