Fields

Snippet translation objects have the following fields and links:

Fields

field name description
locale ISO language code
text The content of the translation

Links

rel class embeddable? description
self snippet_translation no this snippet translation

List

Retrieve a paginated list of snippet translations.

GET https://yoursite.desk.com/api/v2/snippets/:snippet_id/translations

Applicable Roles

Agent, Reporting Agent, Workflow Manager, Knowledgebase Manager, Content Manager, Business Manager, Administrative Manager, Administrator, Knowledgebase Adminstrator, and Billing Administrator

Example Curl Request

1
2
3
$ curl https://yoursite.desk.com/api/v2/snippets/my_snippet/translations \
    -u email:password \
    -H 'Accept: application/json'

Example Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{
  "total_entries": 2,
  "page": 1,
  "_links": {
    "self": {
      "href": "/api/v2/snippet_translations?page=1&per_page=50",
      "class": "page"
    },
    "first": {
      "href": "/api/v2/snippet_translations?page=1&per_page=50",
      "class": "page"
    },
    "last": {
      "href": "/api/v2/snippet_translations?page=1&per_page=50",
      "class": "page"
    },
    "next": null,
    "previous": null
  },
  "_embedded": {
    "entries": [
      {
        "locale": "en",
        "text": "hello",
        "_links": {
          "self": {
            "href": "/api/v2/snippets/my_snippet/translations/en",
            "class": "snippet_translation"
          }
        }
      },
      {
        "locale": "ja",
        "text": "ohayou",
        "_links": {
          "self": {
            "href": "/api/v2/snippets/my_snippet/translations/ja",
            "class": "snippet_translation"
          }
        }
      }
    ]
  }
}

Show

Retrieve a single snippet translation.

GET https://yoursite.desk.com/api/v2/snippets/:snippet_id/translations/:locale

Applicable Roles

Agent, Reporting Agent, Workflow Manager, Knowledgebase Manager, Content Manager, Business Manager, Administrative Manager, Administrator, Knowledgebase Adminstrator, and Billing Administrator

Example Curl Request

1
2
3
$ curl https://yoursite.desk.com/api/v2/snippets/my_snippet/translations/ja \
    -u email:password \
    -H 'Accept: application/json'

Example Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
  "locale": "en",
  "text": "hello",
  "_links": {
    "self": {
      "href": "/api/v2/snippets/my_snippet/translations/en",
      "class": "snippet_translation"
    }
  }
}

Create

Create a snippet translation.

POST https://yoursite.desk.com/api/v2/snippets/:snippet_id/translations

Applicable Roles

Knowledgebase Manager, Content Manager, Business Manager, Administrative Manager, Administrator, Knowledgebase Adminstrator, and Billing Administrator

Example Curl Request

1
2
3
4
5
6
$ curl https://yoursite.desk.com/api/v2/snippets/my_snippet/translations \
    -u email:password \
    -X POST \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json' \
    -d '{"locale":"en", "text":"hello"}'

Example Request Body

1
2
3
4
{
  "text": "hello",
  "locale": "en"
}

Example Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
  "locale": "en",
  "text": "hello",
  "_links": {
    "self": {
      "href": "/api/v2/snippets/my_snippet/translations/en",
      "class": "snippet_translation"
    }
  }
}

Update

Update an existing snippet translation.

PATCH https://yoursite.desk.com/api/v2/snippets/:snippet_id/translations/:locale

Applicable Roles

Knowledgebase Manager, Content Manager, Business Manager, Administrative Manager, Administrator, Knowledgebase Adminstrator, and Billing Administrator

Example Curl Request

1
2
3
4
5
6
$ curl https://yoursite.desk.com/api/v2/snippets/my_snippet/translations/en \
    -u email:password \
    -X PATCH \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json' \
    -d '{"text":"hello"}'

Example Request Body

1
2
3
{
  "text": "hello"
}

Example Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
  "locale": "en",
  "text": "hello",
  "_links": {
    "self": {
      "href": "/api/v2/snippets/my_snippet/translations/en",
      "class": "snippet_translation"
    }
  }
}

Delete

Delete a snippet translation.

DELETE https://yoursite.desk.com/api/v2/snippets/:snippet_id/translations/:locale

Applicable Roles

Knowledgebase Manager, Content Manager, Business Manager, Administrative Manager, Administrator, Knowledgebase Adminstrator, and Billing Administrator

Example Curl Request

1
2
3
4
5
$ curl https://yoursite.desk.com/api/v2/snippets/my_snippet/translations/ja \
    -u email:password \
    -X DELETE \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json'

Example Response

1
204 No Content