Skip to main content

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 NameRequiredDescription
FrontendApi keyYesYour API Key
acceptNoapplication/json

Path Parameters

ParameterTypeDescription
versionstringThe version of the API to be used. Allowed values: v1, v2.

Query Parameters

ParameterMandatoryDescriptionExample
idYesEntity identifier. Slug for FORGE's entities.my-slug-in-forge
entityYesThe JSON definition of the entity. It's used to match the link rules definition.{type: "customentity", ... slug: "qa-player-6", ... entitycode: "player"}
entitytypeNoIf present, it's used to match the Entity field of the link rule definition.player
cultureYesUsed to determine the base URL of the front-end.en-us
environmentYesUsed 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 CodeMeaning
200Successful request
404Not Found (resource does not exist)
500Internal Server Error

Response Body

List of URLs related to request's entities:

{
data: [
{
id: "",
url: ""
},
...
{
id: "",
url: ""
}
]
meta: {
version: "1.0"
}
}
ParameterDescriptionExample
idEntity id as passed in the requestmy-slug-in-forge
urlNavigation URL of the entityhttps//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.