sree
sree

Reputation: 21

How to call external API using Velocity Template Language

I am working with Velocity Template Language. I want to invoke a rest api to get the response using VTL. How can I call an external rest api to get the data using Velocity Template Language?

Upvotes: 0

Views: 1130

Answers (1)

Claude Brisson
Claude Brisson

Reputation: 4150

If you have the Velocity Tools in your context, you can use the JsonTool or the XmlTool (depending on the API return format).

#set($result = $json.fetch('https://your/rest/api')

Upvotes: 0

Related Questions