GET article media entity reference field_image url, uri by including references
URL: http://example.com/jsonapi/node/article/{{article_uuid}}?include=field_image,field_image.image,field_image.image.file--file&fields[field_image]=image&fields[file--file]=uri,url
以上是官网提供的方法,但会报错。
通过实验出使用以下方法能调到对应的图片资源。
/node/banner/fe0b3713-2a44-4369-863c-0aae3a51aa70?include=field_image&fields[file--file]=url,uri&fields[node--
banner]=field_image,type
但有个问题,UUID正常需要再调一次列表才能拿到图片资源。
GET first 10 articles
URL: http://example.com/jsonapi/node/article?page[limit]=10
Response
JSON response of max. 10 articles, including links to next.
GET second page of 10 articles
URL: http://example.com/jsonapi/node/article?page[limit]=10&page[offset]=10
Response
HTTP 200 response. The response body contains the JSON:API object of max. 10 articles, including links to prev, next, etc.
For more information about pagination, see: https://www.drupal.org/node/2803141
重新读了一遍官网的介绍,资源也可以一次性读出通过include 包含 进来就可以。翻译文本在:
http://www.ewen.online/zh-hans/shouceye/115/json-api-diaoyongshuoming