Hatena::Grouphatenadeveloper

Hatena Bookmark Bookmark API

en/bookmark/apis/rest/bookmark

Hatena Bookmark Bookmark API

Note

This document is a part of explanation of Hatena Bookmark REST API.

Summary of Bookmark API

Name Operation
GET /{version}/my/bookmark Obtain a user's bookmark information
POST /{version}/my/bookmark Add or update a user's bookmark
DELETE /{version}/my/bookmark Delete a user's bookmark

GET /{version}/my/bookmark

Summary

Get an OAuth authorized user's bookmark information.

URL
http://api.b.hatena.ne.jp/{version}/my/bookmark
Authorization

OAuth authorization (read_public or read_private) is required.

HTTP Method

Access via HTTP GET.

Arguments

Specify url query parameter for URL to retrieve a bookmark.

Summary

On bookmark retrieval succeeded, the API returns a bookmark object.

If bookmark does not exists, the API returns HTTP status code 404.

If API request was invalid, the API returns HTTP status code 400.

POST /{version}/my/bookmark

Summary

Add or update an OAuth authorized user's bookmark.

If the URL has already been bookmarked by the user, the API updates existing bookmark. Otherwise, it creates a new bookmark.

URL
http://api.b.hatena.ne.jp/{version}/my/bookmark
Authorization

OAuth authorization (write_public or write_private) is required.

HTTP method

Access via HTTP POST.

Arguments

Specify a URL to bookmark with url query parameter.

(Optional) Application can specify a bookmark comment with comment query parameter.

(Optional) Application can associate tags with a bookmark with tags query parameter. Application can specify up to 10 tags query parameter.

(Optional) The API allows application to share URL and comment to external web services. After user OAuth authenticated for each service specify true value with post_twitter, post_facebook, post_mixi_check and/or post_evernote query parameters to do so.

If the OAuth authorized user is using Bookmark Plus, application can send bookmarked page to the user's registered e-mail address, specify true value with send_mail query parameter.

To make a private bookmark, set true value to the private query parameter.

Response

The API returns a bookmark object if succeeded to add or update bookmark.

If API request was invalid, the API responds HTTP 400 status code.

DELETE /{version}/my/bookmark

Summary

Delete a bookmark of an authorized user.

URL
http://api.b.hatena.ne.jp/{version}/my/bookmark
Authentication

OAuth authentication (write_public or write_private) is required.

HTTP method

Access via HTTP DELETE.

Arguments

Specify a URL to delete from the user's bookmark as url query parameter.

Response

The API returns HTTP status code 204 on successful deletion.

The API returns HTTP status code 404 if the user's bookmark for the URL does not exists.

The API returns HTTP status code 400 if the API request was invalid.