Method | POST |
Rel | findsi:shortcuts |
Description | Redirects the API consumer directly to a specific resource without the need to navigate the resource hierarchy. |
The API expects the POST data to be formatted as a JSON object.
Type | Required | Description | |
Rel | String | Yes | The (Link Relation)[/docs/link-relations] the shortcut should point to |
Filter | String | No | The filter to include in the redirect url |
Sending an Actor is optional.
Type | Required | Description | |
Id | String | Yes | Id of the Actor as it is known in the client application. |
Classification | String | Yes | Classification of the Actor as it is known in the client application. |
Only include an Actor if the specified Rel
is one of the following:
Sending a Target is optional.
Type | Required | Description | |
Id | String | Yes | Id of the Target as it is known in the client application. |
Classification | String | Yes | Classification of the Target as it is known in the client application. |
Only include an Target if the specified Rel
is one of the following:
Sending a Filter is optional. Only include an Target if the specified Rel
is one of the following:
A successful response (HTTP 302) will be empty except for the Location
header. That header will contain the requested url to be followed by the client. In order to correctly use shortcuts, the client must retain the Accept
and Authorization
headers when following the returned url.
The API may respond with one of the following errors:
401 | Unauthorized | The Authorization header might be missing or malformed. Alternatively you may have provided an invalid API key. |
400 | Bad Request | Something is wrong with the POST data. Details will be included in the response message. |
Supposed we would want to request a target-recommendation directly – without traversing the resource hierarchy – the request would look something like this:
POST /shortcuts HTTP/1.1
Host: api.findsi.com
Accept: application/hal+json
Authorization: findsi_api_key apikey="..."
Content-Type: application/json
Cache-Control: no-cache
{
"Actor" : { "Classification" : "user", "Id" : "123" },
"Target" : { "Classification" : "article", "Id" : "3717492" },
"Rel" : "findsi:target-recommendations"
}
If all went well, your response will look something like this:
HTTP/1.1 302 Found
Location: "https://api.findsi.com/targets/.../recommendations/..."