Apply template to language profile

Hi,

is it possible to apply a template to a language profile via the API?

I.e. I have an entity with primary language “de” and secondary language “en_DE”.

a) I can set the “de” content by using a template in either the create or update request.
b) I can set individual values using “upsert” from the language profile API.

But:
d) I cannot apply a template with language “en_DE” using the entity API [1]
c) There is no parameter for a template in the upsert call [2]
d) I cannot read the values from the template (to set them manually via upsert).

How do you solve this?

Cheers

-achim

[1]
“type”: “FATAL_ERROR”,
“message”: “Template location-de-en with language en_DE cannot be applied to an entity with language code de”

[2]

Hi @Achim_Koch - unfortunately this isn’t something we support today, but we hope to support it in the future.

Some additional context from @Jesse_Shatsky: One possible flow is to apply the template to the primary profile on create, fetch the entity to grab the current content and filter down to relevant fields, then apply those values to the alt profile via the Entity Language Profiles endpoints. It’s a little hacky, but is probably better than statically maintaining a version of the template offline.

Let us know if there’s anything else we can help with!

Hi Katja,

actually it seems, that it is working… After a hint from Yext support I tried:

PUT https://api.yext.com/v2/accounts/{{account_id}}/entityprofiles/{{entity_id}}/en_DE?api_key={{api_key}}&v={{YYYYMMDD}}&templateId={{_templateId}}

and it’s working like charm. Only the documentation forgot to mention the templateId query parameter.

That’s great! Thanks for pointing that out in the documentation as well, we can make sure that’s clarified.