From PartKeepr Wiki
Revision as of 15:02, 22 May 2016 by Crazy imp (talk | contribs) (add --globoff and note about escaping)
Jump to: navigation, search


PartKeepr uses JSON-LD/Hydra-CG as API standards.

Authentication can be done by HTTP Basic and/or WSSE. Once authenticated, a session cookie is set, but you can also re-send the HTTP Basic and/or WSSE auth on every request.

API Documentation

To view the API Doc, you need to go to to receive a session cookie.

Unfortunately a user-friendly API doc is not available yet due to a problem with a 3rd party library. However, the hydra documentation should give some clues which API calls are available.

Example HTTP Request


HTTP Headers:
Authorization:Basic YWRtaW46YWRtaW4=

CURL Examples

Basic Example

Retrieves all parts with pagination defaults:

curl --basic --user admin:admin

Please keep in mind to escape the following characters in your shell: "?[]{}=& (and space). Example:




Also using --globoff as curl parameter helps too, otherwise you would have to escape certain characters a second time because curl tries to expand the URL too. We'll stick to the unescaped form for better readability right now.

Pagination example

curl --globoff --basic --user admin:admin

If you want all parts, you need to request a quite big amount of itemsPerPage like:

curl --globoff --basic --user admin:admin

Filtering examples

Filtering by the storage location:

curl --globoff --basic --user admin:admin{"property":"storageLocation","operator":"=","value":"/api/storage_locations/3"}

Filtering by the status

curl --globoff --basic --user admin:admin{"property":"status","operator":"LIKE","value":"new"}