Aliases REST API endpoint
Disclaimer: This endpoint documentation is generated from the latest Sitevision version. It might differ from the actual Sitevision environment where your website resides.
Use the RestApi utility of the Public API for server-side access of this endpoint.
Aliases
Management of sv:alias instances of the site.
Applicable to the sv:aliasRepository.
All operations in this endpoint requires that the user is authorized to MANAGE_SITE_PROPERTIES on sv:site. Read operations (GET) also requires READ on sv:site. Mutating operations (POST/PUT/DELETE) also requires WRITE on sv:site.
GET
Returns a specific alias or all aliases.
Permissions
Requires that the caller is authorized to READ and MANAGE_SITE_PROPERTIES on the sv:site.
| Name | Type | Description |
|---|---|---|
| name | string |
Optional. The name of a specific alias. If omitted all aliases are returned |
Example URL
40.7f84551a13dab43a22430/aliases
Example input
{
"name": "login"
}
Example response
An INTERNAL alias has a target (i.e. the resource to redirect to).
If the target is available online (i.e. "is published") it also contains a URI and URL to the target.
{
"id": "253.336251b01784ae1c3e32_alias",
"name": "login",
"redirectPermanently": false,
"wildcard": false,
"type": "INTERNAL",
"target": "4.121212121212",
"URI": "/shared/login.html",
"URL": "https://mydomain.se/shared/login.html"
}
An EXTERNAL alias has a URL (i.e. no target or URI)..
{
"id": "253.136251b01784ae1c3e37_alias",
"name": "login",
"redirectPermanently": false,
"type": "EXTERNAL",
"URL": "https://someotherdomain.com/external-login.html"
}
Alternate URL example
Getting data for a specific alias can also be targeted via URL. Note that the sv:alias (last URL part) must be specified by its JCR Node Identifier.
40.7f84551a13dab43a22430/aliases/253.336251b01784ae1c3e32_alias
POST
Creates a new alias.
Permissions
Requires that the caller is authorized to WRITE and MANAGE_SITE_PROPERTIES on the sv:site.
| Name | Type | Description | Default | Since |
|---|---|---|---|---|
| name | string |
Mandatory. The name of the alias | ||
| redirectPermanently | boolean |
Optional. Whether or not to redirect permanently (301) | false | |
| wildcard | boolean |
Optional. Whether or not this is a prefix-alias | false | 2023.04.1 |
| type | string |
Mandatory. Alias type: "INTERNAL" or "EXTERNAL" | ||
| target | string |
Mandatory if type is INTERNAL. Value should be a Node Identifier, Node Path or URI/URL that can be used to resolve the internal target | ||
| URL | string |
Mandatory if type is EXTERNAL. The URL to the external resource |
Example URL
40.7f84551a13dab43a22430/aliases
Example input
{
"name": "inloggning",
"type": "INTERNAL",
"target": "4.121212121212"
}
Example response
{
"id": "253.936251b01784ae1c3e36_alias",
"name": "inloggning",
"redirectPermanently": false,
"wildcard": false,
"type": "INTERNAL",
"target": "4.121212121212",
"URI": "/shared/login.html",
"URL": "https://mydomain.se/shared/login.html"
}
PUT
Updates an existing alias.
Permissions
Requires that the caller is authorized to WRITE and MANAGE_SITE_PROPERTIES on the sv:site.
| Name | Type | Description | Default | Since |
|---|---|---|---|---|
| redirectPermanently | boolean |
Optional. Whether or not to redirect permanently (301) | false | |
| wildcard | boolean |
Optional. Whether or not this is a prefix-alias | false | 2023.04.1 |
| target | string |
Mandatory if the alias should be INTERNAL. Value should be a Node Identifier, Node Path or URI/URL that can be used to resolve the internal target | ||
| URL | string |
Mandatory if the alias should be EXTERNAL. The URL to the external resource |
Note that the name of an alias can't be updated.
Example URL
Note that the sv:alias (last URL part) must be specified by its JCR Node Identifier.
40.7f84551a13dab43a22430/aliases/253.936251b01784ae1c3e36_alias
Example input
{
"target": "4.2222222222222"
}
Example response
{
"id": "253.936251b01784ae1c3e36_alias",
"name": "inloggning",
"redirectPermanently": false,
"wildcard": false,
"type": "INTERNAL",
"target": "4.2222222222222",
"URI": "/login.html",
"URL": "https://mydomain.se/login.html"
}
Alternate URL example
The sv:alias to update can also be specified by name.
40.7f84551a13dab43a22430/aliases
Example input
{
"name": "inloggning",
"target": "4.2222222222222"
}
Example response
{
"id": "253.936251b01784ae1c3e36_alias",
"name": "inloggning",
"redirectPermanently": false,
"wildcard": false,
"type": "INTERNAL",
"target": "4.2222222222222",
"URI": "/login.html",
"URL": "https://mydomain.se/login.html"
}
DELETE
Deletes an existing alias.
Permissions
Requires that the caller is authorized to WRITE and MANAGE_SITE_PROPERTIES on the sv:site.
Example URL
Note that the sv:alias (last URL part) must be specified by its JCR Node Identifier.
40.7f84551a13dab43a22430/aliases/253.936251b01784ae1c3e36_alias
Example response
{
"id": "253.936251b01784ae1c3e36_alias",
"name": "inloggning",
"redirectPermanently": false,
"wildcard": false,
"type": "INTERNAL",
"target": "4.2222222222222",
"URI": "/login.html",
"URL": "https://mydomain.se/login.html"
}
Alternate URL example
The sv:alias to delete can also be specified by name.
40.7f84551a13dab43a22430/aliases
Example input
{
"name": "inloggning"
}
Example response
{
"id": "253.936251b01784ae1c3e36_alias",
"name": "inloggning",
"redirectPermanently": false,
"wildcard": false,
"type": "INTERNAL",
"target": "4.2222222222222",
"URI": "/login.html",
"URL": "https://mydomain.se/login.html"
}