开发者

How to convert a Blogger user name to numeric ID

When working with the Blogger API the user ID is expected to be numeric. 开发者_如何学CI found out my numeric ID by looking at the URL for my Blogger profile page. However, I want my users to be able to use their usual Blogger user name. So:

  1. Is there a way to convert Blogger user names to numeric user IDs?
  2. Is there a way to pass in user names instead of IDs to the Blogger API?

Thanks!


It depends on what you are trying to do, but in most use cases you don't need to explicitly know this information because the authToken will take care of resolving these issues for you if you use the default URLs with the API. But, in the interest of providing an answer in case you really do need to know this:

  1. After the user authenticates, just request some information, like the list of blogs, and you'll be able to extract the ID number from your choice of several places in the response.
  2. Not really, except that during login you use the username. Otherwise you need to use either default, assuming an active authToken, or the ID to reference a particular user's Blogger content.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜