API getting current logged in user data
Posted: Mon Oct 29, 2018 3:41 am
I am trying to get current logged in user data using API
I have tried the code below but its not returning anything
<code>
$current_user_object = postToURL( buildURL( 'APIUser', 'getCurrentUserObject' ) );
var_dump($current_user_object);
</code>
however if I try to get user data after specifying arguments the code below works fine
<code>
$user_data = postToURL( buildURL( 'APIUser', 'getUser' ), array( $arguments ) );
print_r($user_data);
</code>
Is there a way to get current logged in user name or ID given that the user is already logged in using API.
I have tried the code below but its not returning anything
<code>
$current_user_object = postToURL( buildURL( 'APIUser', 'getCurrentUserObject' ) );
var_dump($current_user_object);
</code>
however if I try to get user data after specifying arguments the code below works fine
<code>
$user_data = postToURL( buildURL( 'APIUser', 'getUser' ), array( $arguments ) );
print_r($user_data);
</code>
Is there a way to get current logged in user name or ID given that the user is already logged in using API.