473,498 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP Google Drive API Create New Row In Spreadsheet

150 New Member
I need to insert new row into Spreadsheet, i just need help to solve this problem ?

Expand|Select|Wrap|Line Numbers
  1. $service = new Google_DriveService($client);
  2. // create empty Spreadsheet
  3. $array = insertFile($service,'Google Maps Mrakers','ADD Google Map Mrakers To File',NULL,'application/vnd.google-apps.spreadsheet',false);
  4. // Get the access_token string and save it
  5. $auth = json_decode($client->getAccessToken(), true);
  6. $access_token = $auth['access_token'];
  7. // send the sheet data
  8. $headers = array(
  9.     'Authorization: OAuth '.$access_token,
  10.     'GData-Version:3.0',
  11.     'Content-Type:application/atom+xml'
  12. );
  13. // Spreadsheet url
  14. $url = 'https://spreadsheets.google.com/feeds/list/'.$array['id'].'/1/private/full';
  15. $curl = curl_init($url);
  16. curl_setopt($curl, CURLOPT_HTTPHEADER,$headers);
  17. curl_setopt($curl, CURLOPT_POST,true);
  18. //curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  19. curl_setopt($curl, CURLOPT_POSTFIELDS,'<entry xmlns="http://www.w3.org/2005/Atom" xmlns:gsx="http://schemas.google.com/spreadsheets/2006/extended">
  20.     <gsx:hours>1</gsx:hours>
  21.     <gsx:ipm>1</gsx:ipm>
  22.     <gsx:items>60</gsx:items>
  23.     <gsx:name>Elizabeth Bennet</gsx:name>
  24. </entry>');
  25. $response = curl_exec($curl);
  26. curl_close($curl);
return's We're sorry, a server error occurred. Please wait a bit and try reloading your spreadsheet.
Aug 18 '12 #1
0 2433

Sign in to post your reply or Sign up for a free account.

Similar topics

13
35479
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
13
7746
by: Dixie | last post by:
How do I, in VBA from an access form module, add 5 rows to the top of a spreadsheet called MySpreadsheet.xls. The worksheet is called MyWorksheet and there is already data in the first 5 rows. I...
3
2895
by: Michael Fitzpatrick | last post by:
How do I create an ActiveX COM control using VB.Net. I want to create a control to use in Office 2000 VBA.
1
4081
by: Vlad | last post by:
I am trying to decide whether I should buy Visual Basic.NET Standard. I’d like to know the answer to the following questions to help me decide 1. Can I use Visual Basic.NET Standard to create a...
1
7269
by: xahlee | last post by:
Elisp Tutorial: Make Google Earth Xah Lee, 2006-12 This page shows a example of writing a emacs lisp function that creates a Google Earth file, and creates a link to the file, as well a link...
3
2475
by: boris | last post by:
i am not able to understand how can i create google desktop api using only C and C++.should i also need to learn other languages or knowledge of my favourite c++ will do.I am confused.If it's...
4
999
by: oruccim | last post by:
hi my friends; google can searching in phrase but it is imposible. it have a lot of page in data base and quadrillions sentence it can't search in fulltxt all of them .it need a super algorithm....
0
3708
by: TrevRex | last post by:
Hello, I work for a non-profit in San Diego as a GIS Specialist. I have had to teach myself about some scripting to create some dynamic maps, but I am still very limited in my skills, so I have...
17
7794
by: DeZZar | last post by:
Hi all, I need to regularly backup my database as an Excel file and have been using the File Export option. Problem is I need anyone using the database to be able to do this easily - nopt...
0
7205
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6887
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5462
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4910
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4590
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
291
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.