This shortcode is no longer actively supported. If you need to make HTTP requests, take a look at the HTTP Requests page.

Shortcode: ^httpGetJSONValue()

Makes an HTTP GET request to the supplied URL and inserts a specified value from the response into the bot's message. The HTTP response must be JSON.

^httpGetJSONValue(url, valuePath[, errorMessage])

Parameter Sample Value Description
url "" Required. The URL to make a GET request
valuePath "" Required. Dot-notation specifying the path in the JSON response to retrieve the resultant value from. Dot-notation mirrors that of the Lodash _.get operation.
errorMessage "Could not fetch result" Optional. If the request times out, receives a non-200, or otherwise fails, show this message to the user.

Example Usage

+ find me [*] nearby
- Here's the top result for <star> from Foursquare: ^httpGetJSONValue("<star>", "", "Could not fetch result")