# I'm trying to rotate refresh tokens with nextauth and django rest framework

**URL:** <https://forum.djangoproject.com/t/im-trying-to-rotate-refresh-tokens-with-nextauth-and-django-rest-framework/34732>\
**Category:** Forms & APIs\
**Created:** [September 12, 2024, 5:48pm UTC](https://forum.djangoproject.com/t/im-trying-to-rotate-refresh-tokens-with-nextauth-and-django-rest-framework/34732 "2024-09-12T17:48:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marveldo](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/marveldo/32/21559_2.png) [@marveldo](https://forum.djangoproject.com/u/marveldo)\
**Post date:** [September 12, 2024, 5:48pm UTC](https://forum.djangoproject.com/t/im-trying-to-rotate-refresh-tokens-with-nextauth-and-django-rest-framework/34732/1 "2024-09-12T17:48:33Z")

</div>

I’m currently trying to use the get token function which gets the token from the website cookies to extract the refresh token and send it django rest api as a token but i keep getting Bad Request:

```bash
 /api/v1/auth/refresh/
[12/Sep/2024 18:41:02] "POST /api/v1/auth/refresh/ HTTP/1.1" 400 39
[12/Sep/2024 18:41:02] code 400, message Bad request syntax ('125')
[12/Sep/2024 18:41:02] "125" 400 - 

```

i tried console logging the token and it is the token but my django keeps returning this error can someone please explain it to me
