I saw this which is in error
I didn’t see this section as it was out of view and I didn’t scroll your code. My bad.
This is correct.
So there does not seem anything obviously wrong in your code.
Other than no HTTP code checking or checking if the response was an error or not.
If your token is hard coded it may have expired