perk
10 years agoAdept
TemplateModelException during JSON GET
I have the following code:
<#assign url_getUser = "https://DOMAIN.zendesk.com/api/v2/users?query=USER@COMPANY.com" />
<#assign response_user = http.client.request(url_getUser).header("Authorization", "Bearer "+ TOKEN).json().get() />
However, I keep getting the following error from the 2nd line:
Method "public final lithium.coreapi.webui.template.models.HttpClientResponseTemplateModel lithium.coreapi.webui.template.models.HttpClientRequestTemplateModel.get() throws freemarker.template.TemplateModelException" threw an exception when invoked on lithium.coreapi.webui.template.models.HttpClientRequestTemplateModel object "lithium.coreapi.webui.template.models.HttpClientRequestTemplateModel@6c4c48f".
If I change it to
<#assign url_getUser = baseUrl + "users/"+ "ID" + ".json" />
It works fine. I am able to make the first call in call but it doesn't work in freemarker. Any ideas why?