0

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

4

1 回答 1

0

这看起来是正确的,假设您从中提取的参数是$_SESSION帐户的正确信息。您还需要在 API 中将您的 oauth 密钥注册到oauth_providers

您可以检查addAccount电话的响应,看看是否有任何问题。

(完全披露:我在 Context.IO 团队工作)

于 2014-12-01T17:46:31.133 回答