Unable to retrieve settings for Google Group using .NET client library -
i'm writing system responsible creating , maintaining google groups in such way tie (and in sync with) our internal systems.
as part of this, working on creating group, changing settings , allocating members group.
so far, first part works correctly second part - using google groups settings api - fails. seems receiving xml data when expecting json. results in failure deserialize , exception thrown.
i have latest version (at time of writing) of client library: google.apis.groupssettings.v1 1.4.0.28227 (1.4.0-beta)
this sample code that's failing:
// oauth2.0/service account stuff here var initializer = //...; var settingsservice = new groupssettingsservice(initializer); var settings = settingsservice.groups.get("samplegroup@example.com").execute(); all until last line, fails following error:
- googleapiexception: error occurred, error response not deserialized.
- innerexception: newtonsoft.json.jsonreaderexception: unexpected character encountered while parsing value: <. path '', line 0, position 0.
using fiddler, have observed response:
<?xml version="1.0" encoding="utf-8"?> <errors xmlns="http://schemas.google.com/g/2005"> <error> <domain>gdata</domain> <code>invalid</code> <internalreason>a system error has occurred</internalreason> </error> </errors> i think fact error might down fact group newly created, i've tried older 1 , got following:
http/1.1 200 ok expires: thu, 18 jul 2013 13:00:13 gmt date: thu, 18 jul 2013 13:00:13 gmt cache-control: private, max-age=0, must-revalidate, no-transform etag: "w9sr8o0s9ldi5pcv_43hxqkutma/ts0cjusfghj0vg_anijaxkmnm4s" content-type: application/atom+xml; charset=utf-8 x-content-type-options: nosniff x-frame-options: sameorigin x-xss-protection: 1; mode=block content-length: 1811 server: gse <?xml version="1.0" encoding="utf-8"?> <entry xmlns="http://www.w3.org/2005/atom" xmlns:apps="http://schemas.google.com/apps/2006" xmlns:gd="http://schemas.google.com/g/2005"> <id>tag:googleapis.com,2010:apps:groupssettings:group:examplegrp@example.com</id> <title>groups resource entry</title> <content type="text">an example group</content> <author> <name>google</name> </author> <apps:email>examplegrp@example.com</apps:email> <apps:name>an example group</apps:name> <apps:description/> <apps:whocanjoin>can_request_to_join</apps:whocanjoin> <apps:whocanviewmembership>all_managers_can_view</apps:whocanviewmembership> <apps:whocanviewgroup>all_members_can_view</apps:whocanviewgroup> <apps:whocaninvite>all_managers_can_invite</apps:whocaninvite> <apps:allowexternalmembers>false</apps:allowexternalmembers> <apps:whocanpostmessage>anyone_can_post</apps:whocanpostmessage> <apps:allowwebposting>true</apps:allowwebposting> <apps:maxmessagebytes>5242880</apps:maxmessagebytes> <apps:isarchived>false</apps:isarchived> <apps:archiveonly>false</apps:archiveonly> <apps:messagemoderationlevel>moderate_none</apps:messagemoderationlevel> <apps:spammoderationlevel>moderate</apps:spammoderationlevel> <apps:replyto>reply_to_ignore</apps:replyto> <apps:customreplyto/> <apps:sendmessagedenynotification>false</apps:sendmessagedenynotification> <apps:defaultmessagedenynotificationtext/> <apps:showingroupdirectory>false</apps:showingroupdirectory> <apps:allowgooglecommunication>false</apps:allowgooglecommunication> <apps:memberscanpostasthegroup>false</apps:memberscanpostasthegroup> <apps:messagedisplayfont>default_font</apps:messagedisplayfont> <apps:includeinglobaladdresslist>true</apps:includeinglobaladdresslist> </entry> so then, it's still not deserializable, , doesn't work.
what doing wrong, if anything?
the .net client library doesn't support xml, while groupssettings api supports both atom , json. suggestion following:
var getrequest = settingsservice.groups.get("samplegroup@example.com"); getrequest.alt = "json"; var settings = getrequest.execute();
Comments
Post a Comment