The Movie Database サポート

I am just making a basic ajax call to 'http://api.themoviedb.org/3/genre/movie/list&api_key=#####' I keep getting a 'Cannot get' error? what am I doing wrong?

10 replies (on page 1 of 1)

Jump to last post

Hi Luke,

I'm not sure. Everything looks fine to me. How are you making the request?

tbell$ curl -v "https://api.themoviedb.org/3/genre/movie/list?api_key=###"
*   Trying 54.225.152.113...
* Connected to api.themoviedb.org (54.225.152.113) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate: *.themoviedb.org
* Server certificate: RapidSSL SHA256 CA
* Server certificate: GeoTrust Global CA
> GET /3/genre/movie/list?api_key=### HTTP/1.1
> Host: api.themoviedb.org
> User-Agent: curl/7.43.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Cache-Control: public, max-age=28800
< Content-Type: application/json;charset=utf-8
< Date: Sat, 13 Aug 2016 15:37:27 GMT
< ETag: "43f17b8c287f6cc19a0d5db8802a0815"
< Server: openresty
< Status: 200 OK
< X-Memc: HIT
< X-Memc-Age: 9497
< X-Memc-Expires: 19303
< X-Memc-Key: 35d4905f7b79deee175de1f8c34b463b
< X-RateLimit-Limit: 40
< X-RateLimit-Remaining: 39
< X-RateLimit-Reset: 1471102657
< Content-Length: 577
< Connection: keep-alive
<
* Connection #0 to host api.themoviedb.org left intact
{"genres":[{"id":28,"name":"Action"},{"id":12,"name":"Adventure"},{"id":16,"name":"Animation"},{"id":35,"name":"Comedy"},{"id":80,"name":"Crime"},{"id":99,"name":"Documentary"},{"id":18,"name":"Drama"},{"id":10751,"name":"Family"},{"id":14,"name":"Fantasy"},{"id":10769,"name":"Foreign"},{"id":36,"name":"History"},{"id":27,"name":"Horror"},{"id":10402,"name":"Music"},{"id":9648,"name":"Mystery"},{"id":10749,"name":"Romance"},{"id":878,"name":"Science Fiction"},{"id":10770,"name":"TV Movie"},{"id":53,"name":"Thriller"},{"id":10752,"name":"War"},{"id":37,"name":"Western"}]}

Here it is:

var promise = $.Deferred();
    Ember.$.ajax({
        type: 'GET',
        url: 'https://api.themoviedb.org/3/genre/movie/list&api_key=#####',
        async: false,
        contentType: 'application/json',
        dataType: 'jsonp'
    }).then(function (response) {
        console.log(response)
        promise.resolve(response);
    })
    return promise.promise();
}

Even though you have your dataType set to jsonp, is is sending along a callback?

This test of mine here is working fine (make sure to replace your API key on line 11).

I am using the api in many other instances, genre has been the only on genre. I see that you added a query at the end, is that necessary? I am trying to get the list of genres to use for the movies gennre codes that I get.

No, it is not necessary. It was accidentally left from a previous example.

That's not a valid HTTP request. You're looking for:

https://api.themoviedb.org/3/genre/movie/list?api_key=####&callback=jQuery22408132628371243029_1471207855881&_=1471207855884

forgive me. I am not seeing a difference between your request and my request

You're starting your query string with an ampersand. That's not valid HTTP, so it's ignoring your API key param and only reading from the question mark and on. In my example, I fixed that for you.

thanks for your help. that fixed it

映画やテレビ番組が見つかりませんか?ログインして作成してください。

全般

s 検索バーに移動する
p プロファイルメニューを開く
esc 開いているウィンドウを閉じる
? キーボードショートカットウィンドウを開く

メディアのページ

b 戻る(または該当する場合は親に)
e 編集ページに行く

テレビ番組のシーズンのページ

(右矢印)次のシーズンに行く
(左矢印)前のシーズンに戻る

テレビ番組のエピソードのページ

(右矢印)次のエピソードに進む
(左矢印)前のエピソードに戻る

全ての画像のページ

a 画像追加ウィンドウを開く

全ての編集ページ

t 翻訳選択を開く
ctrl+ s フォームを送信する

ディスカッションのページ

n 新しいディスカッションを作成する
w 監視ステータスを切り替える
p 公開/非公開を切り替える
c 閉じる/開くを切り替える
a アクティビティを開く
r ディスカッションに返信
l 最後の返事に行く
ctrl+ enter メッセージを送信する
(右矢印)次のページ
(左矢印)前のページ

設定

このアイテムを評価したり、リストに追加したりしたいですか?

ログイン

メンバーではありませんか?

登録してコミュニティに参加