How to find my user_id for API?

  • 1
  • Question
  • Updated 5 years ago
I have a simple script to login against the API and get my OPML and starred stories as a backup. I'd like to extend it to export/backup my shared stories via the URL, but how do I determine my user_id ? I don't see it coming back in the /api/login response, and I don't see another way to get it.
Photo of Josh Sled

Josh Sled

  • 123 Posts
  • 36 Reply Likes

Posted 5 years ago

  • 1
Photo of Samuel Clay

Samuel Clay, Official Rep

  • 6514 Posts
  • 1474 Reply Likes
You shouldn't need your user id. Just pass back the cookie from /api/login.
Photo of Samuel Clay

Samuel Clay, Official Rep

  • 6514 Posts
  • 1474 Reply Likes
Ohh, I suppose you're looking for your blurblog stories. Just checked and there are no endpoints which give you your user id back. If you just want it once, go to the web and open your blurblog. The URL should include your user id. If you want to be able to automate this process, let me know and I'll include it in some endpoint, probably login.
Photo of Samuel Clay

Samuel Clay, Official Rep

  • 6514 Posts
  • 1474 Reply Likes
Ok, I added a 'user_id' parameter to every single response. I noticed it might be nice, and it doubles as a check on authentication.
Photo of Josh Sled

Josh Sled

  • 123 Posts
  • 36 Reply Likes
Samuel, thanks so much for this. I was able to extend my backup script to parse the user_id out and use it to dump my shared stories.

Cheers, thanks a lot!