如何从我的书架获取Google Books API的数据

时间:2015-09-22 19:30:03

标签: php google-api-php-client google-books

我一直在尝试使用Google图书从我的书架中请求数据并在我的页面中使用它。当我使用示例page 列表尝试时,它会向我提供我想要的结果,显示如下内容

{
 "kind": "books#volumes",
 "totalItems": 803,
 "items": [
  {
   "kind": "books#volume",
.
.
.

我知道怎么用。但是,当我尝试使用它时,使用它在PHP中为我提供GET https://www.googleapis.com/books/v1/users/myUSERID/bookshelves/1001/volumes的示例的GET请求它总是给我以下错误页面

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "notFound",
    "message": "The bookshelf ID could not be found.",
    "locationType": "other",
    "location": "bookshelf_id,bookshelf_owner_user_id"
   }
  ],
  "code": 404,
  "message": "The bookshelf ID could not be found."
 }
}

如何通过API执行请求?我是使用API​​的新手,我想使用更直接的方法。

0 个答案:

没有答案