בלוגים: קבל

שליפה של בלוג לפי המזהה שלו. רוצים לנסות? או לראות דוגמה?

נדרשת הרשאה אם הבלוג פרטי. אם הבלוג ציבורי, אפשר לקרוא למתודה הזו בלי הרשאה.

בקשה

בקשת HTTP

GET https://www.googleapis.com/blogger/v3/blogs/blogId

פרמטרים

שם הפרמטר ערך תיאור
פרמטרים נדרשים
blogId string מזהה הבלוג שרוצים לאחזר.
פרמטרים אופציונליים
maxPosts unsigned integer המספר המקסימלי של פוסטים לאחזור יחד עם הבלוג. אם לא מציינים את הפרמטר הזה, לא מוחזרים פוסטים כחלק ממקור המידע של הבלוג.

גוף הבקשה

אין לספק גוף בקשה עם השיטה הזו.

תשובה

אם הפעולה בוצעה ללא שגיאות, השיטה הזו מחזירה משאב בלוגים בגוף התגובה.

דוגמאות

הערה: דוגמאות הקוד שזמינות ל-method לא מייצגות את כל שפות התכנות שיש בהן תמיכה. (לרשימת השפות הנתמכות בדף של ספריות הלקוח)

Java

שימוש בספריית הלקוח של Java

// The BlogId for the http://code.blogger.com/ blog.
String CODE_BLOG_ID = "3213900";

// Configure the Java API Client for Installed Native AppHttpTr
ansport HTTP_TRANSPORT = new NetHttpTransport();JsonFa
ctory JSON_FACTORY = new JacksonFactory();
class="devsite-syntax-c1">// Configure for the Installed App OAuth2 flow.Credential c
redential = OAuth2Native.authorize(HTTP_TRANSPORT, JSON_FACTOR
Y, new LocalServerReceiver(), Arrays.asLi
st(BloggerScopes.BLOGGER));span> <span class
="devsite-syntax-c1">// Construct the Blogger API access facade object.Blogger blogger =
Blogger.builder(HTTP_TRANSPORT, JSON_FACTORY) .setApplicationNa
me("Blogger-BlogGet-Snippet/1.0") .setHttpRequestIn
itializer(credential).build(); // This is the request action that you can configure before sending the request.Get blogGetAction = blog
ger.blogs().get(CODE_BLOG_ID);
// Restrict the result content to just the data we need.blogGetAction.setFields(

"description,name,posts/totalItems,updated");// This step sends the r

equest to the server.Blog blog = blogGetActio
n.execute();
// Now we can navigate the response.System.out.println("Name
: "+blog.getName());System.out.println("Desc
ription: "+blog.getDescription());System.out.println("Post
Count: "+blog.getPosts().getTotalItems());System.out.println("Last
Updated: "+blog.getUpdated());an>

רוצה לנסות?

אפשר להשתמש בכלי APIs Explorer שבהמשך כדי להפעיל את השיטה הזו על נתונים פעילים ולראות את התגובה.