hi im trying to get a list of my email using gmail api with php but i got error 400, is PHP for Gmail API is still developed or just im doin it wrong ?
$optParams = [];
$optParams['maxResults'] = 5; // Return Only 5 Messages
$optParams['labelIds'] = 'INBOX'; // Only show messages in Inbox
$optParams['q'] = 'from: "abc"'; // Only show messages in Inbox
$list = $gmail->users_messages->listUsersMessages("my email",$optParams);
btw i'm non g suite and using service account Thanks
--- update ---
Here's my $gmail variable source
putenv('GOOGLE_APPLICATION_CREDENTIALS='.base_path('service_account.json'));
$client->useApplicationDefaultCredentials();
$client->setScopes(\Google_Service_Gmail::MAIL_GOOGLE_COM);
$client->setAccessType('offline'); // offline access
$client->setIncludeGrantedScopes(true); // incremental auth
$gmail = new \Google_Service_Gmail($client);