For a Roku app I'm building, I need to get the list of channels for a Vimeo user. It's public data, so I can grab it with their Simple API, which looks like this example:
https://vimeo.com/api/v2/user17146517/albums.json
That request works great just by visiting the url - I get an array of JSON objects. The request is set up (synchronously) as such in the Roku project:
req = createObject("roUrlTransfer")
req.setUrl("https://vimeo.com/api/v2/user17146517/albums.json")
response = req.getToString()
print "response: "; response
And response comes up empty. When I tried the request asynchronously, the request times out and I get nothing back. I have also tried using an authenticated request to the full Vimeo API, but see the same problem.
This block of code works great for other urls. Something simple like the JSON Test APIs give me data back. I found a list of video playlists on Khan Academy (http://www.khanacademy.org/api/v1/playlists) formatted similarly to the Vimeo API I want to hit, and that works great as well. What's Vimeo doing differently that I'm missing? Thanks!
To make HTTPS/SSL requests in BrightScript, you need to explicitly set the certificates file. Try this:
req = createObject("roUrlTransfer")
req.setCertificatesFile("common:/certs/ca-bundle.crt")
req.setUrl("https://vimeo.com/api/v2/user17146517/albums.json")
response = req.getToString()
print "response: "; response