Linkrules (aka Navigation Rules)
Endpoint Overview
- Endpoint Name: Linkrules
- Purpose: Retrieves the front-end navigation URLs for a set of entities from Page Builder. See Create and edit navigation rules to learn how to define a navigation rule (aka link rule).
- Method: POST
- URL:
/api/{version}/linkrules
caution
Avoid calling this endpoint per single linkrule. Instead, group together all linkrules to solve in a single call. This prevents performance issues.
Authentication
- Authentication Type: API key
- Pass the API key in the request header:
FrontendApi key=YOUR_API_KEY
Request
Headers
Header Name | Required | Description |
---|---|---|
FrontendApi key | Yes | Your API Key |
accept | No | application/json |
Path Parameters
Parameter | Type | Description |
---|---|---|
version | string | The version of the API to be used. Allowed values: v1 , v2 . |
Query Parameters
Parameter | Mandatory | Description | Example |
---|---|---|---|
id | Yes | Entity identifier. Slug for FORGE's entities. | my-slug-in-forge |
entity | Yes | The JSON definition of the entity. It's used to match the link rules definition. | {type: "customentity", ... slug: "qa-player-6", ... entitycode: "player"} |
entitytype | No | If present, it's used to match the Entity field of the link rule definition. | player |
culture | Yes | Used to determine the base URL of the front-end. | en-us |
environment | Yes | Used to determine the base URL of the front-end. | stg |
Request body
Array:
[
{
id: "",
entity: "",
entitytype: "",
culture: "",
environment: ""
},
...
]
For example, pass the following payload to the /linkrule endpoint to resolve the link rule for slug=myslug:
[
{
"id": "string",
"entity": {
"slug": "myslug"
},
"entityType": "externalEntity",
"culture": "en-gb",
"environment": "ci"
}
]
Response
Response Codes
HTTP Status Code | Meaning |
---|---|
200 | Successful request |
404 | Not Found (resource does not exist) |
500 | Internal Server Error |
Response Body
List of URLs related to request's entities:
{
data: [
{
id: "",
url: ""
},
...
{
id: "",
url: ""
}
]
meta: {
version: "1.0"
}
}
Parameter | Description | Example |
---|---|---|
id | Entity id as passed in the request | my-slug-in-forge |
url | Navigation URL of the entity | https//my-fe-base-url/my-section/my-slug-in-forge |
Successful Response Example
{
"data": [
{
"id": "string",
"url": "https://acme.org/page-builder-test/_a_big_fan_of_alpha/website/myslug",
"success": true
}
],
"meta": {
"version": "1.0"
}
}
Common Errors and Troubleshooting
Nothing known.