Hi all,
I'm just learning how to use API's & I'm trying to make a simple app that returns the poster image from a user search for a movie. But I keep getting a 403 error message when I try to run the api call, here is the my code:
$.getJSON("http://themoviedb.apiary.io/3/search/movie?query=" + film + "?api_key=XXXXXXX?callback=?", function(json){ .....}); where film = the user input value (ie the movie searching for)
Can someone shwo me what I'm doing wrong please?
.לא מצאת סרט או סדרה? היכנס כדי ליצור אותם
?רוצה לדרג או להוסיף פריט אל רשימה
?לא חבר אתר
תגובה מאת Travis Bell
ב-יולי 7, 2013 ב-2:00אחרי חצות יום
Hi smathew322,
2 things. Just double checking and making sure that for "real world" requests you use our production API and not Apiary.
You're not setting the second (and third) HTTP parameters properly. You'll want to switch them to an ampersand.
Cheers.
תגובה מאת smathew322
ב-יולי 7, 2013 ב-3:10אחרי חצות יום
Hi Travis,
Thanks a lot fo the help! I made the changes as well as use the production API now and it works. But in order for me to get the image, it looks like I need to use the "Configuration" method to get the base url. Do I have to make a separate API call for this? Not really sure how to use this.
תגובה מאת Travis Bell
ב-יולי 8, 2013 ב-10:07לפני חצות יום
The typical pattern I recommend is to request it once a month and cache it. By checking once a month you can double check you're still using the valid image URL. We have changed it before and you want to make sure your images don't stop working.
תגובה מאת frimmy
ב-דצמבר 8, 2013 ב-4:10אחרי חצות יום
Thanks so much, Travis!!! Your responses helped me a lot to complete the tutorial.