I am using context io api for fetching mails from gmail accounts.I want do the gmail authentication seperately.That means not use the connect_token .
Steps
Step 1 : Gmail authentication (using oauth2)
Step 2: Add account to context io
Step 3: Fetch emails
I am using the PHP files downloaded by the GitHub .
I am using the below code for Add New account to Context io
$para=array('email'=>$_SESSION['google_data']['email'],'first_name'=>$_SESSION['google_data']['given_name'],'last_name'=>$_SESSION['google_data']['family_name'],'username'=>$_SESSION['google_data']['email'],'provider_consumer_key'=>'ffddfdfdf','provider_refresh_token'=>$refresh_token,'type'=>'IMAP','server'=>'imap.googlemail.com','port'=>993);
$r =$contextIO->addAccount($para);
The account is created but it is not active ,ie, the account has no mail boxes.So I can't fetch the emails.
Is this a correct method?Anyone please help me