Skip to main content

API issue

  • November 20, 2023
  • 7 replies
  • 152 views

Forum|alt.badge.img+2

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!

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

7 replies

Brian Turcotte
Forum|alt.badge.img+37

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


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 3 replies
  • November 21, 2023

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

Json request body

 


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 3 replies
  • November 21, 2023
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?


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 3 replies
  • November 22, 2023

Hi, Any updates?


Forum|alt.badge.img
  • Problem Solver I
  • 3 replies
  • September 30, 2024

Is there a resolution for this, please? what does ‘No revisions found for method’ mean. Thanks


Forum|alt.badge.img+31
  • Partner
  • 252 replies
  • October 1, 2024

Hello @developerCZ  You have to send JSON format key value pairs for it to work.


Forum|alt.badge.img+31
  • Partner
  • 252 replies
  • October 1, 2024

Hello @amitxenai Make sure you have a header named revision and correct value is passed.

You can check the example given here:

https://developers.klaviyo.com/en/docs/api_versioning_and_deprecation_policy

 

A curl request with revision would look like this:

curl --request GET \
     --url https://a.klaviyo.com/api/events/ \
     --header 'Authorization: Klaviyo-API-Key your-private-api-key' \
     --header 'accept: application/json' \
     --header 'revision: 2023-12-15'