I had the exact same problem. It turns out the error was caused by the HTTP requests library re-encoding my strings, so the IM token I was sending was wrong. For example, if the token were "A%5", it would get sent as "A%235", and it would trigger a 403 error. I don't know why it works some of the times and breaks some other time, but this fixed it for me. Try comparing the IM token your receive with the IM token you send. If you notice any differences, there's your problem. Hope this helps!