Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7686425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:28:41+00:00 2026-05-31T19:28:41+00:00

I want to create a Google Docs document from within Haskell, so basically I

  • 0

I want to create a Google Docs document from within Haskell, so basically I want to do in Haskell what this little C# program does (adapted from a Google sample program):

using Google.GData.Documents;
using Google.GData.Client;

namespace DocListUploader
{
    public class GDocConsole
    {
        static void Main()
        {
            var user = "...";
            var passwd = "...";
            var file = "...";

            service = new DocumentsService("DocListUploader");
            service.setUserCredentials(user, passwd);
            service.UploadDocument(file, null);
        }
    }
}

From the Google Docs API description here
and this SO answer here I understood it’s “only” a matter of sending a couple of HTTP POSTs and getting the OAuth authentification done, but just how? Has anybody already done it and has some code samples for me…?

EDIT: Still could not figure out how to use the oauth libraries, so I just wrote a little C# wrapper:

using Google.GData.Documents;
using Google.GData.Client;

public class GoogleDoc
{
    public static int Upload(string user, string passwd, string file)
    {
        try
        {
            var service = new DocumentsService("DocListUploader");
            service.setUserCredentials(user, passwd);
            service.UploadDocument(file, null);

            return 0;
        }
        catch
        {
            return -1;
        }
    }
}

and called this wrapper from Haskell via hs-dotnet:

module Upload where

import NET

upload :: String -> String -> String -> IO (Int)
upload user passed file = 
   invokeStatic "[GoogleDoc.dll]GoogleDoc" "Upload" (user, passed, file)

testLocal :: IO ()
testLocal = do
  let user = "..."
  let passwd = "..."
  let file = "..."
  returnCode <- upload user passwd file
  putStrLn (show returnCode)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T19:28:42+00:00Added an answer on May 31, 2026 at 7:28 pm

    You can use the haskell-oauth library to do the oauth and to upload the documentation, like mentioned already, you can try the http package from Haskell.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create an extension using this docs: http://code.google.com/chrome/extensions/content_scripts.html I want a part
I want to create Contact on Google Apps. I am Using this API And
Good morning, I want to create a Google Maps overlay from GeoTiff data I
I want to create Task in Google Calendar using Google Calendar API.Using C#. Looking
I want to create an overlay on top of Google Maps that displays different
I created a google web application from which I want to send emails. I've
I want to create google map using a pre-defined set of bounds. So instead
i have a unique challenge. i want to create a google analytics filter for
i'm using google maps v3 and i want create a new map associate to
I'm using Google Guava r08 and JDK 1.6.0_23. I want to create an ImmutableSortedMap

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.