deactivated-5b17b9d9a59ea's forum posts

Avatar image for deactivated-5b17b9d9a59ea
#1 Edited by deactivated-5b17b9d9a59ea (4 posts) -

@laika: nope. The browser copy & paste request ist done in a browser on my MacBook. The request from the PHP script is executed on my server. So they come from different IP addresses and machines.

Avatar image for deactivated-5b17b9d9a59ea
#2 Posted by deactivated-5b17b9d9a59ea (4 posts) -

Hey guys and @jslack,

I'm having some troubles using your API.
I've signed up for an API key, tested an API call in my browser and got a successful response.
Then I've implemented it into my project which is a PHP project.
But when I try to get the response via PHP it fails. It always throws a 403 error, forbidden.

So, is there a restriction I don't know of? Any IP whitelisting options or request methods that are restricted?
I'm trying to get the JSON response with "file_get_contents". I've also tried getting it with "fopen" or CURL.
You can see the error message below (Token replaced).

Warning: file_get_contents(http://www.giantbomb.com/api/game/3030-12572/?api_key=<TOKEN>&format=json&field_list=name,aliases): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in /home/.sites/19/site2864341/web/cms/ext/quiz/pi1/get_giantbomb_data.php on line 18

If I call the API by opening the URL in my browser, I get a wonderful response:

{"error":"OK","limit":1,"offset":0,"number_of_page_results":1,"number_of_total_results":1,"status_code":1,"results":{"aliases":"OOT\nLOZ:OOT\nZelda no Densetsu: Toki no Ocarina\n\u30bc\u30eb\u30c0\u306e\u4f1d\u8aac \u6642\u306e\u30aa\u30ab\u30ea\u30ca\nZelda 64","name":"The Legend of Zelda: Ocarina of Time"},"version":"1.0"}

Any help on that? :)
I really can't explain what's going on.

Thanks a million in advance!