Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <ol> <li><p>Use a service account. Service account identifies a service(e.g: a website) and not a person. Since it is your site that needs to access the fusion tables - not you - service account is the way to go. (The other option would be to get your users to authenticate against your fusion tables one by one. This would require all of your users to have a google account and your site to give permission for them. Now we don't want to go through all the hassle, do we?)</p></li> <li><p>Use the <a href="https://code.google.com/apis/console" rel="nofollow">API Console</a> to create a service account. Note your account name, client id. Generate and download your .p12 private key file. After you created a service account, <strong>share(a.k.a: give permissions) your fusion table</strong> with the service account's email address (xxxx@developer.gserviceaccount.com) </p></li> <li><p>Forget curl. Download the <a href="http://code.google.com/p/google-api-php-client/" rel="nofollow">Google API PHP Client</a>. Under the hood it will still use curl but saves you the headache.</p></li> <li><p>Include the api client in your code and do the authentication. </p> <pre><code>require_once '&lt;path&gt;/src/Google_Client.php'; require_once '&lt;path&gt;/src/contrib/Google_FusiontablesService.php'; $CLIENT_ID = 'xxx.apps.googleusercontent.com'; $SERVICE_ACCOUNT_NAME = 'xxx@developer.gserviceaccount.com'; $KEY_FILE = '&lt;path to your .p12 file&gt;'; //this should not be reached by any of your site's visitors $client = new Google_Client(); $client-&gt;setApplicationName("whatever"); $client-&gt;setClientId($CLIENT_ID); $client-&gt;setAssertionCredentials(new Google_AssertionCredentials( $SERVICE_ACCOUNT_NAME, array('https://www.googleapis.com/auth/fusiontables'), file_get_contents($KEY_FILE) ); $client-&gt;authenticate(); //do whatever you need to do with your fusion table on behalf of the user </code></pre></li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload