Limit the number of messages returned

The docs list under “List messages” two query parameters: order and limit. If I set order to “desc” and limit to “1” I would expect to receive only the last message - instead I got:

“error”: {
“message”: “Missing required parameter: ‘content’.”,
“type”: “invalid_request_error”,
“param”: “content”,
“code”: “missing_required_parameter”
}

But there is no required parameter listed for this endpoint?

Any idea what I’m doing wrong?

2 Likes

I’m having the same problem. I’m using the cURL method and I noticed two things:

  1. cURL method has exactly same URL for both the “List Messages” and the “Create Message”. That can’t be good and I’m sure that’s what is causing this problem. It is giving the error as if you are trying to “Create Message” when you and I are trying to get the List.
  2. I also noticed that the Node and Python instructions have quite different code for List versus Create.

The List options are great but this is definitely a bug.

The URL is the same but the critical difference is:

  • To Create Message use POST
  • To List Messages use GET

Then everything works.

1 Like