Suporte do The Movie Database

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 respostas (na página 1 de 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?

Não consegue encontrar um certo filme ou série? Inicie sessão e adicione-o.

Geral

s focus the search bar
p abrir menu do perfil
esc close an open window
? open keyboard shortcut window

Em páginas de Média

b go back (or to parent when applicable)
e ir para a página de edição

Em páginas de temporadas de séries

(seta para a direita) ir para a próxima temporada
(seta para a esquerda) ir para a temporada anterior

Em Páginas de Episódios de Séries

(seta para a direita) ir para o próximo episódio
(seta para a esquerda) ir para o episódio anterior

Em Todas as Páginas de Imagens

a abrir janela para adicionar imagem

Em Todas as Páginas de Edição

t open translation selector
ctrl+ s submit form

Em Páginas de Discussão

n criar uma nova discussão
w toggle watching status
p toggle public/private
c toggle close/open
a abrir actividade
r reply to discussion
l ir para a última resposta
ctrl+ enter submit your message
(seta para a direita) página seguinte
(seta para a esquerda) página anterior

Definições

Deseja classificar ou adicionar este item a uma lista?

Iniciar Sessão

Ainda não é um membro?

Crie uma Conta e Adere a Comunidade