Hi
The template replacement code does not work for our custom app.
The options
are used when using client.request.get
.
let options = {
headers: {
Authorization: "Basic <%= encode(iparam.api_key) %>",
'Content-Type': 'application/json'
}
};
let pagedRequestURL = ... // url with some GET query params to paginate etc.
let data = await client.request.get(pagedRequestURL, options)
Response:
Error while substituting the templates"
status: 400
errorSource: "APP"
We would appreciate your insights on what we’re missing.
From fdk.log
when testing with dev=true
with some values replaced:
2022-12-13 13:16:35.876 +0100 [debug] (e[34mdata-util.jse[0m) e[31mRead {"our_app_as_101_101_freshservice":{"our_app_as_101_101_custom_iparams":{"__meta":{"secure":["apiKey"]},"domainName":"our-freshservice-instance","apiKey":"abc123abc","$domainName":{"url":"https://our-freshservice-instance.freshservice.com","name":"freshservice"}}}}e[0m
2022-12-13 13:16:35.879 +0100 [debug] (e[34mdata-util.jse[0m) e[31mRead {"our_app_as_101_101_freshservice":{"our_app_as_101_101_custom_iparams":{"__meta":{"secure":["apiKey"]},"domainName":"our-freshservice-instance","apiKey":"abc123abc","$domainName":{"url":"https://our-freshservice-instance.freshservice.com","name":"freshservice"}}}}e[0m
2022-12-13 13:16:35.880 +0100 [debug] (e[34miframe.jse[0m) e[31mResponding to product with {"configs":{"domainName":"our-freshservice-instance","$domainName":{"url":"https://our-freshservice-instance.freshservice.com","name":"freshservice"}},"displayName":"our-app-moniker","product":{"freshservice":{"location":{"ticket_sidebar":{"url":"agent/index.html","icon":"agent/styles/images/icon.svg"}}}},"features":["db"],"actions":false,"omni":false,"products":["freshservice"],"platform":"2.2","v2":[{"id":1,"version_id":1,"configs":{"domainName":"our-freshservice-instance","apiKey":"abc123abc","$domainName":{"url":"https://our-freshservice-instance.freshservice.com","name":"freshservice"}},"displayName":"our-app-moniker","placeholders":{"ticket_sidebar":{"url":"http://localhost:10001/iframe/index.html","icon":"styles/images/icon.svg"}}}]}e[0m
2022-12-13 13:16:37.247 +0100 [debug] (e[34mdata-util.jse[0m) e[31mRead {"our_app_as_101_101_freshservice":{"our_app_as_101_101_custom_iparams":{"__meta":{"secure":["apiKey"]},"domainName":"our-freshservice-instance","apiKey":"abc123abc","$domainName":{"url":"https://our-freshservice-instance.freshservice.com","name":"freshservice"}}}}e[0m
2022-12-13 13:16:37.248 +0100 [debug] (e[34mdata-util.jse[0m) e[31mRead {"our_app_as_101_101_freshservice":{"our_app_as_101_101_custom_iparams":{"__meta":{"secure":["apiKey"]},"domainName":"our-freshservice-instance","apiKey":"abc123abc","$domainName":{"url":"https://our-freshservice-instance.freshservice.com","name":"freshservice"}}}}e[0m
2022-12-13 13:16:37.248 +0100 [debug] (e[34miframe.jse[0m) e[31mResponding to product with {"configs":{"domainName":"our-freshservice-instance","$domainName":{"url":"https://our-freshservice-instance.freshservice.com","name":"freshservice"}},"displayName":"our-app-moniker","product":{"freshservice":{"location":{"ticket_sidebar":{"url":"agent/index.html","icon":"agent/styles/images/icon.svg"}}}},"features":["db"],"actions":false,"omni":false,"products":["freshservice"],"platform":"2.2","v2":[{"id":1,"version_id":1,"configs":{"domainName":"our-freshservice-instance","apiKey":"abc123abc","$domainName":{"url":"https://our-freshservice-instance.freshservice.com","name":"freshservice"}},"displayName":"our-app-moniker","placeholders":{"ticket_sidebar":{"url":"http://localhost:10001/iframe/index.html","icon":"styles/images/icon.svg"}}}]}e[0m
2022-12-13 13:16:37.310 +0100 [debug] (e[34miframe.jse[0m) e[31mResponding with contents of /index.htmle[0m
2022-12-13 13:16:37.360 +0100 [debug] (e[34miframe.jse[0m) e[31mResponding with contents of /scripts/app.jse[0m
2022-12-13 13:16:37.361 +0100 [debug] (e[34mcoverage-util.jse[0m) e[31mInstrumenting /Users/cardboard/projects/com.freshservice.our-freshservice-instance/our-app-moniker/app/scripts/app.jse[0m
2022-12-13 13:16:39.801 +0100 [debug] (e[34mcoverage-util.jse[0m) e[31mWriting coverage.e[0m
2022-12-13 13:16:41.463 +0100 [debug] (e[34mcoverage-util.jse[0m) e[31mWriting coverage.e[0m