This shows you the differences between two versions of the page.
public:nnels:nnels_api_docs_v1 [2018/09/11 17:39] hub.admin [SEARCH API (Full-text)] |
public:nnels:nnels_api_docs_v1 [2024/05/09 05:04] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== NNELS API v1.1 Documentation ====== | ||
- | Version 0.5 used Services and Services Views.\\ | ||
- | Version 1.x uses RESTful framework.\\ | ||
- | \\ | ||
- | ===== Current Testing Server ===== | ||
- | |Host|dev.nnels.ca| | ||
- | |Base Endpoint|api| | ||
- | |Example|https:// | ||
- | |||
- | ===== Notes ===== | ||
- | * Authenticate against the < | ||
- | * Bear the **access_token** for authorization for all other requests before its expiry period. | ||
- | * Refresh against < | ||
- | * If receiving uid 0 back from a specific user request, this means your access token expired. | ||
- | |||
- | **Discover Resources and their versions** | ||
- | |||
- | To discover a list of available resources and the latest version for each, issue: | ||
- | < | ||
- | GET /api/ | ||
- | Host: [:current host] | ||
- | </ | ||
- | ===== AuthN ===== | ||
- | |||
- | ==== Request Example ===== | ||
- | Use Basic Auth to encode username: | ||
- | < | ||
- | GET / | ||
- | Host: dev.nnels.ca | ||
- | Authorization: | ||
- | </ | ||
- | |||
- | ==== Response structure ==== | ||
- | < | ||
- | { | ||
- | " | ||
- | { | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | } | ||
- | } | ||
- | ], | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | } | ||
- | </ | ||
- | ===== AuthZ ===== | ||
- | Set access-token header with value for subsequent requests. | ||
- | |||
- | ==== Refresh Token ==== | ||
- | After '' | ||
- | < | ||
- | GET / | ||
- | Host: dev.nnels.ca | ||
- | </ | ||
- | ===== USERS ===== | ||
- | * User can request information about self with '' | ||
- | * Administrator can request information about specific users by their ID: '' | ||
- | * Or a users listing: '' | ||
- | |||
- | ==== User Request example ===== | ||
- | < | ||
- | GET / | ||
- | Host: dev.nnels.ca | ||
- | access-token: | ||
- | </ | ||
- | ==== Response structure ==== | ||
- | < | ||
- | { | ||
- | " | ||
- | { | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | } | ||
- | } | ||
- | ], | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | } | ||
- | </ | ||
- | |||
- | ===== BASIC SEARCH (Keywords) ===== | ||
- | |||
- | ==== Request Example ===== | ||
- | URL-encode keywords and append to resource | ||
- | |||
- | < | ||
- | GET / | ||
- | Host: dev.nnels.ca | ||
- | Authorization: | ||
- | </ | ||
- | |||
- | ===== REPO_ITEMS ===== | ||
- | |||
- | ==== Specific Repo Item Request example ==== | ||
- | **With node ID (nid)** | ||
- | < | ||
- | GET / | ||
- | Host: dev.nnels.ca | ||
- | access-token: | ||
- | </ | ||
- | |||
- | **Alternate load by UUID (uuid)** | ||
- | < | ||
- | GET / | ||
- | Host: dev.nnels.ca | ||
- | access-token: | ||
- | </ | ||
- | |||
- | ==== Response structure ==== | ||
- | < | ||
- | { | ||
- | " | ||
- | { | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | " | ||
- | { | ||
- | " | ||
- | } | ||
- | ], | ||
- | " | ||
- | " | ||
- | } | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | } | ||
- | } | ||
- | ], | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | } | ||
- | </ | ||
- | |||
- | ==== Notes ==== | ||
- | * The **file_resources** field contains signed S3 URIs to the files available for download for this title. This is excluded from cache and so will be regenerated upon each GET request. | ||
- | * Issue GET against / | ||
- | * Follow root links element for paging URIs (self, first, previous, last, next) |