This is one of the most confusing errors I've ever encountered because this is supposed to be super simple. I'm trying to connect to the Yelp API. I've created an App and obtained my "API Key". From there I:
Went to postman, selected "Bearer Token" as the Authorization type, copied and pasted my enter API Key, and ran the test.
Used Yelp's PHP sample code from here: https://github.com/Yelp/yelp-fusion/blob/master/fusion/php/sample.php with my copied and pasted API Key. I then ran the code.
Both tests returned the same error:
Fatal error: Curl failed with error #400: {"error": {"code": "VALIDATION_ERROR", "description": "'Bearer' does not match '^(?i)Bearer [A-Za-z0-9\\\\-\\\\_]{128}$'", "field": "Authorization", "instance": "Bearer"}} in /home/yelp.php on line 70
The API key is exactly 128 characters long "IxxU...YXYx", and I copied and pasted it perfectly into both environments. I'm not doing anything special or custom. I didn't make any changes to either environment outside of pasting in that exact API Key string. I even refreshed the API Key to get a new one, and repeated both tests with the new API Key. Failed everywhere again. So what on earth could be the problem? Ugh. Thanks.