If your project contains duplicities, you can solve them by linking keys together. When the key is linked to another one, it copies its content when publishing takes place.
When the key is linked, it’s automatically marked as hidden, and it’s not required to be translated. It can have content of its own, but its content is not used during publishing, and it’s replaced by the content of the linked key as long as the link exists.
Please note that existing links can disable some operations, such as deleting target keys, clearing project content, etc.
Availability #️⃣
This feature is available on the Agency tier and above.
You can link duplicities in one project or across up to 3 additional projects from the Agency plan and above.
Using this API, you can create project-specific and cross-project links without any limitations even when you are not on the given plan, but they are not considered during publishing. They are effectively ignored.
List links #️⃣
[GET] /projects/{projectId}/links
Description | Value |
---|---|
Accessible with project token | true |
Accessible with organization token | true |
Need write permission | false |
Available from role | reviewer |
API level | normal |
Lists all existing links.
Query Parameters #️⃣
Parameter | Description |
---|---|
limit=1000 |
Number of links to be returned in a single call (max 1000). Default 1000. |
next=pageId |
Used for paging long lists. |
Sample Response #️⃣
{
"links": [
{
"keyId": "_a8044180069099765445",
"linkedProjectId": "_a8044180115884081146",
"linkedKeyId": "_a8044180069032656579"
}
],
"next": "a9aEQf97CUPF"
}
Request Object
Field | Required | Description |
---|---|---|
links |
required | Array of links. See “Link Object” below. |
next |
optional | Next is the paging key. The field is not contained if there are no more pages. |
Link Object
Field | Required | Description |
---|---|---|
keyId |
required | Id of the key in Localazy. |
linkedProjectId |
required | Id of the project in Localazy the target key comes from. The cross-project linking is not available yet. |
linkedKeyId |
required | Id of the target key it is linked to. |
Create links #️⃣
[POST] /projects/{projectId}/links/{keyId}
Description | Value |
---|---|
Accessible with project token | true |
Accessible with organization token | true |
Need write permission | true |
Available from role | reviewer |
API level | normal |
Create a new link from keyId
to the key specified in the request body.
It’s not possible to create a link to a key that is already linked to another one.
Sample Request #️⃣
curl --request PUT \
--url https://api.localazy.com/projects/{projectId}/links/{keyId} \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json' \
--data '{
"keyId": "_a8044180069099765445",
"project": "target-project"
}'
Request Object
Field | Description |
---|---|
keyId |
Id of the target key. |
project |
Id or slug of the target project. If omitted, the current project is used instead. The user invoking the request must have at least the reviewer role in the target project. |
Sample Response #️⃣
{
"result": true
}
Remove links #️⃣
[DELETE] /projects/{projectId}/links/{keyId}
Description | Value |
---|---|
Accessible with project token | true |
Accessible with organization token | true |
Need write permission | true |
Available from role | reviewer |
API level | normal |
Remove the link for keyId
if it exists.
Sample Response #️⃣
{
"result": true
}