Υποστήριξη για το The Movie Database

Hi, I just noticed that for lists created with the public field set to false, I am not able to retrieve its details with the same Bearer token I used to create it. The api returns 401. Logging out and in again didn't help either Cheers

17 απαντήσεις(στη σελίδα 1 από 2)

Jump to last post

Επόμενη σελίδαΤελευταία σελίδα

bump

Hi, any update on this ? if from the app I create a list with public field set to false, I am not able to access its content. I always get 401. When the public field is set to true I can access its content as always.

the version of the api I am using for lists is v4. POST /auth/access_token is successful and I am getting an access_token

Please advise Cheers

I'll be looking at this tomorrow. I'm finally get caught up with requests from a few months ago wink

Can you give this a try now? I setup a test script and it's working for me after I made a small change.

You can see my v4 list test script here.

Hi @travisbell , the script works. On my app, it still doesn't. I am able to add movies to the list and retrive them correctly on the website.

Please advise Cheers

Take a look at the source code of the script, it's all there so you can see what you're doing differently than I am.

Fair point . I will have another look to my code as soon as I get back home tonight . Thanks

I checked again, and we are calling the same endpoint in the same way. Still, for same reason I am always getting 401 back. The same token is working with the script, but it is not working on https://developers.themoviedb.org/4/list. Could somehow be related ?

Thanks

Post your code. wink

This is the definition of the end point

 @GET("4/list/{list_id}")
 Observable<UserListPaginatedResponse<ListMovieTvShow>> getListDetails(@Path("list_id") int listId,
            @QueryMap Map<String, String> query);

Each request gets

           Request original = chain.request();
            HttpUrl originalHttpUrl = original.url();
            HttpUrl url = originalHttpUrl.newBuilder()
                    .addQueryParameter("api_key", API_KEY)
                    .build();

            Request.Builder requestBuilder = original.newBuilder();
            requestBuilder.addHeader("Content-Type", "application/json");
            if (url.toString().contains("4/")) {
                String bearer = TextUtils.isEmpty(WRITE_ACCESS_TOKEN)
                        ? READ_ACCESS_TOKEN
                        : WRITE_ACCESS_TOKEN;
                requestBuilder
                        .addHeader("Authorization", "Bearer " + bearer);
            }

            requestBuilder.url(url);
            Request request = requestBuilder.build();

the rest client is called Retrofit and it is from square.

@POST("4/list/{list_id}/items")

works correctly.

Curl


curl --request GET   --url 'https://api.themoviedb.org/4/list/19993?sort_by=release_date.asc&api_key=fbf437d289a107e9aaf4eb0b24aabbb7&page=1'   --header 'Authorization: Bearer WRITE_TOKEN'   --header 'content-type: application/json;charset=utf-8'   --data '{}'

returns

{"status_message":"This resource is private.","success":false,"status_code":39}

If you're getting the private message, you're not using a properly signed access token (for that user). My guess would be that you're trying to access it with your account's read token. Especially if you can see that the token is working in my sample script.

I'll check that again. If that was the case, would I still be able to add items to a list?

Thanks

After serveral attemps I found out that the culprit was the api key. Removing it from the url fixed my issue.

Best

Nice, good find! Yes, now that I think about it, the API key (if present) will probably be used as your auth token. Something for me to remember moving forward wink

thanks for the quick feedback @travisbell . How long do you think will it take to have both v3 and v4 working with the new authentication system?

Δεν μπορείτε να βρείτε κάποια ταινία ή σειρά; Συνδεθείτε για να τη δημιουργήσετε.

Σε όλες τις σελίδες

s Εστίαση στη μπάρα αναζήτησης
p Άνοιγμα μενού προφίλ
esc Κλείσιμο ανοιχτού παραθύρου
? Άνοιγμα παραθύρου συντομεύσεων πληκτρολογίου

Στις σελίδες μέσων

b Επιστροφή στην προηγούμενη σελίδα(ή στην αρχική σελίδα όταν είναι εφικτό)
e Μετάβαση στη σελίδα επεξεργασίας

Στις σελίδες κύκλων σειρών

(Δεξιό βέλος) Μετάβαση στον επόμενο κύκλο
(Αριστερό βέλος) Μετάβαση στον προηγούμενο κύκλο

Στις σελίδες επεισοδίων σειρών

(Δεξιό βέλος) Μετάβαση στο επόμενο επεισόδιο
(Αριστερό βέλος) Μετάβαση στο προηγούμενο επεισόδιο

Σε όλες τις σελίδες εικόνων

a Άνοιγμα παραθύρου προσθήκης εικόνας

Σε όλες τις σελίδες επεξεργασίας

t Άνοιγμα επιλογέα μετάφρασης
ctrl+ s Υποβολή φόρμας

Στις σελίδες συζήτησης

n Δημιουργία νέας συζήτησης
w Ρύθμιση κατάστασης παρακολούθησης
p Ρύθμιση ως δημόσια/ιδιωτική
c Ρύθμιση ανοίγματος/κλεισίματος
a Άνοιγμα δραστηριότητας
r Απάντηση στη συζήτηση
l Μετάβαση στην τελευταία απάντηση
ctrl+ enter Υποβολή μηνύματος
(Δεξιό βέλος) Επόμενη σελίδα
(Αριστερό βέλος) Προηγούμενη σελίδα

Ρυθμίσεις

Θέλετε να αξιολογήσετε ή να προσθέσετε αυτό το στοιχείο σε μια λίστα;

Σύνδεση