Resolve a Path to a Document
Required scope:
public-api:read
Description
You need to activate the
Categories /
Routing feature in the Project Config in order to resolve paths to your documents. Routing is a quite advanced topic and the examples only work with a default configuration. Find more
here.
ACCESS_TOKEN=ey1234
curl -k -X GET "https://server.livingdocs.io/api/v1/routing/resolve?path=:path" \
-H "Authorization: Bearer $ACCESS_TOKEN"
Endpoint
GET api/v1/routing/resolve
Parameters
Name | Type | Required | Notes |
---|
?path | string | x | Path to the document. Example 1: A page with a category /news can be found with ?path=/news.html . Example 2: A document with id 10, with category /news and a slug hello can be found with ?path=/magazin/hello-10.html' . |
Response
200
OK
api/v1/routing/resolve?path=/correct-path/my-article-173.html
[
{
"type": "document",
"resource": {
"id": 173,
"statusCode": 200
}
}
]
301
Moved Permanently
api/v1/routing/resolve?path=/incorrect-path/slug-with-correct-id-77.html
[
{
"type": "redirect",
"path": "/path/to/redirect",
"resource": {
"statusCode": 301
}
}
]
404
Not Found
api/v1/routing/resolve?path=/does/not/exist
{
"status": 404,
"error": "Not Found"
}
410
api/v1/routing/resolve?path=/unpublished-document-123.html
[
{
"type": "unpublished",
"resource": {
"id": 123,
"statusCode": 410
}
}
]