Hi, I'm working on an Authentication v4 library with Angular 6. After creating successfully an Access Token to auhtenticate, I'm trying to delete it to deauthenticate, following https://developers.themoviedb.org/4/auth/delete-access-token.
Here is my code :
deleteAccessToken(accessToken): Observable<any> {
const body = {'access_token': accessToken};
const url = `http://api.themoviedb.org/4/auth/access_token`;
const httpOptions = {
body,
headers: new HttpHeaders({
'Content-Type': 'application/json;charset=utf-8',
'Authorization': 'Bearer my-bearer-access-token'
})
};
return this.http.request<any>('delete', url, httpOptions)
.pipe(
tap(res => console.log('res delete token : ', res)),
map(res => {
return res;
}),
catchError(this.handleError<any[]>('deleteAccessToken', [])),
);
}
I searched and tried a lot but I'm still stuck with a 404 error :
status_code: 37
status_message: "The requested session could not be found."
success: false
Does anyone has an idea of what's wrong ? :/
Regards,
Nemôžeš nájsť film alebo seriál? Prihlás sa a pridaj ho.
Chcete ohodnotiť alebo pridať túto položku do zoznamu?
Nie ste členom?
Odpoveď od Travis Bell
dňa 11. október, 2018 o 10:13AM
Are you encoding your request body as a JSON object?
Odpoveď od Araes
dňa 11. október, 2018 o 10:54AM
Hi,
With a console.log(httpOptions) :
In my Network I see a Request Payload
Which is the same one that I get when I create the token
Regards,
Odpoveď od leonardocabeza
dňa 5. január, 2019 o 6:02PM
Hi. This has been an issue to me as well, I'm trying it out from https://developers.themoviedb.org/4/auth/delete-access-token and get the same message error. Could you figure it out @Araes ?
Odpoveď od yassineElmousaoui
dňa 9. marec, 2021 o 7:52AM
hi did any of you figure this out ??
Odpoveď od Peter Dzomlija
dňa 4. október, 2021 o 9:31AM
I'm in the process of building a Delphi (Pascal) implementation of The Movie DB API. Here is the code I'm prototyping to DELETE a v4 Access Token:
Here is the JSON Response that I get from the above:
The TNetHTTPClient.Delete method only has the means to receive data, and not send anything, which is why I added the Access Token to FUrl. The MovieDB v4 API documentation isn't very clear as to how an access token is actually to be deleted
Odpoveď od Travis Bell
dňa 5. október, 2021 o 3:56PM
Hey guys,
I just pushed a small bugfix which should fix the issues you're seeing. If you need any more guidance, you can take a look at the following scripts. These are purely frontend HTML & JS so you can inspect the source code to see what's happening.
Cheers.
Odpoveď od Peter Dzomlija
dňa 5. október, 2021 o 11:18PM
Thanks, Travis. I figured about as much that a fix was applied, because it started working as expected.
I still wish that there was a way using the v4 API to get a required Access Token in a similar manner that v3 can with Create Session with Login.