Hi, i tried to understand the sign in process for a user to be able to set watchlists, rate etc.
I request a new Token, than i use the UserName and Password to validate with login and get a new token response, but if i go to the wegsite that should verify the token i always get this error:
Invalid Request Token The access token you have submitted is invalid. Most of the time, this is because the token has expired. Try creating a new one and making sure you have copied it correctly. If you continue to have issues, contact the developer of the app you're using.
Ne možete pronaći film ili TV seriju? prijavite se da biste ga napravili.
Want to rate or add this item to a list?
Not a member?
Odgovorio Serge Sander
dana 12 srpanj 2019 u 5:54 AM
So i just got around to the "Grant Permission" Website, but even if i grant, i am not able to generate a Session id due any kind or API Key, it says invalid Key...
Odgovorio Travis Bell
dana 16 srpanj 2019 u 12:17 AM
Are you using v3 or v4 auth? Here's a one page example that walks you through all of the steps to validate and create a v4 access token for example. All of the code is front end JS so you can see exactly what is happening (there's no backend code.)
Odgovorio Serge Sander
dana 16 srpanj 2019 u 2:45 AM
I am using the Documentation from the API Homepage, so i guess it is V4, anyway, can you provide a Link to the sample codes?
Odgovorio Serge Sander
dana 16 srpanj 2019 u 3:09 AM
So i just retried from the API homepage following the steps:
Response: { "failure": true, "status_code": 17, "status_message": "Session denied." } WTF?!
Odgovorio Travis Bell
dana 16 srpanj 2019 u 11:47 AM
Oops, sorry, I didn't actually link my test scripts. It's located here.
I just gave it a run through and everything is working properly, so make sure to take a look at the source JS to see what I am doing. Paste your v4 read access token and then just click through the "step" buttons.
Odgovorio Serge Sander
dana 16 srpanj 2019 u 12:04 PM
Yes, the script works, but the results are useless, i went through to get an access token, which i cannot use anywhere, it always says, invalid API Key, you must be granted permission, i approved it, checked my account for connected Apps and it is blank.
Odgovorio Travis Bell
dana 16 srpanj 2019 u 12:17 PM
The list of approved apps in your account will only be v3 sessions. There is no v4 list.
So what is an specific example call you're trying to make that is returning an invalid key error?
P.S. you can use the authorized v4 access token here, as an example. It enables you to add/remove items to your list.
Odgovorio Serge Sander
dana 16 srpanj 2019 u 12:21 PM
Sample: I go through your Script to generate an Access Token, this token i use as my API Key for the following Reqeust to get my Watched List:
https://api.themoviedb.org/3/account/{account_id}/watchlist/movies?api_key=
But on the API HP try out i get always these responses:
{ "status_code": 7, "status_message": "Invalid API key: You must be granted a valid key." }
Odgovorio Travis Bell
dana 16 srpanj 2019 u 12:25 PM
v4 and v3 are not the same thing. You're trying to do things on v3 with a v4 token.
If you're wanting to (for example) do things with your account's watchlist, you'll need to go down the v3 session path, and not v4. The process for that is located here.
However, you can also use this method to convert a v4 (write) token to a v3 session. That could be the best thing to do since you get auth on both v3 and v4 this way. v4 lists are a lot better than v3 lists for example.
Odgovorio Serge Sander
dana 16 srpanj 2019 u 12:30 PM
Thats a pain at all, i take ma V4 Access token and use it as my API Key in the convert Method, all i get is this:
{ "failure": true, "status_code": 35, "status_message": "Invalid token." }
Odgovorio Travis Bell
dana 16 srpanj 2019 u 12:43 PM
I would suggest keeping things simple and just using v3 for now then.
Request Token
Approve token
Create Session
Add To Watchlist
Odgovorio Serge Sander
dana 16 srpanj 2019 u 12:55 PM
this does not explain how to get a valid Session ID
Anyway, while the V4 Auth is useless on the Users Side (no management), can i simply stick the V3 for now,
In my understanding of the Docs, i need to make 3 calls to get a Session ID,
i create s token, go to the page https://www.themoviedb.org/authenticate/{req token}
Approve it (the App is still not listed in the Connected Apps if i use the Docs try out section for Step 1!!!)
Anyway, i try to create a Session ID but get error "permission need t be granted"
So for dummies like me, can you please provide a simple URL for step 1,2 and 3 where i can just replace my API Key for Step 1
And finally, to confirm it is working, a simple Call to any User Section lie Details with the Session ID from step 3, just for demonstration, please?
I would love to integrate my App with tMDb, but this whole provess doesnt't work here at all and i am trying since days in verious ways...
thx in advance
Odgovorio Travis Bell
dana 16 srpanj 2019 u 12:56 PM
The
de9a8cce1d9d31e33xxxxxxxxxxxxxx
key above is a valid session ID, you can see me use it in the very next call to add an item to my watchlist. I just did these steps and it all works perfectly. The steps I outlined above are everything you need to do.Odgovorio anankassis
dana 17 ožujak 2020 u 3:29 PM
Approve token GET https://www.themoviedb.org/authenticate/03e06be965691494xxxxxxxxxxxxxxx
this part, NEVER WORKING , NEVER !!!
Odgovorio Travis Bell
dana 17 ožujak 2020 u 4:09 PM
Here's a set of v3 and v4 test scripts that I just used without any trouble:
v3
v4
All of the code is client side JS, so you can inspect the code to see exactly what I'm doing. There's nothing server side in use here.