Assistance de TMDB

Did something change? I am normally expecting a JSON response that has success assigned a value of 1 or true but now it outputs nothing when I test it in command prompt. Even weirder, when I go to the official API docs here to test it out the response I get is literally "OK". That's it. Two characters, def not in JSON format. To be clear I get "OK" as the response when I click "Try It!". Take note this is not the same format as expected since the successful application/json response example that is provided looks as one would expect. (website calls it "200 - Result example" in the drop down)

However, whenever I purposely use a wrong API key I get a proper failure response that is in JSON format. Failure responses still behaves as expected on the API doc testing page too.

I want to make it clear my API key works fine. I can use it for all queries I try. Only the API Key Validate Key query is the one giving me this trouble.

Any insight on what is going on here? Why would I no longer be receiving a JSON response when it's successful using this query? Is this some new expectation, that we are to assume it's successful if said response is empty? I get I can see "HTTP/1.1 200 OK" using the verbose output but that isn't the traditional JSON format response I've come to expect.

C:\Users\Scott>curl -v https://api.themoviedb.org/3/authentication?api_key=###
* Host api.themoviedb.org:443 was resolved.
* IPv6: (none)
* IPv4: 52.85.151.48, 52.85.151.28, 52.85.151.18, 52.85.151.24
*   Trying 52.85.151.48:443...
* Connected to api.themoviedb.org (52.85.151.48) port 443
* schannel: disabled automatic use of client certificate
* ALPN: curl offers http/1.1
* ALPN: server accepted http/1.1
* using HTTP/1.x
> GET /3/authentication?api_key=### HTTP/1.1
> Host: api.themoviedb.org
> User-Agent: curl/8.9.1
> Accept: */*
>
* Request completely sent off
< HTTP/1.1 200 OK
< Content-Type: text/html;charset=utf-8
< Content-Length: 0
< Connection: keep-alive
< Date: Sun, 15 Dec 2024 23:22:59 GMT
< Server: openresty
< Cache-Control: public, max-age=0
< Vary: accept-encoding
< X-Cache: Miss from cloudfront
< Via: 1.1 d9057c384f4ac5ba2672d2ff44de7e08.cloudfront.net (CloudFront)
< X-Amz-Cf-Pop: IAD89-C3
< Alt-Svc: h3=":443"; ma=86400
< X-Amz-Cf-Id: iQcfRiGGc57gKhASMeqNBOjwCJeWwZIJ_0DmF3G2kBp_DVkaDMVLwA==
< Vary: Origin
<
* Connection #0 to host api.themoviedb.org left intact

2 réponses (sur la page 1 sur 1)

Jump to last post

Hi @skizzosjt,

We just didn't reply with a JSON object on the /authentication call. It was originally meant as a simple 200/401 response and nothing more.

I did however just deploy a tweak to it, so now it returns a JSON object.

Cheers.

@travisbell said:

Hi @skizzosjt,

We just didn't reply with a JSON object on the /authentication call. It was originally meant as a simple 200/401 response and nothing more.

I did however just deployed a tweak to it, so now it returns a JSON object.

Cheers.

Thanks. That was the one value I was using. (success) So my script is back to working. I appreciate the help!

Un film, une émission télévisée ou un artiste est introuvable ? Connectez-vous afin de créer une nouvelle fiche.

Général

s Mettre le curseur dans la barre de recherche
p Ouvrir le menu du profil
esc Fermer une fenêtre ouverte
? Ouvrir la fenêtre des raccourcis clavier

Sur les pages des médias

b Retour (ou vers le parent si faisable)
e Afficher la page de modification

Sur les pages des saisons des émissions télévisées

Afficher la saison suivante (flèche droite)
Afficher la saison précédente (flèche gauche)

Sur les pages des épisodes des émissions télévisées

Afficher l'épisode suivant (flèche droite)
Afficher l'épisode précédent (flèche gauche)

Sur toutes les pages des images / photos

a Ouvrir la fenêtre d'ajout d'image / photo

Sur toutes les pages de modifications

t Ouvrir le sélecteur de traduction
ctrl+ s Envoyer le formulaire

Sur les pages des discussions

n Créer une nouvelle discussion
w Basculer le statut de suivi
p Basculer publique / privée
c Basculer fermer / ouvrir
a Ouvrir l'activité
r Répondre à la discussion
l Afficher la dernière réponse
ctrl+ enter Envoyer votre message
Page suivante (flèche droite)
Page précédente (flèche gauche)

Paramètres

Vous souhaitez évaluer ou ajouter cet élément à une liste ?

Connexion