<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Techy Things &#187; google api</title>
	<atom:link href="https://tech.yipp.ca/category/google-api/feed/" rel="self" type="application/rss+xml" />
	<link>https://tech.yipp.ca</link>
	<description>Just another Yipp.ca Blogs site</description>
	<lastBuildDate>Thu, 01 May 2025 18:06:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.2.38</generator>
	<item>
		<title>Error refreshing the OAuth2 token { “error” : “invalid_grant” }</title>
		<link>https://tech.yipp.ca/google-api/error-refreshing-oauth2-token-error-invalid_grant/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=error-refreshing-oauth2-token-error-invalid_grant</link>
		<comments>https://tech.yipp.ca/google-api/error-refreshing-oauth2-token-error-invalid_grant/#comments</comments>
		<pubDate>Sun, 14 Sep 2014 20:59:17 +0000</pubDate>
		<dc:creator><![CDATA[frank]]></dc:creator>
				<category><![CDATA[google api]]></category>

		<guid isPermaLink="false">http://tech.yipp.ca/?p=1014</guid>
		<description><![CDATA[<p>There is two possibles cause for this error that I know: (i) You have the wrong email in your $client_id = '1303030303-wrongiddontuse7t9kdtai3l44jofnejr04.apps.googleusercontent.com'; //Client ID $service_account_name = '1303030303-wrongiddontuse7t9kdtai3l44jofnejr04@developer.gserviceaccount.com'; //Email Address $key_file_location = 'API Project-1234.p12'; //key.p12&#46;&#46;&#46;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/google-api/error-refreshing-oauth2-token-error-invalid_grant/">Error refreshing the OAuth2 token { “error” : “invalid_grant” }</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>There is two possibles cause for this error that I know:</p>
<h2>(i) You have the wrong email in your</h2>
<pre>$client_id = '1303030303-wrongiddontuse7t9kdtai3l44jofnejr04.apps.googleusercontent.com'; //Client ID
 $service_account_name = '<strong>1303030303-wrongiddontuse7t9kdtai3l44jofnejr04@developer.gserviceaccount.com</strong>'; //Email Address 
$key_file_location = 'API Project-1234.p12'; //key.p12</pre>
<p>Often people enter their own email address, but it must look like this weird cryptic string above. You can get your own ID on the developer's console page (assuming you paid and have an google for business account) :</p>
<p>https://console.developers.google.com/project/&lt;yourProjectID&gt;/apiui/credential</p>
<p>(2) You don't have enabled the specific scope which you are trying to access. For example in the examples/service-account.php sample provided, it tries to access the "Books API". In the screenshot below you see the three APIs enabled, you must have the one in your credential object :</p>
<pre>$cred = new Google_Auth_AssertionCredentials( 
           $service_account_name, 
           array('<strong>https://www.googleapis.com/auth/books</strong>'), 
           $key );</pre>
<div id="attachment_1015" style="width: 568px" class="wp-caption alignnone"><a style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13px; line-height: 19px;" href="http://tech.yipp.ca/files/2014/09/Screen-Shot-2014-09-14-at-4.56.22-PM.png"><img class="size-full wp-image-1015" alt="Screen Shot 2014-09-14 at 4.56.22 PM" src="http://tech.yipp.ca/files/2014/09/Screen-Shot-2014-09-14-at-4.56.22-PM.png" width="558" height="252" /></a><p class="wp-caption-text">This is what it should look like when you enable APIs</p></div>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/google-api/error-refreshing-oauth2-token-error-invalid_grant/">Error refreshing the OAuth2 token { “error” : “invalid_grant” }</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://tech.yipp.ca/google-api/error-refreshing-oauth2-token-error-invalid_grant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Send email using Gmail API / Google Mail API in PHP</title>
		<link>https://tech.yipp.ca/google-api/send-email-using-gmail-api-google-mail-api-php/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=send-email-using-gmail-api-google-mail-api-php</link>
		<comments>https://tech.yipp.ca/google-api/send-email-using-gmail-api-google-mail-api-php/#comments</comments>
		<pubDate>Fri, 12 Sep 2014 22:22:21 +0000</pubDate>
		<dc:creator><![CDATA[frank]]></dc:creator>
				<category><![CDATA[google api]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://tech.yipp.ca/?p=1005</guid>
		<description><![CDATA[<p>How to make your app use Gmail API to send its email and thus benefit from DKIM authentication You first need to have your email on your domains managed by gmail: Google for Business. That&#46;&#46;&#46;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/google-api/send-email-using-gmail-api-google-mail-api-php/">Send email using Gmail API / Google Mail API in PHP</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></description>
				<content:encoded><![CDATA[<h1>How to make your app use Gmail API to send its email and thus benefit from DKIM authentication</h1>
<p>You first need to have your email on your domains managed by gmail: Google for Business.</p>
<p>That means you can already login in gmail on the web with yourname@yourdomain.com</p>
<p>The official documentation can be found there (please be signed in google with your account while accessing).</p>
<p><span style="text-decoration: underline;">Basic documentation :</span></p>
<p><a href="https://developers.google.com/gmail/api/" target="_blank">https://developers.google.com/gmail/api/</a></p>
<p><span style="text-decoration: underline;">More documentation related specifically to have your app send mails on behalf of a user :</span></p>
<p><a href="https://developers.google.com/appengine/docs/php/mail/" target="_blank">https://developers.google.com/appengine/docs/php/mail/</a></p>
<p><span style="font-size: 1.5em;">Overview</span></p>
<p>(i) Enable API for your a user<br />
(2) Get the authentication key<br />
(3) Download the client library to save on your server<br />
(4) Write code</p>
<p>https://developers.google.com/gmail/api/</p>
<p>There are two ways to use the Gmail API, one is with a web-server and redirection to google authentication page to click a button to accept, then redirected back to your app with credentials, stored in php session. This is not the way I am looking for.</p>
<p>The second way is "offline" authentication as google labels it. It is with pre-shared authentication keys.</p>
<p>https://developers.google.com/api-client-library/php/guide/aaa_oauth2_service</p>
<p>The sample code provided by google in PHP is there: \google-api-php-client\examples\service-account.php</p>
<p>&nbsp;</p>
<h2>Write Code</h2>
<p>set_include_path(get_include_path() . PATH_SEPARATOR . '/path/to/google-api-php-client/src');</p>
<p>(under development..)</p>
<h2>Troubleshooting</h2>
<p>Fix <a title="Error refreshing the OAuth2 token { “error” : “invalid_grant” }" href="http://tech.yipp.ca/google-api/error-refreshing-oauth2-token-error-invalid_grant/" target="_blank">Error refreshing the OAuth2 token { “error” : “invalid_grant” }</a></p>
<p>&nbsp;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/google-api/send-email-using-gmail-api-google-mail-api-php/">Send email using Gmail API / Google Mail API in PHP</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://tech.yipp.ca/google-api/send-email-using-gmail-api-google-mail-api-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
