Difference between revisions of "Developers/API"

From PartKeepr Wiki
Jump to: navigation, search
(Created page with "= Introduction = PartKeepr uses [http://json-ld.org/ JSON-LD]/[http://www.hydra-cg.com/ Hydra-CG] as API standards. Authentication can be done by HTTP Basic and/or WSSE. Onc...")
(No difference)

Revision as of 14:36, 28 April 2016

Introduction

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.

Example HTTP Request

GET https://demo.partkeepr.org/api/parts

HTTP Headers:
Authorization:Basic YWRtaW46YWRtaW4=
Host:demo.partkeepr.org

CURL Examples

Basic Example

Retrieves all parts with pagination defaults:

curl --basic --user admin:admin http://demo.partkeepr.org/api/parts

Pagination example

curl --basic --user admin:admin http://demo.partkeepr.org/api/parts?page=5&start=0&itemsPerPage=50

Filtering examples

Filtering by the storage location:

curl --basic --user admin:admin http://demo.partkeepr.org/api/parts?filter={"property": "storageLocation", "operator": "=", "value": "/api/storage_locations/3"}

Filtering by the status

curl --basic --user admin:admin http://demo.partkeepr.org/api/parts?filter={"property": "status", "operator": "LIKE", "value": "new"}