Posterous Importer
[resolved] Got HTTP 401 from Posterous API (7 posts)

  1. John Eckman
    Posted 4 years ago #

    Not entirely sure where the error lies, but it seems like there is something wrong with the constructor function or how it passes username/password.

    I found I consistently got 401 http response from the Posterous API for http://posterous.com/api/getsites, though I knew my authorization was correct.

    What I did was to find the call to:
    $data = $this->get_page( $url, $this->username, $this->password );
    And hard code in the username and password:
    $data = $this->get_page( $url, 'myusername', 'mypassword');

    (This was line 105 in the 0.9 version).

    That got my past the get_sites call, but then it was failing on getting the posts. (403 status on the call to http://posterous.com/api/readposts).

    Realizing my posts (on the posterous side) were public, and didn't require authorization, I just changed line 157 from:
    $data = $this->get_page( $url, $this->username, $this->password );
    $data = $this->get_page( $url);

    I still had to put in the username and password when submitting the form to pass the jquery test, but once I bypassed that I was successfully able to import 50+ posts and over 450 comments from a Posterous site without trouble.


  2. thevisualinsight
    Posted 4 years ago #

    Hey John.
    I carefully edited the code as you suggest but I keep getting:
    Got HTTP code 401 from http://posterous.com/api/getsites

    I'm kinda desperate since I have a +500 posts blog with Posterous and I would hate to leave that behind.

    Any ideas about another solution I could try?

    Thanks for your post!

  3. John Eckman
    Posted 4 years ago #

    401 is "unauthorized" - are you absolutely certain you have the username and password correct, in particular at line 109 where the getsites API is used?

    You *are* replacing 'myusername' with your username and 'mypassword' with your password, yes?

    Because they are string literals they should be in 'quotes'.

    Try hitting http://posterous.com/api/getsites directly in a browser - it will challenge you for a username and password - if you put yours in correctly, do you get a list of sites?

  4. thevisualinsight
    Posted 4 years ago #

    Thanks so much for the answer, John!

    Yes, I got username (which is actually my email address) and password right .I also replaced myusernameand mypasswordwith my credentials keeping the quotes.

    When I hit http://posterous.com/api/getsites and provide username and password I get

    838357 vi_teste brunocarneirovi http://brunocarneirovi.posterous.com false true true 533 838587 Imported from http://www.visualinsight.com.br import-xzvx http://import-xzvx.posterous.com false false true 0

    PS: all my posts are also "public"

  5. thevisualinsight
    Posted 4 years ago #

    Hey John,
    Just found a way around the Posterous Importer issue.
    My Posterous blog was automatically posting also in a long forgotten blogger account I had. I remembered it today and used the blogger importer. In 3 minutes everything was done.

    Thanks so much for you attention!

  6. sidgabriel
    Posted 4 years ago #

    Thanks a lot!

    Now I'm going to go pull my credentials out of that plugin file!!

    Importer Status
    Posts: 70
    Comments: 11
    Attachments: 152

  7. Merry122
    Posted 4 years ago #

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Posterous Importer
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic