The Movie Database Support

Hi, i'm in trouble with the rate request, i try to create a guest_session like

https://api.themoviedb.org/3/authentication/guest_session/new?api_key=${myApiKey}

and it's work well, but when i try to rate with this guest session:

axios.post(`https://api.themoviedb.org/3/movie/${movie_id}/rating?api_key=${myApiKey}&guest_session_id=${guest_session_id}`, {"value":  8})

this return me a 404 with:

{
    "success": false,
    "status_code": 34,
    "status_message": "The resource you requested could not be found."
}

can someone told me what do i do wrong ?

6 replies (on page 1 of 1)

Jump to last post

У меня с помощью гостевой сессии все работает. Использую JSON.stringify для {"value": 8}. Попробуй так:

postMovieRating(guestSessionId, movieId, rating) {
    return this.postResourse(`https://api.themoviedb.org/3/movie/${movieId}/rating?api_key=${this.apiKey}&guest_session_id=${guestSessionId}`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json;charset=utf-8',
      },
      body: JSON.stringify({
        "value": rating
      })
    })
  }

Thanks for ur reply, i try ur code but it gave me:

status_code: 5
status_message: "Invalid parameters: Your request parameters are incorrect."
success: false

i try to change the body to:

body: JSON.stringify({
        "value": rating
      })

from:

body: {
                "value": rate
            }

the result is the same, i think that the probleme is not the body, have u done something special with ur guest session id ?

1.Может у тебя проблемы с получением guest_session_id? Я делаю запрос и получаю в ответ от сервера следующие данные:

{
success: true, 
guest_session_id: "XXXXXXXXXXXX", 
expires_at: "2021-06-28 18:21:50 UTC"
}
  1. Использую данную сессию для оценки фильма.

Я понимаю так, что сервер принял твои данные, но не смог их обработать. Headers указываешь? Скинь сюда весь свой код запроса, а то в первом сообщении ты как минимум заголовки не указал.

there is all my code:

 function createSession() {
        axios.get(`https://api.themoviedb.org/3/authentication/guest_session/new?api_key=${myApiKey}`)
        .then(res => {
            setGuest_session_id(res.data.guest_session_id)
        })
    }

    function rateMovie(movie: number, rate: number) {
        axios.post(`https://api.themoviedb.org/3/movie/${movie}/rating?api_key=${myApiKey}&guest_session_id=${guest_session_id}`, {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json;charset=utf-8',
            },
            body: JSON.stringify({
                value: rate
            })
        })
    }

my request to get a guest_session_id is working well and my movieId and rate are well setted too like my api key :/

На первый взгляд все верно, попробуй проверить свои данные в момент отправки запроса. Даже не знаю чем помочь. :( Для получения оценки фильмов в будущем использую это: https://developers.themoviedb.org/3/guest-sessions/get-guest-session-rated-movies

Hello! how did you get it at the end? I have the same problem

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