Skip to main content
Solved

Error Adding Custom Metric via API

  • February 26, 2023
  • 3 replies
  • 193 views

Forum|alt.badge.img+2

Hi All,

 

I am experiencing an issue with adding a custom metric via the API in my WordPress plugin. When I click the "Add Metric" button on the settings page of my plugin, I receive the following error in the browser console:

{

"headers": {},

"body": "{"errors": [{"id": "cf7e11a6-e002-41bd-a204-5117065723a5", "status": 404, "code": "not_found", "title": "Not found", "detail": "The path /api/v1/metric could not be found"}]}",

"response": {

"code": 404,

"message": "Not Found"

},

"cookies": [],

"filename": null,

"http_response": {

"data": null,

"headers": null,

"status": null

}

}

I have confirmed that the API key being used has the required permissions and that the data being passed to the klaviyo_create_metric() function is in the correct format. I have also checked the Klaviyo API documentation and believe that the URL being used is correct:

https://a.klaviyo.com/api/v1/metric

Is there anything else I should be checking or any additional information I can provide to help resolve this issue?

Thank you for your assistance.

Best answer by Brian Turcotte

Hi @alchemist and welcome to the Community!

 

Would you mind elaborating a bit on the exact use case (the purpose of the custom metric, which plug-in you are using, etc.)?

 

I do have a few thoughts that might help clarify the issue for myself and other Community members:

Additionally, you referenced a V1 endpoint from our legacy set, which will be depreciated in less than a year. To that end, I would highly recommend utilizing our new, V3 APIs for a more robust and supported experience.

 

Furthermore, custom integrations are typically beyond the scope of the Community, so while I’ll do my best to answer questions about it, you can always reach out to one of our wonderful Official Partners for personalized development help.

 

Thanks for using the Community!

- Brian

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

3 replies

Brian Turcotte
Forum|alt.badge.img+37
  • Klaviyo Alum
  • 1393 replies
  • Answer
  • February 27, 2023

Hi @alchemist and welcome to the Community!

 

Would you mind elaborating a bit on the exact use case (the purpose of the custom metric, which plug-in you are using, etc.)?

 

I do have a few thoughts that might help clarify the issue for myself and other Community members:

Additionally, you referenced a V1 endpoint from our legacy set, which will be depreciated in less than a year. To that end, I would highly recommend utilizing our new, V3 APIs for a more robust and supported experience.

 

Furthermore, custom integrations are typically beyond the scope of the Community, so while I’ll do my best to answer questions about it, you can always reach out to one of our wonderful Official Partners for personalized development help.

 

Thanks for using the Community!

- Brian


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 1 reply
  • February 28, 2023

Hi @Brian Turcotte,

Thank you for your response. I am trying to create a custom endpoint using a custom plugin that will pass the Booking End date (when a customer completes a booking) as an event from WooCommerce Bookings plugin to Klaviyo. We want to send an email/SMS each time a customer completes their booking.

Can this be achieved without a custom integration?

Thank you for sharing the recommended developer guides - I’ll have a look at it.

 


Brian Turcotte
Forum|alt.badge.img+37

Hi @alchemist!

 

This would definitely constitute a custom project, as there are no supported, native ways to accomplish this within Klaviyo’s UI. The best way to do this would be to create a custom event that’s triggered when a user fills out your booking form, using these guides:

- Brian