1

When trying the live API explorer and using my api key I can get a good response. However when using the same URI link generated from the explorer within my application, I get a 403 error. However, the application makes only 1 request.

url = URI.parse("http://api.espn.com/v1/sports/basketball/nba/athletes/355?
apikey=xxxxxxxxxxxxxxxx")  
req = Net::HTTP::Get.new(url.path)
res = Net::HTTP.start(url.host, url.port) {|http|
  http.request(req)
}
puts res.body

Here's the response in the terminal:

{
  "status": "error",
  "code": 403,
  "message" : "Account Inactive"
}

403 should mean I'm exceeding my limit, but the message says Account Inactive. This is a new account and I got confirmation that it was active. Plus my API key works in the web interface.

Any ideas?

cheeseandpepper
  • 385
  • 4
  • 16
  • Looks like you're only using the path from the URI string and not passing the query parameters as well in your GET call. – Roger Raymond Oct 26 '13 at 14:11

0 Answers0