twilio - How do I send a user token via SMS with Authy and PHP? -
i trying run demo authy in php. have installed authy library composer, can register user using hardcoded values this:
$authy_api = new authy\authyapi('<testing api key>', 'http://sandbox-api.authy.com'); // actual key omitted -- using key generated testing, not 1 production $user = $authy_api->registeruser('something@something.com', '999-999-9999', 30); // actual credentials omitted if($user->ok()){ echo "success!"; $id = $user->id(); echo($id); }
when above script runs, 5-digit user id indeed generated, seems going well, yet sms never delivered phone.
one possible problem number registered app phone (associated admin account), since (per docs) each phone number has uniquely identify user, maybe mine registered app , therefore no need arose send new token. should case, id of user object may registered one.
the problem remains other phone numbers however. i'm lost.
turns out, there nothing wrong code per se.
it's sandbox api not go through sending sms. simulates process testing purposes, authentication flow same production api.
when switched production api url , key, able receive sms on phone.
Comments
Post a Comment