Users
Learn about the user class of the Blogger API.
We'll cover the following
Overview
A user, also referred to as a Blogger user, represents the person who writes blogs. A user is the owner and the author of all the blog posts and pages created from his/her blogger account.
User properties
The table below shows the list of user class properties.
Parameter | Type | Description |
| string | The type of object. Value: "blogger#user" Note: This value is fixed. |
| string | The ID of the user. |
| datetime | The user profile's date of creation. Format: yyyy-mm-dd |
| string | The published link of the user profile. |
| string | The Blogger API URL of the user profile. |
| object | The object that contains the user's blogs. |
| string | The Blogger API URL of the user's blogs collection. |
| string | The name of the user. |
| string | The profile summary of the user. |
| object | The object that contains the locale information of the user. |
| string | The Language setting of the user. |
| string | The country setting of the user. |
| string | The language variant setting of the user. |
Get user ID
Step 1: Head over to the Blogger dashboard.
Step 2: From the navigation panel on the left, click the "View blog" button. This will direct you to your published blog site.
Step 3: In the navigation panel, click on the "VISIT PROFILE" button. This will direct you to your user profile page.
Step 4: Look at the URL of the webpage in the address bar of the browser. The number at the end of the URL is your USER_ID
.
Save this ID somewhere—we'll need it throughout this course.
Get user information
We can get user information by making a GET
request to the following endpoint:
https://blogger.googleapis.com/v3/users/userId
This endpoint requires the USER_ID
.
Request parameters
Parameter | Type | Category | Description |
| string | required | The ID of the user to retrieve. Allowable values: "self" or current user ID |
Sample code
Click the "Edit" button in the widget below. Enter the value for the required parameter USER_ID
and click the "Save" button. Then, click the "Run" button to see the output.
url = 'https://blogger.googleapis.com/v3/users/{{USER_ID}}'response = requests.get(url, headers=headers)printResponse(response)
The above code displays the complete user object corresponding to the given USER_ID
. The response object contains all the parameters given in the user properties table above. An appropriate error message will be displayed if the API call fails.