4.3.2 Links
When responding to requests, OHI Components applications may add URI links to the response message payload. Links have the following attributes:
- rel: description for the type of link
- type: the media type for the link, e.g. 'application/xml'
- href: the actual hypermedia reference that the client may activate
OHI Components applications return relative URI links that start with the path of the RESTful service that generated the response. It is expected that the client prepends these with the protocol identifier (e.g. HTTPS), domain, port and the OHI Components application HTTP API context root (i.e. "/api").
The following link types are distinguished:
Link type |
Description |
---|---|
self |
Reference to a specific resource, e.g. /api/activities/{activityId}. |
file |
Reference to a file that will be streamed to the client when the link is activated. |
messages |
List of messages resulting from processing a request or activity. |
first |
For pagination of results: for navigation to first 'page'. Only applicable if the current 'page' is not the first. |
next |
For pagination of results: for navigation to next 'page'. Only applicable if the list contains additional items. |
prev |
For pagination of results: for navigation to previous 'page'. Only applicable if the current 'page' is not the first. |
actions/... |
Denotes actions that are executed when the link is activated. For example: 'actions/startprocessing' to start an activity. |