Question
Why am I getting 401 Unauthorized error with the error message: "You did not provide correct credentials" when sending messages with Messages API version 1?
Applies To
- Messages API
- JSON Web Token(JWT)
- Basic Authentication
Answer
The version 1 (v1) authentication differs from version 0 (v0.1). In version 1, if your number is linked with your application, you must use JSON Web Token (JWT) authentication; otherwise, you will get 401 unauthorized errors. If you want to use basic authentication in version 1, the number should not be linked to the application.
Another reason for the Authorization error is an Invalid JWT token. Troubleshooting an Invalid Token is addressed in 401 Unauthorized Authentication Error When Making API Requests.