Solved

GET /lists - invalid id inconsistent status and content type

  • 16 December 2022
  • 1 reply
  • 100 views

Userlevel 1
Badge +1

Hi there,

I was just wondering if the following is expected behaviour or a potential bug in the /lists endpoint.

Scenario 1. Using asdasd123123

POST https://a.klaviyo.com/api/lists/asdasd123123

Response: 404 application/vnd.api+json

{
"errors": [
{
"id": "6b07a851-1343-4850-b8ad-73ac6d8ac87f",
"status": 404,
"code": "not_found",
"title": "Not found.",
"detail": "A group with id `asdasd123123` does not exist.",
"source": {
"pointer": "/data/"
}
}
]
}

Scenario 2. Using asdasd123123%40. 

POST https://a.klaviyo.com/api/lists/asdasd123123@.

Response: 404 text/html

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Oops Error 404 - Klaviyo</title>

<!-- etc ... -->

Scenario 3. Using asdasd123123%40.c

POST https://a.klaviyo.com/api/lists/asdasd123123@.c

Response: 500 application/vnd.api+json

{
"errors": [
{
"id": "9ecf9268-f449-4c0e-838a-b429465160aa",
"status": 500,
"code": "error",
"title": "A server error occurred.",
"detail": "A server error occurred.",
"source": {
"pointer": "/data/"
}
}
]
}

As you can see the 3 invalid path parameters result in 3 different combinations of status and content type. In order to provide the best possible UX to customers using our Klaviyo integrations I would love to be able to reserve 500 Klaviyo errors for non user error - would you be able to advise further on this behaviour?

Alternatively would you be able to confirm the string pattern which IDs must have? I’ve noticed that valid IDs seem to be 6 alphanumeric characters. If that is the case would you be able to advise if we can safely assume this format to stay that way?

 

Thanks!

Ismael

icon

Best answer by Brian Turcotte 17 December 2022, 04:10

View original

1 reply

Userlevel 7
Badge +35

Hi @rollout and welcome to the Community!

 

This is an interesting observation - I’m going to reach out internally to our engineering team in order to gather some more concrete information, but my intuition is that in Scenario #3, the “.c” is pointing the URL away from the endpoint completely, whereas the calls in the first two scenarios are reaching the desired location, there’s just no matching ID in those instances. 

 

That being said, I will update the thread as soon as I obtain the definitive answer. As far as the List ID convention, they will all be 6-digit alphanumeric strings as of now, but I will also check to see if there are any plans to change that in the future.

 

Thanks for using the Community!

- Brian

Reply