I've trying to use the Google URL shortener API: https://developers.google.com/url-shortener/v1/getting_started to shorten URL's before posting them but I cant seem to get a response back. Any and all help would be appreciated.
jsonopen -uw surl https://www.googleapis.com/urlshortener/v1/url?key=[API KEY]
jsonurlmethod surl POST
jsonurlget surl "longUrl": "http://www.google.com"
echo -a $json(surl).UrlResponse
jsonurlclose
Hey thanks! That worked with one tweak:
var %data = {"longUrl":"http://www.google.com"}
JSONOpen -duw surl https://www.googleapis.com/urlshortener/v1/url?key=[API KEY]
JSONUrlMethod surl POST
JSONUrlHeader surl Content-Type: application/json
JSONUrlHeader surl Content-Length: $len(%data)
JSONUrlGet surl %data
echo -a $JSON(surl, id)