Download the PHP package hedii/zotero-api without Composer

On this page you can find all versions of the php package hedii/zotero-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package zotero-api

Build Status

Zotero Api

A php wrapper for zotero web api.

Table of contents

Installation

Install via composer

Usage

Instantiation

ZoteroApi has to be instantiated with an api key. You can generate a zotero api key here if you have an account on zotero.org.

User and group libraries

Every call to zotero web api has to be made on a user or a group library (except for key($apiKey) method).

This is reflected on this package by the fact that you always have to call the method user($userId) or the method group($groupId) at the beginning of each call.

Items

Multiple items

To access all items in a library, call the items() method.

Single item

To access a specific item in a library, call items($itemKey) method with the item key as a parameter.

Top level items

To access only top level items in a library, call top() method just after the items() method.

Items in the trash

To access items that have been put in the trash, call trash() method just after items() method.

Child items

To access an item's child items, call children() method just after items($itemKey) method.

Item tags

To access all tags associated with a specific item, call tags() method just after items($itemKey) method.

Collections

Multiple collections

To access all collections in a library, call the collections() method.

Single collection

To access a specific collection in a library, call collections($collectionKey) method with the collection key as a parameter.

Items in a collection

To access all items in a collection, call items() method after calling a specific collection.

Top level items in a collection

To access only top items in a collection, call top() method after calling items in a specific collection.

Collection tags

To access all tags associated with a specific collection, call tags() method just after collections($collectionKey) method.

Sub collections

To access sub collections within a specific collection, call subCollection() method just after collections($collectionKey) method.

Versions

To get all resources (either collections or items) versions, call versions() method after items() or collections() method.

Tags

All tags

To access all tags in a library, call tags() method.

Matching tags

To access tags matching a specific name in a library, call tags($tagName) method with $tagName a string as a parameter.

Searches

Multiple searches

To access all saved searches in a library, call searches() method.

Single search

To access a specific saved search in a library, call searches($searchKey) method with the search key as a parameter.

Key

To access the privilege information of a given api key, call key($apiKey) method on the ZoteroApi instance.

Groups

To access all groups the current API key has access to, call groups() method just after user($userId) method.

Sorting and pagination

Sorting and pagination methods can be called after calling a resource method.

Sorting

The sortBy($value) method set by what type of value the response will by sorted.

The $value parameter has to be one of :

Direction

The direction($value) method set the sorting direction of the field specified by the sortBy($value) method.

The $value parameter has to be one of :

Limit

The limit($value) method set the maximum number of results to return with a single request.

The $value parameter has to be an integer between 1 and 100. The default number of result provided by zotero web api is 50.

Start

The start($value) method determines the index of the first result.

The $value parameter has to be an integer. The default starting index is 0.

Combine with the limit parameter to select a slice of the available results.

Request timeout

Request timeout can be set using the setTimeout($timeout) method, with $timeout an integer in milliseconds as a parameter.

Default request timeout is 0.

You can get the current request timeout value using the getTimeout() method.

Connection timeout

Connection timeout can be set using the setConnectionTimeout($connectionTimeout) method, with $connectionTimeout an integer in milliseconds as a parameter.

Default connection timeout is 0.

You can get the current connection timeout value using the getConnectionTimeout() method.

Sending a request and getting a response

Sending the request

To send a request after chaining available methods, call the send() method.

Response body

To access the response body as an array, call the getBody() method on the response.

Response json

To access the response body as a json string, call the getJson() method on the response.

Response headers

To access the response headers as an array, call the getHeaders() method on the response.

Response status code

To access the response status code, call the getStatusCode() method on the response.

Response reason phrase

To access the response reason phrase, call the getReasonPhrase() method on the response.

Raw query

To build the request url yourself, call the raw($url) method, with $url a string as a parameter.

Examples

Testing

License

hedii/zotero-api is released under the MIT Licence. See the bundled LICENSE file for details.


All versions of zotero-api with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
guzzlehttp/guzzle Version ^6.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hedii/zotero-api contains the following files

Loading the files please wait ....