Hi @anreta
Thanks for reaching out to us, I am happy to help here!
Can you please make sure that the token is not being invalidated by the creation of a new one?
When you generate a token with your Server-to-Server OAuth app credentials this will have an expiration time of 1 hour, but if you create a new token the previous one will get invalidated even if it has not expired yet.