logo

Extra Block Types (EBT) - New Layout Builder experience❗

Extra Block Types (EBT) - styled, customizable block types: Slideshows, Tabs, Cards, Accordions and many others. Built-in settings for background, DOM Box, javascript plugins. Experience the future of layout building today.

Demo EBT modules Download EBT modules

❗Extra Paragraph Types (EPT) - New Paragraphs experience

Extra Paragraph Types (EPT) - analogical paragraph based set of modules.

Demo EPT modules Download EPT modules

Scroll
04/09/2025, by Ivan

JSON:API 使得在单个请求中检索多个资源成为可能,这些路由称为“集合(collection)”路由。可以通过向基础资源路由发送 GET 请求来获取资源集合,例如 GET /jsonapi/node/article,并且包含 UUID。默认情况下,这将包含指定类型的所有资源。

过滤和排序在所有标准资源上默认可用。

请求头

以下请求头在所有 GET 请求中都是必须的,以确保 JSON:API 请求和响应的正确性。

  • Accept: application/vnd.api+json
  • Content-Type: application/vnd.api+json

以下请求头在示例中需要使用:

  • Authorization: Basic YXBpOmFwaQ==

集合排序

按 “created” 排序

按 “created” 时间戳对集合进行排序(默认升序排序)。

简写形式
sort=created

常规形式
sort[sort-created][path]=created

按作者用户名排序

按作者用户名对集合进行降序排序。请注意,前缀的减号 (-) 表示降序。

简写形式
sort=-uid.name

常规形式
sort[sort-author][path]=uid.name
sort[sort-author][direction]=DESC

按多个字段排序

按多个字段对集合进行排序。

简写形式
sort=-created,uid.name

常规形式
sort[sort-created][path]=created
sort[sort-created][direction]=DESC
sort[sort-author][path]=uid.name

文章来源:Drupal 文档