最近搜索


没有最近搜索

Terry Sue's Avatar

Terry Sue

已加入2024年11月20日

·

最后活动2024年12月02日

关注

0

关注者

0

活动总数

3

投票

0

订阅

1

活动概览

的最新活动 Terry Sue

Terry Sue 进行了评论,

社区评论 Developer - Zendesk APIs

Thanks that works! 

 

Is updated_at the only supported sort field? I've tried created_at but get the following error

{
    "error": "InvalidPaginationParameter",
    "description": "sort is not valid"
}

 

 

查看评论 · 已于 2024年12月02日 发布 · Terry Sue

0

关注者

0

投票

0

评论


Terry Sue 创建了一个帖子,

帖子 Developer - Zendesk APIs

Hi, 

 

I'm using the List Requests API as documented here: https://developer.zendesk.com/api-reference/ticketing/tickets/ticket-requests/#list-requests

 

When I use cursor pagination and attempt to sort the request the response is not sorted. If I make the same request with offset pagination it sorts fine. 

 

The documentation mentions that the sort operations are supported and makes no mention of pagination types affecting the sort operations; it even recommends using cursor pagination over offset pagination.

 

Here's the request I'm making: {{baseUrl}}/api/v2/requests.json?sort_by=updated_at&sort_order=desc&page[size]=5

 

And the response with only the relevant data:

{
  "requests": [
    {
      "updated_at": "2024-11-06T16:15:28Z"
    },
    {
      "updated_at": "2024-11-06T16:17:21Z"
    },
    {
      "updated_at": "2024-11-06T16:14:44Z"
    },
    {
      "updated_at": "2024-11-01T20:12:45Z"
    },
    {
      "updated_at": "2024-11-15T22:23:45Z"
    }
  ],
  "meta": {
    "has_more": true,
    "after_cursor": "...",
    "before_cursor": "..."
  }
}

As you can see the updated_at fields are in random order. Changing the sorting field does not change the order of the response in any way.

 

Is the documentation not accurate? Or is this a bug? 

已于 2024年11月20日 发布 · Terry Sue

0

关注者

3

投票

2

评论