User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
public:nnels:nnels_api_docs_v1 [2018/04/24 13:52]
jonathan.schatz [Response structure]
public:nnels:nnels_api_docs_v1 [2019/05/14 10:56]
jonathan.schatz [Keyword Search]
Line 1: Line 1:
-====== NNELS API v1.Documentation ======+====== NNELS API v1.Documentation ======
 Version 0.5 used Services and Services Views.\\ Version 0.5 used Services and Services Views.\\
 Version 1.x uses RESTful framework.\\ Version 1.x uses RESTful framework.\\
 \\ \\
-**Resources exposed**: 
-  * Auth - /login-token/, /refresh-token/ 
-  * Users - /users/ 
-  * Repo_Items - /repo_items/ 
-  * FileResources - /file_resources/ 
-  * Search - /basic_search/ - **Under construction** 
  
 ===== Current Testing Server ===== ===== Current Testing Server =====
 |Host|dev.nnels.ca| |Host|dev.nnels.ca|
 |Base Endpoint|api| |Base Endpoint|api|
-|Example|https://dev.nnels.ca/api/[:[v1.x/]resource]/ |+|Example|https://dev.nnels.ca/api/v[:version.minor]/[:resource]/ |
  
 ===== Notes ===== ===== Notes =====
Line 20: Line 14:
   * Refresh against <api_endpoint>/refresh-token/ with the **refresh_token** supplied by initial authentication   * Refresh against <api_endpoint>/refresh-token/ with the **refresh_token** supplied by initial authentication
   * If receiving uid 0 back from a specific user request, this means your access token expired.   * 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:
 +<code>
 +GET /api/
 +Host: [:current host]
 +</code>
 ===== AuthN ===== ===== AuthN =====
  
Line 135: Line 137:
     "self": {     "self": {
         "title": "Self",         "title": "Self",
-        "href": "https://staging.nnels.ca/api/v1.0/users/117"+        "href": "https://dev.nnels.ca/api/v1.0/users/117"
     }     }
 } }
 </code> </code>
  
-===== SEARCH API (Full-text) ===== +===== BASIC SEARCH ===== 
- Coming soon+ 
-===== REPO_ITEMS ===== +==== Keyword Search v1.1 ===== 
-Note: Uses UUID primarily, not NID\\ +URL-encode keyword string. 
 + 
 +<code> 
 +GET /api/basic_search/[:keyword1]+[:keyword2]+[:keyword3] HTTP/1.1 
 +Host: dev.nnels.ca 
 +Authorization: Basic dGVzdC1hY2NvdW50Om5vdFJlYWw= 
 +</code> 
 + 
 +===== REPO_ITEMS v1.1 =====
  
 ==== Specific Repo Item Request example ==== ==== Specific Repo Item Request example ====
 +**With node ID (nid)**
 <code> <code>
 GET /api/v1.0/repo_items/[:nid] HTTP/1.1 GET /api/v1.0/repo_items/[:nid] HTTP/1.1
 +Host: dev.nnels.ca
 +access-token: [:access-token]
 +</code>
 +
 +**Alternate load by UUID (uuid)**
 +<code>
 +GET /api/v1.0/repo_items/uuid=[:uuid]?loadByFieldName=uuid HTTP/1.1
 Host: dev.nnels.ca Host: dev.nnels.ca
 access-token: [:access-token] access-token: [:access-token]
Line 260: Line 278:
  
 ==== Notes ==== ==== Notes ====
-file_resources 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.+  * 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 /repo-items/?range=N for a listing of N repo items. 
 +  * Follow root links element for paging URIs (self, first, previous, last, next)
public/nnels/nnels_api_docs_v1.txt · Last modified: 2019/05/14 10:56 by jonathan.schatz