Skip to main content
Contributor I
November 20, 2023

API issue

  • November 20, 2023
  • 7 replies
  • 256 views

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!

    This topic has been closed for replies.

    7 replies

    Brian Turcotte
    Klaviyo Alum
    November 20, 2023

    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

    Contributor I
    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

     

    Contributor I
    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?

    Contributor I
    November 22, 2023

    Hi, Any updates?

    Problem Solver I
    September 30, 2024

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

    Partner
    October 1, 2024

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

    https://theforms.pro
    Partner
    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'

     

    https://theforms.pro