Fusion Tables insert row with PHP basic example

我是研究僧i 提交于 2020-01-15 11:28:28

问题


Is there is an updated PHP client library for Fusion Tables? or maybe a very concrete copy+paste insert rows example?

I I have visited https://code.google.com/p/google-api-php-client/ and downloaded their latest release file, but while having examples for lots of other google apis, I can't find any mention of fusion tables examples.

Additionally I have been trying to get https://github.com/marciuz/fusion-table-php-api-and-shell fantastic project to work, but keep receiving "invalid credentials" errors when using my fusion tables enabled server api key with his shell or with the php examples he uses. This is even for basic SHOW TABLES commands.

Is there a scope issue here I am missing?

Is there a very simple php example I can use to just copy and paste my credentials (clientID, client secret, redirect uri, api key) into and get right to inserting rows into my Fusion Tables? Maybe something like Invalid Credentials Error when passing Oauth 2.0 Access Token to Fusion Tables API in PHP, only hopefully it includes how to create the access token, and helps to insert rows instead of modifying styling?

I am trying to not reinvent the wheel on this one, and have been looking high and low for a simple working example to insert rows, that is not over my inexperienced head. Thank you, this has been literally driving me crazy.


回答1:


Here is what worked for me:

"Ok so I finally got this to work and I thought Id share this with everyone In case you get stuck like I did. One step that seems to be missing from all usage examples I've seen is the service account email address needs to be added via Google Docs.

Select the document (FT) in Google Docs Click "Share" Select "Add People" Enter your service account email address, e.g. myservice...@developer.gserviceaccount.com Ensure "Can Edit" is selected. Un-check "notify people via email" Click "Share and Save"

This was a complete guess on my part but seems to have fixed my problem. I can finally insert into my FT via my service account. Hope this helps."

For anyone else looking out there, I found this code and fix very useful for finally getting a solution with the google-api-php-client. https://groups.google.com/forum/#!msg/google-api-php-client/9d2lQAppTvg/vh8CRhWJb_YJ



来源:https://stackoverflow.com/questions/20430381/fusion-tables-insert-row-with-php-basic-example

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!