Recent searches
No recent searches
Request: Language parameter for form and ticket API endpoints
Posted Feb 28, 2023
Hello!
We are planning on adding translations to our website. We use Zendesk forms that we fetch via the API. We have tried using dynamic content to translate the form fields. The problem is that we have not found a way to retrieve the correct translation depending on the locale of the website. We contacted your support and got it confirmed that it is not possible and that the API will only return the default language set in the Zendesk portal.
What we would need is something like this:
/api/v2/ticket_forms/4412295082770?lang='se-sv'
/api/v2/ticket_fields?lang='se-sv'
If no language parameter is provided the default language will be returned.
We would really appreciate this feature. In the meanwhile, we will have to hardcode some translations into our form component. This is not ideal since it requires developers to update the texts.
Kind regards, Michaela
0
10 comments
Sabra
This functionality should exist using the "locale" param instead of "lang". For example:
/api/v2/ticket_forms/4412295082770?locale='se-sv'
Best,
Sabra (she/her)
Principal Technical Support Engineer | Central Time
0
Michaela Sääw
That doesn't seem to work for these endpoints unfortunately. It also seems to always return the english translation even though the default language is set to Swedish. So without any parameters it should return Swedish content even though we are using Dynamic Content, right?
Extract from API response. Using /api/v2/ticket_fields?locale='se-sv'
0
Sabra
When I hit the ticket fields endpoint in your sandbox account with the locale se-sv and locale en, I can see different results based on the locale specified. The title_in_portal property is what we are looking at when the locale parameter is specified.
0
Michaela Sääw
Hi again! Looks promising, however, I can't get it to work. I must be missing something on my end.
I tested directly through Postman and added the query param in the request in our code, but still no luck.
0
Sabra
0
Michaela Sääw
Hi! Got some progress.
We got https://fortnox1409057695.zendesk.com/api/v2/ticket_fields?locale=sv to work, note that the query parameter is missing the country code. I noticed that you used the country code in your locale param, and it's strange that the format does not work for us.
Is this by design and is it safe to use this format? To be sure the API won't stop accepting this and require se-sv all of a sudden.
0
Sabra
0
Sabra
sv
andse-sv
locales. We have pushed a change to your Sandbox account (fortnox1409057695) that might fix this behavior. Can you please try again and let us know your results?0
Sabra
0
Marsy
I am having a similar issue. We have added our content into the dynamic content items for a few ticket field names with a default language of English and a variant of Spanish. I have replaced the names in our ticket fields drop down to use the dynamic content placeholders. However I am unable to pull the ticket field using the ticket field id and the language. I have added the following into postman zendesk.com/api/v2/ticket_fields/XXXXXXXXX9217?locale=es with no luck on obtaining the correct verbiage in the correct language. I only see the dynamic content placeholder
"id": XXXXXXXX769,
"name": "Sensors:: Dexcom:: Syncing/connections issues",
"raw_name": "{{dc.sensors_dexcom_syncing_connections_issues_us}}",
"value": "sensors_dexcom_syncing_connections_issues_us",
"default": false
0