Utility requests
Weather, calculation, translation, GIFs and many more to enrich your actions.
A utility request can be used to get results from specific functions natively provided by Actioner.
Getting the weather status or a translation of a phrase or adding up GIFs from Giphy to your action outputs are some utility functions in Actioner. You can dynamically generate request parameters or manually set them. Utility requests enables you to design your actions with diverse outputs quickly.
Add a utility request
To add a new utility request, go to Requests tab in your action and click + Add request. Next, select Utility as the request type, select the method from the list and give a name to your request.
Available options are Translate, Weather, Calculate, Find GIF, Trending GIFs, Local time, Stock price, Currency exchange, Cryptocurrency price, Convert text format.
Utility request types
Translate
Do you need the translation of your messages in another language? Use this method with selecting from and to languages. It automatically returns your message's translated text.
Parameters
- From: The language that will be translated from.
- To: The language that will be translated to.
- Text: The text that will be translated.
Example response
Common successful response
{
"translatedText": "サムライ"
}
Weather
When you need to show the weather status in your actions, use this method. It returns the weather for the selected location.
Parameters
- Location: The name of location that you want to get the weather status.
Example response
Common successful response
{
"humidityPercentage":66,
"temperatureInCelsius":17.74,
"temperatureInFahrenheit":49.739998,
"locationAddress":"Sydney NSW, Australia",
"windSpeed":5.14,
"cloudinessPercentage":9,
"weatherConditions":[
{
"summary":"clear sky",
"iconUrl":"http://openweathermap.org/img/wn/01d@2x.png"
}
]
}
Calculate
Use this method if you want to get the result of a mathematical calculation. Enter an expression or dynamically add it and get the calculated result.
Parameters
- Expression: The mathematical expression that you want to get the result of. Visit here to see the list of operations you can use.
Example response
Common successful response
{
"result": "4"
}
Common error response
{
"type":"utility",
"errorContext":{
"type":"genericError",
"requestDefinitionId":"c92ce191-3b9a-4374-8e41-4969d562efbc",
"requestName":"calculate",
"errorCode":6000,
"errorCodeDisplay":"Provided input is invalid",
"errorMessage":"Unknown operator or function: asdasd"
},
"requestName":"calculate",
"durationInMillis":9
}
Find GIF
Are you looking or a celebration GIF when a deal is won? Or just want some animation in your actions? Use this method to find GIFs from Giphy.
Parameters
- Keyword: The keyword to search a GIF in Giphy.
Example response
Common successful response
{
"gif":{
"markdownUrl":"https://media2.giphy.com/media/cGhL5tGgqQHOEStCRx/giphy-downsized.gif?cid=a520b557jit7jf5gq68f8zzqf3pa0t16l24djobzp30a1uev&rid=giphy-downsized.gif&ct=g",
"giphyUrl":"https://giphy.com/gifs/credible-credibull-thecredibull-cGhL5tGgqQHOEStCRx",
"id":"cGhL5tGgqQHOEStCRx",
"title":"Wave Smile GIF by credible"
}
}
Trending GIFs
Do you want to add some trending GIFs in your actions? Use this method to embed a trendy Giphy in your actions.
Parameters
This request does not take any parameters.
Example response
Common successful response
{
"trendingGifs":[
{
"markdownUrl":"https://media2.giphy.com/media/zu0jCfOWqOJ4Z0f9AR/giphy-downsized.gif?cid=a520b557ryd1bxj1g3a2a8fqsp0mt9gd8zhnageb9w4ug3d1&rid=giphy-downsized.gif&ct=g",
"giphyUrl":"https://giphy.com/gifs/mlb-win-cheering-astros-zu0jCfOWqOJ4Z0f9AR",
"id":"zu0jCfOWqOJ4Z0f9AR",
"title":"World Series Win GIF by MLB"
},
{
"markdownUrl":"https://media4.giphy.com/media/E098b2VDbHBThqJbM8/giphy.gif?cid=a520b557ryd1bxj1g3a2a8fqsp0mt9gd8zhnageb9w4ug3d1&rid=giphy.gif&ct=g",
"giphyUrl":"https://giphy.com/gifs/elephant-birthday-cake-never-forgets-E098b2VDbHBThqJbM8",
"id":"E098b2VDbHBThqJbM8",
"title":"Happy Birthday Celebration GIF by Susanne Lamb"
}
]
}
Local time
Instead of manually calculating, use this method to automatically get the local time of a city or country and insert it into your actions.
Parameters
- Keyword: The keyword to search a GIF in Giphy.
Example response
Common successful response
{
"location":"Turkey",
"epochTimeMillis":1667547804953,
"timeZone":{
"id":"Europe/Istanbul",
"name":"GMT+03:00"
},
"date":{
"year":2022,
"monthValue":11,
"month":"November",
"day":4,
"formatted":"Friday, November 04, 2022"
},
"time":{
"hour":10,
"minute":43,
"second":24,
"formatted":"10:43"
}
}
Stock price
Use this method if you want to get the price of a specific stock. Enter the stock symbol or dynamically add it to get its price.
Parameters
- Symbol: The symbol of the stock that you want to get the price of.
- Amount (optional): The amount of the stock. If not set, it is evaluated as
1
unit by default.
Example response
Common successful response
{
"priceInUsd": "174.17"
}
Currency exchange
Looking to calculate how much a product costs in another currency? Use this method to get the calculated amount in a specific currency.
Parameters
- From: The symbol of the currency that will be converted from.
- To: The symbol of the currency that will be converted to.
- Amount (optional): The amount of the currency. If not set, it is evaluated as
1
unit by default.
Example response
Common successful response
{
"result": "80.70997"
}
Cryptocurrency price
Looking to return the current price of a cryptocurrency? Use this method to get its price in a US Dollars.
Parameters
- Symbol: The symbol of the cryptocurrency that you want to get the price of.
- Amount (optional): The amount of the cryptocurrency. If not set, it is evaluated as
1
unit by default.
Example response
Common successful response
{
"priceInUsd": "1579.35"
}
Common error response
{
"type":"utility",
"errorContext":{
"type":"genericError",
"requestDefinitionId":"c92ce191-3b9a-4374-8e41-4969d562efbc",
"requestName":"calculate",
"errorCode":6000,
"errorCodeDisplay":"Provided input is invalid",
"errorMessage":"Unknown operator or function: asdasd"
},
"requestName":"calculate",
"durationInMillis":9
}
Convert text format
Use this method to convert data from JSON to YAML or YAML to JSON.
Parameters
- From: The language that will be translated from. It can be JSON or YAML.
- To: The language that will be translated to. It can be JSON or YAML.
- Text to be converted: The text that will be converted.