Possible to upload a public GoogleDoc using Google Docs List API? - public

I am creating a web app where I would like the user to be able to manipulate contents of a spreadsheet that do not get saved to the original spreadsheet-- in effect so that multiple users can access the same spreadsheet and the data/formulas contained without interfering with one another.
If my spreadsheet is public, is there a way for users to upload it programmatically using the docs list API? That way they have a copy saved where they can make whatever changes desired.
Thank you!

You can copy a spreadsheet by issuing a POST request as documented here:
POST https://docs.google.com/feeds/default/private/full
Authorization: <your authorization header here>
Content-Type: application/atom+xml
[Additional headers]
<?xml version='1.0' encoding='UTF-8'?>
<entry xmlns="http://www.w3.org/2005/Atom">
<id>[SELF_LINK_OF_THE_ORIGINAL_DOCUMENT]</id>
<title>My Copy</title>
</entry>

Related

Can't remove email address from EWS contact

I'm using the ews-javascript-api to manage my EWS contacts on an exchange server.
I'm trying to update a contact object by removing an email address.
I've followed this blog post and it's got me most of the way there. However, when I remove the ExtendedProperty's for EmailAddress1 the ews-javascript-api throws an exception due to an HTTP 500 coming back from the EWS soap request to update a contact. Looking at the SOAP request, I can see that there is an empty FieldURI which is what the response error is complaining about.
Here is my soap request
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Header>
<t:RequestServerVersion Version="Exchange2010_SP2"></t:RequestServerVersion>
</soap:Header>
<soap:Body>
<m:UpdateItem MessageDisposition="SaveOnly" ConflictResolution="AutoResolve">
<m:ItemChanges>
<t:ItemChange>
<t:ItemId Id="AAMkADczNzM2MTM4LTZmNWItNDBhYy05ZjcwLWUxMDc3ZDY2NjFiMABGAAAAAAC3bTmWRbrTRqYt+VZXGp68BwD5r6sZ7j5YSprMfvM2gaMkAAAAAAAQAAD5r6sZ7j5YSprMfvM2gaMkAAB4CjURAAA=" ChangeKey="EQAAABYAAAD5r6sZ7j5YSprMfvM2gaMkAAB4CkS4"></t:ItemId>
<t:Updates>
<t:SetItemField>
<t:FieldURI FieldURI="contacts:DisplayName"></t:FieldURI>
<t:Contact>
<t:DisplayName>Craig </t:DisplayName>
</t:Contact>
</t:SetItemField>
<t:SetItemField>
<t:FieldURI FieldURI="contacts:GivenName"></t:FieldURI>
<t:Contact>
<t:GivenName>Craig</t:GivenName>
</t:Contact>
</t:SetItemField>
<t:DeleteItemField>
<t:FieldURI></t:FieldURI>
</t:DeleteItemField>
<t:DeleteItemField>
<t:FieldURI FieldURI="contacts:MiddleName"></t:FieldURI>
</t:DeleteItemField>
<t:DeleteItemField>
<t:FieldURI FieldURI="contacts:Surname"></t:FieldURI>
</t:DeleteItemField>
</t:Updates>
</t:ItemChange>
</m:ItemChanges>
</m:UpdateItem>
</soap:Body>
And here is the soap response
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode
xmlns:a="http://schemas.microsoft.com/exchange/services/2006/types">a:ErrorSchemaValidation
</faultcode>
<faultstring xml:lang="en-US">The request failed schema validation: The required attribute 'FieldURI' is missing.</faultstring>
<detail>
<e:ResponseCode
xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">ErrorSchemaValidation
</e:ResponseCode>
<e:Message
xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">The request failed schema validation.
</e:Message>
<t:MessageXml
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<t:LineNumber>1</t:LineNumber>
<t:LinePosition>1037</t:LinePosition>
<t:Violation>The required attribute 'FieldURI' is missing.</t:Violation>
</t:MessageXml>
</detail>
</s:Fault>
</s:Body>
And finally here is the exception that the javascript api throws.
"Exception
at UpdateItemRequest../node_modules/ews-javascript-api/js/Core/Requests/ServiceRequestBase.js.ServiceRequestBase.ProcessWebException (https://sr1.genband.com/genlync/bundle-electron.js:44707:36)
at https://sr1.genband.com/genlync/bundle-electron.js:45557:41
at <anonymous>"
Finally I'll mention that I can remove an email address without removing any extended properties with the following function.
response.EmailAddresses._setItem(ews.EmailAddressKey.EmailAddress1, address.value);
However, the problem with this is, while it looks like it works, if I try to edit that contact on my outlook web interface, I get an error about some property mismatch. Looks like if I don't remove those extended properties when deleting an email, then they stay around and cause issues for other clients.
this should work in 0.9.3 version, available starting 0.9.3-dev.1 which is ews-javascript-api#next currently.

Netsuite No Web Services Permission

I'm currently fighting with Netsuite's API and for the past while was getting somewhere, until quite randomly my user was no longer able to log in at all (WebFault: Server raised fault: 'You do not have permission to access web services feature.'). Is there a hidden max API calls/hour that I've hit? I've gone through and checked all 3 relevant places for web services (Company, role, and user is in role). Can anyone shed some light on this (quite frankly nightmare of an) api?
DEBUG:suds.client:sending to (https://webservices.netsuite.com/services/NetSuitePort_2014_1)
message:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:ns0="urn:core_2014_1.platform.webservices.netsuite.com" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="urn:messages_2014_1.platform.webservices.netsuite.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<ns1:Body>
<ns2:login>
<ns2:passport>
<ns0:email>*********</ns0:email>
<ns0:password>*******</ns0:password>
<ns0:account>********</ns0:account>
<ns0:role>******</ns0:role>
</ns2:passport>
</ns2:login>
</ns1:Body>
</SOAP-ENV:Envelope>
DEBUG:suds.client:headers = {'SOAPAction': u'"login"', 'Content-Type': 'text/xml; charset=utf-8'}
ERROR:suds.client:<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:ns0="urn:core_2014_1.platform.webservices.netsuite.com" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="urn:messages_2014_1.platform.webservices.netsuite.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<ns1:Body>
<ns2:login>
<ns2:passport>
<ns0:email>***************</ns0:email>
<ns0:password>*********</ns0:password>
<ns0:account>********</ns0:account>
<ns0:role>*********</ns0:role>
</ns2:passport>
</ns2:login>
</ns1:Body>
</SOAP-ENV:Envelope>
DEBUG:suds.client:http failed:
<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server.userException</faultcode><faultstring>You do not have permission to access web services feature.</faultstring><detail><platformFaults:insufficientPermissionFault xmlns:platformFaults="urn:faults_2014_1.platform.webservices.netsuite.com"><platformFaults:code>WS_PERMISSION_REQD</platformFaults:code><platformFaults:message>You do not have permission to access web services feature.</platformFaults:message></platformFaults:insufficientPermissionFault><ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">partners-java026.svale.netledger.com</ns1:hostname></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
I was successfully logging in and out, as well as accessing the getServerTime() method when it blew up on me, and I haven't been able to log in since.
Thanks in advance.
Check-list:
Under Roles
1) Web Services Only Role checked
2) Check that they have the web services permission
Employee
1) check that they have the role and the password is correct
2) Concurrent Web Services User is checked
RE: You Max Calls per Hour Question.
No that is not the case. A Normal Netsuite User is allowed to process 1 API request at any one time, if a second is submitted while the first is still processing it will be rejected with an exception.
You can upgrade your user to a 'Suite Plus' License to achieve 10 concurrent requests for many £££££
Take a look at the user's Role. Go to the Permissions>Setup and make sure Web Services is listed. If not, add it and save.

Invalid XML feed from DocuSign Connect

When using Connect to receive a docusign envelope via a web service we have received invalid XML for one of our envelopes. Personal data and PDFBytes have been removed from this copy.
<?xml version="1.0" encoding="utf-8"?><DocuSignEnvelopeInformation xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.docusign.net/API/3.0"><EnvelopeStatus><RecipientStatuses><RecipientStatus><Type>Signer</Type><Email>#ymail.com</Email><UserName>o</UserName><RoutingOrder>1</RoutingOrder><Sent>2013-07-03T13:36:59.257</Sent><Delivered>2013-07-04T09:35:13.23</Delivered><Signed>2013-07-04T10:01:21.447</Signed><DeclineReason xsi:nil="true" /><Status>Completed</Status><RecipientIPAddress>_</RecipientIPAddress><CustomFields /><TabStatuses><TabStatus><TabType>Custom</TabType><Status>Signed</Status><XPosition>927</XPosition><YPosition>1162</YPosition><TabLabel>SSN</TabLabel><TabName>SSN</TabName><TabValue>_</TabValue><DocumentID>1</DocumentID><PageNumber>1</PageNumber><ValidationPattern /><CustomTabType>SSN</CustomTabType></TabStatus><TabStatus><TabType>FirstName</TabType><Status>Signed</Status><XPosition>100</XPosition><YPosition>1166</YPosition><TabLabel>First Name</TabLabel><TabName>First Name</TabName><TabValue>_</TabValue><DocumentID>1</DocumentID><PageNumber>1</PageNumber></TabStatus><TabStatus><TabType>LastName</TabType><Status>Signed</Status><XPosition>462</XPosition><YPosition>1166</YPosition><TabLabel>Last Name</TabLabel><TabName>Last Name</TabName><TabValue>_</TabValue><DocumentID>1</DocumentID><PageNumber>1</PageNumber></TabStatus><TabStatus><TabType>Custom</TabType><Status>Signed</Status><XPosition>1072</XPosition><YPosition>1291</YPosition><TabLabel>Data Field 5</TabLabel><TabName>Text</TabName><TabValue>1</TabValue><DocumentID>1</DocumentID><PageNumber>1</PageNumber><ValidationPattern /><CustomTabType>Text</CustomTabType></TabStatus><TabStatus><TabType>Custom</TabType><Status>Signed</Status><XPosition>664</XPosition><YPosition>1193</YPosition><TabLabel>Exemptions</TabLabel><TabName>Single</TabName><TabValue>X</TabValue><DocumentID>1</DocumentID><PageNumber>1</PageNumber><ValidationPattern /><CustomTabType>Radio</CustomTabType></TabStatus><TabStatus><TabType>SignHere</TabType><Status>Signed</Status><XPosition>406</XPosition><YPosition>1420</YPosition><TabLabel>Signature 9</TabLabel><TabName>Sign Here</TabName><TabValue /><DocumentID>1</DocumentID><PageNumber>1</PageNumber></TabStatus><TabStatus><TabType>Custom</TabType><Status>Active</Status><XPosition>756</XPosition><YPosition>1193</YPosition><TabLabel>Exemptions</TabLabel><TabName>Married</TabName><TabValue /><DocumentID>1</DocumentID><PageNumber>1</PageNumber><ValidationPattern /><CustomTabType>Radio</CustomTabType></TabStatus><TabStatus><TabType>Custom</TabType><Status>Active</Status><XPosition>845</XPosition><YPosition>1193</YPosition><TabLabel>Exemptions</TabLabel><TabName>Married but Single</TabName><TabValue /><DocumentID>1</DocumentID><PageNumber>1</PageNumber><ValidationPattern /><CustomTabType>Radio</CustomTabType></TabStatus><TabStatus><TabType>Custom</TabType><Status>Active</Status><XPosition>100</XPosition><YPosition>1208</YPosition><TabLabel>Address</TabLabel><TabName>Address Line 1</TabName><TabValue /><DocumentID>1</DocumentID><PageNumber>1</PageNumber><ValidationPattern /><CustomTabType>Text</CustomTabType></TabStatus><TabStatus><TabType>DateSigned</TabType><Status>Signed</Status><XPosition>989</XPosition><YPosition>1493</YPosition><TabLabel>Date Signed</TabLabel><TabName>Date Signed</TabName><TabValue>7/4/2013 </TabValue><DocumentID>1</DocumentID><PageNumber>1</PageNumber></TabStatus></TabStatuses><RecipientAttachment><Attachment><Data>_</Data><Label>DSXForm</Label><Type>.xml</Type></Attachment></RecipientAttachment><AccountStatus>Active</AccountStatus><EsignAgreementInformation><AccountEsignId>79e2c3d5-971c-4e7b-8b34-575e21896435</AccountEsignId><UserEsignId>ae45b756-aa08-44d6-bc46-be76ed123a5a</UserEsignId><AgreementDate>2013-07-04T09:35:13.213</AgreementDate></EsignAgreementInformation><FormData><xfdf><fields><field name="SSN"><value>_</value></field><field name="FirstName"><value>_</value></field><field name="LastName"><value>_</value></field><field name="Data Field 5"><value>1</value></field><field name="Exemptions"><value>Single</value></field><field name="Address"><value /></field><field name="DateSigned"><value>7/4/2013 </value></field></fields></xfdf></FormData><RecipientId>1c70c533-4787-4ed2-8d0f-3b56e5bad87a</RecipientId></RecipientStatus></RecipientStatuses><TimeGenerated>2013-07-09T07:02:59.5158647</TimeGenerated><EnvelopeID>daff200b-0d82-480a-83d1-e253d50e4cbb</EnvelopeID><Subject>_</Subject><UserName>_</UserName><Email>_</Email><Status>Completed</Status><Created>2013-07-03T13:36:58.523</Created><Sent>2013-07-03T13:36:59.303</Sent><Delivered>2013-07-04T09:35:13.323</Delivered><Signed>2013-07-04T10:01:21.507</Signed><Completed>2013-07-04T10:01:21.507</Completed><ACStatus>Original</ACStatus><ACStatusDate>2013-07-03T13:36:58.523</ACStatusDate><ACHolder>Onboarding</ACHolder><ACHolderEmail>_</ACHolderEmail><ACHolderLocation>DocuSign</ACHolderLocation><SigningLocation>Online</SigningLocation><SenderIPAddress>_</SenderIPAddress><EnvelopePDFHash /><CustomFields><CustomField><Name>taskId</Name><Show>True</Show><Required>True</Required><Value>CDFA8755-1FE4-E211-80E5-005056A930BA</Value></CustomField></CustomFields><AutoNavigation>true</AutoNavigation><EnvelopeIdStamping>true</EnvelopeIdStamping><AuthoritativeCopy>false</AuthoritativeCopy><DocumentStatuses><DocumentStatus><ID>1</ID><Name>fw4.pdf</Name><TemplateName>W4</TemplateName><Sequence>1</Sequence></DocumentStatus></DocumentStatuses></EnvelopeStatus><DocumentPDFs><DocumentPDF><Name>fw4.pdf</Name><PDFBytes>_____________________________________________________________</PDFBytes><DocumentType>CONTENT</DocumentType></DocumentPDF></DocumentPDFs></DocuSignEnvelopeInformation>_____________________________________________________________</PDFBytes><DocumentType>CONTENT</DocumentType></DocumentPDF></DocumentPDFs></DocuSignEnvelopeInformation>
The errror is after the first closing tag, additional (different) PDFBytes and tags are given.
Why is data sent after the closing DocuSignEnvelopeInformation tag?
Republishing the XML for this envelope should help determine if it was a one off or if there's a bug with the Connect service. You should be able to republish the XML through your DocuSign Console settings, if you do that do you still get malformed XML?

How to use Google Apps Script to serve a Google Calendar/Email gadget?

I would like to develop a calendar/gmail gadget for our Google Apps for Business domain using Apps Script to leverage all of the benefits it affords.
When replicating the Hello World gadget example:
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="hello world example" />
<Content type="html">
<![CDATA[
Hello, world!
]]>
</Content>
</Module>
Using a template XML doGet():
function doGet(e) {
var output = ContentService.createTextOutput();
var xml = '<?xml version="1.0" encoding="UTF-8" ?>\n<Module>\n<ModulePrefs title="Calendar Gadget" />\n<Content type="html"><![CDATA[\nHello, world!\n]]></Content>\n</Module>';
output.setContent(xml);
output.setMimeType(ContentService.MimeType.XML);
return output;
}
The resultant served content is identical to the example Gadget which installs fine, but served from GAS it isn't recognised as valid. Calendar ignores it and GMail declares it invalid.
Invalid gadget specification. Ensure that URL is correct and the gadget does not contain errors.
Is part of the requirement for a Google Apps Gadget that it be served using an *.xml filename?
doGet() does not return the XML (or HTML) verbatim. There is a difference in the exact content provided to the browser and the content returned by doGet().
So, the answer to your question is - yes, you need to have an XML file for a Google Gadget and cannot use Apps Script. What you can perhaps do is use Apps Script to write out the XML file.
The content served using the ContentService should be identical to the input provided. Please ensure that the web app is configured to allow anonymous access.

How do I create a SharePoint 2007 list from a template via web service?

I have a SharePoint 2007 custom list that I have saved as a list template. I am looking for a way to create a new list from the saved template via a web service call from an outside application.
I have already looked into the the basic web services available for SharePoint 2007 http://msdn.microsoft.com/en-us/library/bb862916(office.12).aspx but a call to that just creates a simple, empty custom list.
How do I instantiate a list from a specific template? How do I locate the Feature ID for the template?
You can use a HTTP debugger like fiddler2 to analyze the web service and remote procedure calls that SharePoint Designer makes to find this out.
For example, to get the available list templates, SPD makes an HTTP request using the DisplayPost RPC command, e.g.
POST http://[server]/[web]/_vti_bin/owssvr.dll?Cmd=DisplayPost
with an xml payload of:
<?xml version="1.0" encoding="UTF-8"?>
<ows:Batch OnError="Return" Version="12.0.0.000">
<Method ID="0,GetProjSchema">
<SetVar Name="Cmd">GetProjSchema</SetVar>
</Method>
</ows:Batch>
SPD then parses the ListTemplates node in the response to obtain a list of template names, types, and feature IDs.
To create the list from a specific template type or feature ID, SPD uses the same DisplayPost command, this time with a message body similar to:
<?xml version="1.0" encoding="UTF-8"?>
<ows:Batch OnError="Return" Version="12.0.0.000">
<Method ID="0,NewList">
<SetVar Name="Cmd">NewList</SetVar>
<SetVar Name="ListTemplate">108</SetVar>
<SetVar Name="Title">Discussion Board</SetVar>
<SetVar Name="FeatureId">00bfea716a4943fab535d15c05500108</SetVar>
<SetVar Name="RootFolder" />
<SetVar Name="LangID">1033</SetVar>
</Method>
</ows:Batch>
For an example of how to use the RPC protocol see this post on uploading files to a SharePoint document library (it uses the author.dll rather than the owssvr.dll, but the technique is similar).

Resources