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:
- Is there a way to convert Blogger user names to numeric user IDs?
- 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:
- 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.
- 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.
精彩评论