twilio/authy-php

how to obtain authy-id after creating a user

Closed this issue · 1 comments

Hi,

After I create a user using the API, e.g.:
$user = $authy_api->registerUser('email', 'xxx-xxx-xxxx', '1');

How could I get the 'authy-id' from the return $user object?

The command print_r($user) shows that it is a 'protected' field so I guess there is a function like 'getID' or something to retrieve the 'authy-id'?

Authy\AuthyUser Object
(
[raw_response:protected] => GuzzleHttp\Psr7\Response Object
(
+-- 78 lines-------------------------------------------------------
)

[body:protected] => stdClass Object
    (
        [id] => 15xxxxxx0
    )

[errors:protected] => stdClass Object
    (
    )

)

Please advise. Thanks. Best regards,

I found the answer to my own question. Below is the function if anybody wants it:
echo ( $user->bodyvar('id') );