Adapting a php array to WordPress

Here is some code; you need to see that the $current_user variable is actually an object and not an array ( USE $current_user->user_login AND NOT $current_user['user_login'] ).

I also added a simple check to make sure the user is logged in.

// Set the Query POST parameters - array    
$query_vals = array(
'api_username' => 'api-username-goes-here',
'api_password' => 'password-here', 
'api_key' => 'api-key-here'
);


//if( is_user_logged_in() ):

global $current_user;
get_currentuserinfo();

$query_vals['username'] = $current_user->user_login;
$query_vals['password'] = $current_user->user_pass;

//else:

//wp_die('You must be logged in');

//endif;