Google Spreadsheet API - POST without Authorization - post

I'm trying to HTTP POST to a Google Spreadsheet that is both Published to the Web and the visibility is set that anyone can find and edit. I'm using Postman to make sure my URL works for posting. I've tried using public/basic and private/full. private/full gives me a status of 200 OK and doesn't actually post anything to the spreadsheet. I'm using the correct XML for data as well. I've read on the API that you can do this without authorization but it isn't working for me. I'm not sure where it's failing.
The public/basic version of the url tells me:
You do not have add-row access to the spreadsheet. Make sure you are properly authenticated.
I'm not sure why though because it is public and published. I've had similar troubles with using Phonegap and using an HTTP GET to get spreadsheet info but that even worked in Postman so I'm unsure what's going on with this.
Any help/direction/suggestions would be greatly appreciated. Thanks.

I think your xml is wrong.
<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:gsx="http://schemas.google.com/spreadsheets/2006/extended">
<gsx:{nameOfHeaderColumn}>contents to display</gsx:{nameOfHeaderColumn}>
</entry>

I've went back to this and it's working using the same requests. I'm unsure of what the exact issue was but it appears to be fixed. I would like to note that POST should only be used with list feeds, for cell based feed posting use PUT.

Related

How to test WebService/Restful API in Rest Client?

I know this question may be so simple but still posting here.
I have a WebService/Restful API written in RAILS which gives response in JSON format. According to the RAILS developer, it works fine under his development but not in my case.
My problem is,
Now, I want to test that Request/Response in Browser Rest Client (like
mozilla, chrome). However, when I hit the API there it gives me 401.
So I have 2 questions,
1] How to test it in Rest Client? if I make any mistake while passing header parameter in wrong way.
2] Is there anything other approach to do this?
API Details are,
URL : http://rails4.xxxxx.com/xx/xxxxx/{id}.json
//{id} can be any integer value
header
X-xxxxxx-Client:
487txxxxhu34hfixxxxxu3hfcfxxxxx4f3f3f
For more details, please refer below snaps.
Thanks is advance.
There are a lot of ways to test rest api:
cURL (CLI)
RestConsole (for Chrome)
RestAssured (java test framework)
Frisby (javascript test framework)
Problem was due to wrong credentials.

Why am I receiving a 500 status when trying to connect with ASANA api?

I am using this example: https://github.com/ajimix/asana-api-php-class/blob/master/examples/oauth.php to learn how to use the asana's oauth. I already registered my app on the asana's developers webpage. But, when I get the asana's response with my 'redirect_url'?code=0%XXXXXXX, localhost gives me a 500 status. I don't know why, does anyone know how I can solve it?
I tried using the other examples in there: https://github.com/ajimix/asana-api-php-class/blob/master/examples/, but I wasn't able to make them run either, I always get a 500 status. I think that the problem must be in my server, but I don't how solve it. Maybe changing something on the .htaccess file, but I don't really know what to put in there.
If you're looking to use the Asana API from PHP may I recommend the official first-party client: https://github.com/Asana/php-asana
It also contains examples of how to use with OAuth and is officially supported by us at Asana :-)

Unable to retrieve notes with the OneNote API

Aim: Use Rails to retrieve list of notes in a defined section. As seen in lines 249-287 of GetPagesExample.cs
Problem: Receiving 401 when I attempt a GET. Documentation indicates "401 - Unauthorized Problems occurred in authenticating the token, user or your app".
I'm using the OneNoteAPISampleRuby as baseline, to achieve this. The sample comes with examples of how to POST but no examples of how to GET. Posting from the sample app in my local environment works fine. I know that doing a GET on this request URL https://www.onenote.com/api/v1.0/sections/{sectionId}/pages works in the OneNote API Console. This is the URL i'm trying to get to work from my modifications to the sample app.
My modifications are as follows:
<button type="submit" name="submit" value="quotes">Get Quotes</button> at line 10 of index.html.erb
when 'quotes'
result = onenote_client.get_page_in_section(access_token)
at line 29 of welcome_controller.rb
I added a get_page_in_section method to one_note_sharer.rb as seen here: https://gist.github.com/komplexb/347b7dd61ed3338ab6f4
It uses the rest-client gem for the POST examples, so I've been looking at the docs for how to use GET but it appears I've hit a wall.
I noticed someone had a similar problem here, however that answer hasn't been useful for me, since scope office.onenote should give me read access at least according to the documentation.
Looks as if the issue was with how headers and params are combined for GET requests in rest-client library, as seen here. Corrected get_page_in_section method.

google oauth 404 for page https://apis.google.com/_/scs/apps-static/_/js/k=oz.gapi.en_US

I have been using Google API Client (gapi.auth.authorize) to handle oAuth and it has been working for months until last night. It started with an error saying something like "_.Uu is not a function" last night, and this morning the api URL becomes inaccessible completely (returning 404):
https://apis.google.com//scs/apps-static//js/k=oz.gapi.en_US.wLUinxMaFvQ.O/m=/exm=client/rt=j/sv=1/d=1/ed=1/am=IQ/rs=AItRSTNDbsyHH46eCqa0_JZmh883Ddz23Q/cb=gapi.loaded_1
Is anyone seeing the same problem? Not sure if Google is making any changes.
I had the same problem.
You need to update the client library and then it will work fine.
The same issue is being discussed on another question. It appears that Google knows about it and is working on it.

How to POST an image to Twitter by statuses/update_with_media in Lua

I have problems building the header and/or body of the http-POST for a Twitter oAuth update_with_media call in Lua.
I'm using multipart/form-data as Content-Type
All oauth_* parameters are included in the body, including an oauth_signature.
POSTing to url https://upload.twitter.com/1/statuses/update_with_media.json
The problem is I have no idea how to successfully add the image data (media[]) to the body, in addition to 'status' and the other oauth parameters.
Also, how do I calculate the Content-Length?
As of yet, I'm constantly getting a 500 Internal Server Error back form Twitter.
Can anyone provide me with a code snippet to add image data (jpg) to a POST? I'm using the Corona SDK btw, if that makes any difference.
If any help, please refer to this issue:
Twitter API `status/update_with_media` return `404 Not Found`
If your still get the 500 error, please refer to this one:
https://dev.twitter.com/discussions/1525

Resources