Also note that the HTTP 302 redirection is expected, to append
?gsessionid=12345 to your url.

You can use curl --post302 to have curl re-POST the data.

On Thu, Jul 7, 2011 at 11:49 AM, Johan Euphrosine <[email protected]> wrote:
> Hi,
>
> I was able update the ACL of a secondary Calendar using JSON-C through
> the OAuth playground:
> http://googlecodesamples.com/oauth_playground/index.php
>
> Make sure to get the Content-Type right:
> Content-Type: application/json; charset=UTF-8
>
> Here is the log of the request:
> POST 
> /calendar/feeds/fukifuki.com_ebbfqq38l6r0g7dr9rtvbrtbe4%40group.calendar.google.com/acl/full?*snip*
> HTTP/1.1
> Host: www.google.com
> Accept: */*
> Authorization: OAuth oauth_version="1.0", oauth_nonce="*snip*",
> oauth_timestamp="*snip*", oauth_consumer_key="googlecodesamples.com",
> oauth_token="*snip*", oauth_signature_method="RSA-SHA1",
> oauth_signature="*snip*"
> Content-Type: application/json
> GData-Version: 2.0
> Content-Length: 66
>
> {
>  "data": {
>    "scopeType": "default",
>    "role": "read"
>  }
> }
>
> HTTP/1.1 201 Created
> Expires: Thu, 07 Jul 2011 09:46:17 GMT
> Date: Thu, 07 Jul 2011 09:46:17 GMT
> Set-Cookie: *snip*
> Content-Type: application/json; charset=UTF-8
> Access-Control-Allow-Origin: *
> Cache-Control: private, max-age=0, must-revalidate, no-transform
> Vary: Accept, X-GData-Authorization, GData-Version
> GData-Version: 2.6
> ETag: W/"C04DRng9fCp7JGA9WhdTEE4."
> Location: 
> https://www.google.com/calendar/feeds/fukifuki.com_ebbfqq38l6r0g7dr9rtvbrtbe4%40group.calendar.google.com/acl/full/default
> Content-Location:
> https://www.google.com/calendar/feeds/fukifuki.com_ebbfqq38l6r0g7dr9rtvbrtbe4%40group.calendar.google.com/acl/full/default
> X-Content-Type-Options: nosniff
> X-Frame-Options: SAMEORIGIN
> X-XSS-Protection: 1; mode=block
> Server: GSE
> Transfer-Encoding: chunked
>
> {"apiVersion":"2.6","data":{"kind":"calendar#acl","etag":"W/\"C04DRng9fCp7JGA9WhdTEE4.\"","id":"http://www.google.com/calendar/feeds/fukifuki.com_ebbfqq38l6r0g7dr9rtvbrtbe4%40group.calendar.google.com/acl/default","selfLink":"https://www.google.com/calendar/feeds/fukifuki.com_ebbfqq38l6r0g7dr9rtvbrtbe4%40group.calendar.google.com/acl/full/default","canEdit":true,"role":"read","scopeType":"default"}}
>
> Hope that helps.
>
> On Wed, Jul 6, 2011 at 4:22 PM, Dale the Developer
> <[email protected]> wrote:
>> The request bodies I have tried are pretty much every permutation of
>> the reference variables:
>>
>> { "data": { "scopeType": "default", "role": "read" } }
>>
>> { "data": { "scope": "default", "role": "read" } }
>>
>> { "data": { "scope": "default", "scopeType": "user", "role":
>> "read" } }
>>
>> { "data": { "scope":
>> "[email protected]", "scopeType":
>> "user", "role": "read" } }
>>
>> That all cause the long 5 min march to a broken pipe, 50x, or 302 to
>> unavailable.  I have also tried a few blatantly broken ones that
>> correctly throw a "Error 400 (Bad Request)!!1" for malformed request.
>>
>> I have not tried ATOM yet because so far all other requests I've
>> attempted = in JSON-C has worked.  I'm pretty sure this is a bug.
>> Cross posting to issue tracker:
>> http://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=2653
>>
>> On Jul 5, 8:05 pm, David Bullock <[email protected]> wrote:
>>> I know that feed supports JSON-C, but do you get better results with ATOM?
>>>
>>> If not, you could hold the blog author to account :-)
>>>
>>> If so, maybe including "scope": "" ? might work-around a parsing bug? (I
>>> don't know if you tried that already - you didn't specify which scope and
>>> scopeType arrangements you tried)  I am not familiar with JSON-C or how it
>>> is parsed and handled on the service end - it's just a guess.
>>>
>>> It does seem odd though, that you get a 302 or broken pipe after a timeout,
>>> and not a 50x or 400 response.  It is difficult to fault the request itself.
>>>
>>> cheers,
>>> David.
>>>
>>> On Wed, Jul 6, 2011 at 8:48 AM, Dale the Developer 
>>> <[email protected]>wrote:
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> > I have a newly created secondary calendar that I am attempting to
>>> > update the ACLs to make it a Public Calendar.  Similar to the
>>> > following link, except using JSON-C and Google API Version 2.0:
>>>
>>> >http://gdatatips.blogspot.com/2009/12/making-calendar-public-via-acl-...
>>>
>>> > Working from JSON-C Examples here:
>>>
>>> >http://code.google.com/apis/calendar/data/2.0/developers_guide_protoc...
>>>
>>> > The POST is being sent to the accessControlListLink URI returned when
>>> > querying a calendar feed as an owner.
>>>
>>> > Example in CURL (AuthSub has already been used to obtain a Session
>>> > Token in the Authorization header):
>>> > $ echo '{ "data": { "scopeType": "default", "role": "read" } }' | curl
>>> > -v --sessionid --request POST -L -H "GData-Version: 2.0" -H "Content-
>>> > Type: application/json; charset=UTF-8" -H "Authorization: AuthSub
>>> > token=\"XXXXXXXXXXXXXXXXXXXXXXX\"" -H "Content-Length: 55" --data-
>>> > ascii - "https://www.google.com/calendar/feeds/xxxxxxxxxxxxxxxxxxxxxx
>>> > %40group.calendar.google.com/acl/full?alt=jsonc"
>>>
>>> > My return varies from "Empty reply from server" to a HTTP 302 redirect
>>> > sending me to an unavailable page ("Location:
>>> >http://www.google.com/googlecalendar/unavailable.html";).  In any of
>>> > these scenarios it takes a full 5 minutes to return the request.
>>>
>>> > Using PUT instead of POST as suggested in the Documentation returns a
>>> > "HTTP/1.1 405 Method Not Allowed".
>>>
>>> > Per the GAcl:scope documentation, only scopeType:default should be
>>> > necessary.
>>> >http://code.google.com/apis/calendar/data/2.0/reference.html#gacl_ref...
>>> > However it doesn't work with any arrangement of scope and scopeType.
>>>
>>> > Any thoughts on why this call would be not be working as specified in
>>> > the documentation?
>>>
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> > Groups "Google Calendar Data API" group.
>>> > To post to this group, send email to
>>> > [email protected]
>>> > To unsubscribe from this group, send email to
>>> > [email protected]
>>> > For more options, visit this group at
>>> >http://code.google.com/apis/calendar/community/forum.html
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Google Calendar Data API" group.
>> To post to this group, send email to
>> [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://code.google.com/apis/calendar/community/forum.html
>>
>
>
>
> --
> Johan Euphrosine (proppy)
> Developer Programs Engineer
> Google Developer Relations
>



-- 
Johan Euphrosine (proppy)
Developer Programs Engineer
Google Developer Relations

-- 
You received this message because you are subscribed to the Google
Groups "Google Calendar Data API" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://code.google.com/apis/calendar/community/forum.html

Reply via email to