The Movie Database Support

I go through the authentication process using v4 with no issues, but how can I get the user data if I have the account_id & access_token that is returned from v4 auth? The only result I found is https://api.themoviedb.org/3/account/{account_id} but it needs an integer id, while the one returned from v4 is a String

4 replies (on page 1 of 1)

Jump to last post

Not sure I totally understand your problem - but I believe the account_id is a unique integer that identifies each user account. It is not specific to v3 or v4 endpoints. Mine is an 8 digit integer. So you can access account details using the url you specified using either v3 or v4 authentication.

Doc is here: https://developer.themoviedb.org/reference/account-details

If your not sure what your account_id is, you can click the "Log In" button in the upper right corner of the doc page, then navigate back to the same page and your number will be autofilled in the account_id field.

Let me explain further, using Travis' jQuery auth pages:

For the first example (v4 auth), I am using http://dev.travisbell.com/play/v4_auth.html
This is what I get back when a user authenticates:
Account ID
62630317f495ee0e12997843
This id is not an integer

For second example (v3 auth), I am using http://dev.travisbell.com/play/v3_auth.html
This is what I get back when a user authenticates:
Session ID
bf0ba107fad535e7e4282724e2bcca897394a14c
Which is not an account ID and not an integer also

So, in both cases, when a user uses my app and logs in, how do I get their account ID so that I can use it to get their profile data like name/image?

Ok, so you need other user's account id. After a little experimentation with the "try it" button on the doc page, these queries work ("account_id" is the literal string and not a number)

https://api.themoviedb.org/3/account/account_id

https://api.themoviedb.org/3/account/account_id?session_id=SESSION_ID

The first call would have to be returning the account details associated with the authentication token, there is no other possibility. The second call could be returning the same as the first or it could be returning the account associated with the session id. I don't have any test accounts so the session id I used was created from my own account.

You could try the second form and see if it works for any user, or perhaps Travis will come along and shed some light on this.

@abalmagd said:

Let me explain further, using Travis' jQuery auth pages:

For the first example (v4 auth), I am using http://dev.travisbell.com/play/v4_auth.html
This is what I get back when a user authenticates:
Account ID
62630317f495ee0e12997843
This id is not an integer

For second example (v3 auth), I am using http://dev.travisbell.com/play/v3_auth.html
This is what I get back when a user authenticates:
Session ID
bf0ba107fad535e7e4282724e2bcca897394a14c
Which is not an account ID and not an integer also

So, in both cases, when a user uses my app and logs in, how do I get their account ID so that I can use it to get their profile data like name/image?

hello. i have same question. you find answer?

Can't find a movie or TV show? Login to create it.

Global

s focus the search bar
p open profile menu
esc close an open window
? open keyboard shortcut window

On media pages

b go back (or to parent when applicable)
e go to edit page

On TV season pages

(right arrow) go to next season
(left arrow) go to previous season

On TV episode pages

(right arrow) go to next episode
(left arrow) go to previous episode

On all image pages

a open add image window

On all edit pages

t open translation selector
ctrl+ s submit form

On discussion pages

n create new discussion
w toggle watching status
p toggle public/private
c toggle close/open
a open activity
r reply to discussion
l go to last reply
ctrl+ enter submit your message
(right arrow) next page
(left arrow) previous page

Settings

Want to rate or add this item to a list?

Login