Closed romeoonisim closed 1 year ago
This will be a fairly quick win, expect it to be rolled out with the release of Verify v2
Missing api_key code 2
Yep, incoming PR shortly. It turns out the TokenBodyHandler for authentication this way never worked.
Yep, incoming PR shortly. It turns out the TokenBodyHandler for authentication this way never worked.
Thanks, I'll follow up
@ngoctiennet963 if you are blocked, maybe my response from https://github.com/Vonage/vonage-laravel/issues/16 might help you until the PR will be available.
Released under 4.1.2, thanks for reporting ✅
I can't tell if I'm doing something wrong, but I can't find the version 4.1.2 in composer. Would appreciate any help, thank you!!
"vonage/client": "4.1.2"
Problem 1
[EDIT] I replaced vonage/client with the following and now it works.
"guzzlehttp/guzzle": "^7.8.1",
"vonage/client-core": "^4.6.1"
[EDIT 2] I continued getting api_key errors for sms->send. I switched to signing with signature (instead of basic) and that worked. I couldn't get basic to work.
On a blank PHP project, using the example code provided, I cannot make the Verify API work on the latest version, on 4.0, I get "Missing api_key" as an error.
Expected Behavior
I would expect the example code to work as expected out of the box
Current Behavior
Possible Solution
It seems that the Verify/Client.php is not attaching the
api_key
andapi_secret
as body parameters, instead, it creates an Authorization header with the two values encoded in base64. Here are some of the documentation links: https://developer.vonage.com/en/api/verify#verifyCheck https://developer.vonage.com/en/getting-started/concepts/authenticationSteps to Reproduce (for bugs)
composer require vonage/client
$client = new Vonage\Client(new Vonage\Client\Credentials\Basic(API_KEY, API_SECRET));
$request = new \Vonage\Verify\Request(PHONE_NUMBER, 'Testing'); $response = $client->verify()->start($request);
echo 'Started verification with an id of: '.$response->getRequestId();