Upload document using 2 legged oauthentication

im_foxygirl

New Member
I was working with .NET Google Document List API and found stuck myself somewhere.I want to upload a document using 2 Legged OAuthentication as I have register my application in Google Market Place, then install it to my domain.Now I am using 2 legged OAuthentication to interact with data stored in google and working fine.\[code\]RequestSettings settings = new RequestSettings(APPLICATION_NAME, CONSUMER_KEY, CONSUMER_SECRET, currentUser, DOMAIN);\[/code\]Below is my code which is not working and gives 401 unauthorized error:\[code\]GOAuthRequestFactory requestFactory = new GOAuthRequestFactory("cl", APPLICATION_NAME);requestFactory.ConsumerKey = CONSUMER_KEY;requestFactory.ConsumerSecret = CONSUMER_SECRET;DocumentsService service = new DocumentsService(APPLICATION_NAME);service.RequestFactory = requestFactory;service.UploadFile(fileNameWithPath, fileName, contentType, false);\[/code\]
 
Back
Top