API issue

  • 20 November 2023
  • 4 replies
  • 54 views

Badge

Hello,

I encountered an issue while integrating a CRM with Klaviyo. I'm utilizing the API specified at https://developers.klaviyo.com/en/reference/create_profile, and the body request is in JSON format. However, I need to submit it as Key-Value pairs.

Here's what I attempted:


 

data[type]=profile
data[attributes][email]=sarah.mason@klaviyo-demo.com
data[attributes][phone_number]=+15005550006
... (remaining key-value pairs)

I'm unsure if this approach will work. When I tested it, I received the following error message:

{
"errors": [
{
"id": "5f746ff4-cfca-45c7-9b1b-d7c884119e98",
"status": 404,
"code": "not_found",
"title": "Not found.",
"detail": "No revisions found for method",
"source": {
"pointer": "/data/"
}
}
]
}


 

Can anyone guide me on the correct format for submitting a Key-Value pair request to Klaviyo's API?

Thank you!


4 replies

Userlevel 7
Badge +35

Hi @developerCZ!

 

Would you be willing to try the same API call as a CurL request (taking the actual code from the docs you referenced) via a testing tool like Postman?

 

That would help clarify whether the issue is with your integration or the actual content of the API call.

 

Best,

Brian

Badge

I tried that. In postman sending json or curl request works. If I send Key - value, it does not work.

Json request body

 

Badge
This is what I tried in the form of Json Key-value pair. How can I resolve this issue?

@Brian Turcotte , Could you please have a look at it and suggest me the solution?

Badge

Hi, Any updates?

Reply