このドキュメントではQiita API v2の仕様について説明します。
APIとの全ての通信にはHTTPSプロトコルを利用します。アクセス先のホストには、Qiitaのデータを利用する場合には qiita.com
を利用し、Qiita Teamのデータを利用する場合には *.qiita.com
を利用します (*
には所属しているTeamのIDが入ります)。
API v2へのリクエストには、GET、POST、PUT、PATCH、DELETEの5種類のHTTPメソッドを利用します。多くのAPIへのリクエストにはパラメータを含められますが、GETリクエストにパラメータを含める場合にはURIクエリを利用し、それ以外の場合にはリクエストボディを利用します。パラメータには、ページネーション用途など任意で渡すものと、投稿時の本文など必須のものが存在します。APIドキュメントには、各APIごとに送信可能なパラメータが記載されています。
認証している状態ではユーザごとに1時間に1000回まで、認証していない状態ではIPアドレスごとに1時間に60回までリクエストを受け付けます。
シングルサインオンによる認証のみを許可しているQiita Teamのチームでは、セキュリティ上の理由から現在APIを利用したアクセスができません。
200、201、204、400、401、403、404、500の8種類のステータスコードを利用します。GETまたはPATCHリクエストに対しては200を、POSTリクエストに対しては201を、PUTまたはDELETEリクエストに対しては204を返します。但し、エラーが起きた場合にはその他のステータスコードの中から適切なものを返します。
APIとのデータの送受信にはJSONを利用します。JSONをリクエストボディに含める場合、リクエストのContent-Typeヘッダにapplication/jsonを指定してください。但し、GETリクエストにバラメータを含める場合にはURIクエリを利用します。また、PUTリクエストまたはDELETEリクエストに対してはレスポンスボディが返却されません。日時を表現する場合には、ISO 8601形式の文字列を利用します。
GET /api/v2/items?page=1&per_page=20 HTTP/1.1
エラーが発生した場合、エラーを表現するオブジェクトを含んだエラーレスポンスが返却されます。このオブジェクトには、エラーの内容を説明するmessageプロパティと、エラーの種類を表すtypeプロパティで構成されます。typeプロパティはエラーの種類ごとに一意な文字列で、^[a-z0-9_]+$
というパターンで表現できます。
{
"message": "Not found",
"type": "not_found"
}
一部の配列を返すAPIでは、全ての要素を一度に返すようにはなっておらず、代わりにページを指定できるようになっています。これらのAPIには、1から始まるページ番号を表すpageパラメータと、1ページあたりに含まれる要素数を表すper_pageパラメータを指定することができます。pageの初期値は1、pageの最大値は100に設定されています。また、per_pageの初期値は20、per_pageの最大値は100に設定されています。
ページを指定できるAPIでは、Linkヘッダ を含んだレスポンスを返します。Linkヘッダには、最初のページと最後のページへのリンクに加え、存在する場合には次のページと前のページへのリンクが含まれます。個々のリンクにはそれぞれ、first、last、next、prevという値を含んだrel属性が紐付けられます。
Link: <https://qiita.com/api/v2/users?page=1>; rel="first",
<https://qiita.com/api/v2/users?page=1>; rel="prev",
<https://qiita.com/api/v2/users?page=3>; rel="next",
<https://qiita.com/api/v2/users?page=6>; rel="last"
また、ページを指定できるAPIでは、要素の合計数が Total-Count
レスポンスヘッダに含まれます。
Total-Count: 6
Qiita API v2では、APIのインターフェースを定義したJSON-Schemaを提供しています。このスキーマでは、APIでどのようなリソースが提供されているか、それらはどのようなプロパティを持っているか、それらがどのように表現されるか、及びどのような操作が提供されているかといった事柄が定義されています。スキーマには、次のURLでアクセスできます。
Qiita::TeamのAPI、またはQiitaのGETリクエスト以外のAPIを利用するには、アクセストークンをリクエストに含める必要があります。アクセストークンは、後述するOAuthを利用した認可フローか、ユーザの管理画面から発行できます。
アクセストークンは、以下のようにAuthorizationリクエストヘッダに含められます。
Authorization: Bearer 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcd
個々のアクセストークンには、幾つかのスコープを紐付けられます。スコープはアクセストークン発行時にアプリケーションが指定でき、アプリケーションを利用するユーザはどのスコープが要求されているかを認可画面で確認できます。アクセストークンが適切なスコープを持っているときのみ、APIを介したデータ操作が許可されます。なお、認証が不要なAPIについては、どのスコープも必要としません。本APIでは以下の4つのスコープを提供しています。例えば、read_qiita_teamスコープを持っていないアクセストークンでは、Qiita Teamからデータを読み出すことはできません。また、write_qiitaスコープを持っていないアクセストークンでは、Qiitaに投稿することはできません。
read_qiita - Qiitaからアクセストークンに紐付いたユーザに関連したデータを読み出す
read_qiita_team - Qiita Teamからデータを読み出す
write_qiita - Qiitaにデータを書き込む
write_qiita_team - Qiita Teamにデータを書き込む
アクセストークンを発行するには、アプリケーションのユーザに認可画面を表示する必要があります。ユーザがアプリケーションからのアクセスを認可すると、アプリケーション登録時に指定されたURLにリダイレクトされます。このとき、リダイレクト先のURLクエリにcode
が付与されます。また指定した場合は state
も付与されます。アプリケーションでは、この code
の値を利用して POST /api/v2/access_tokens にリクエストを送り、アクセストークンを発行します。
"a91f0396a0968ff593eafdd194e3d17d32c41b1da7b25e873b42e9058058cd9d"
"read_qiita write_qiita_team"
"bb17785d811bb1913ef54b0a7657de780defaa2d"
GET /api/v2/oauth/authorize?client_id=a91f0396a0968ff593eafdd194e3d17d32c41b1da7b25e873b42e9058058cd9d&scope=read_qiita+write_qiita_team&state=bb17785d811bb1913ef54b0a7657de780defaa2d HTTP/1.1
Host: qiita.com
HTTP/1.1 200
Content-Type: text/html
...
Qiita TeamのいいねAPIは2017年8月24日に非推奨となりました。今後は絵文字リアクションAPIをご利用ください。 記事につけられた「いいね!」を表します。
"2000-01-01T00:00:00+00:00"
記事につけられた「いいね!」を作成日時の降順で返します。
GET /api/v2/items/:item_id/likes HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
[
{
"created_at": "2000-01-01T00:00:00+00:00",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
}
}
]
Qiita API v2で認証・認可を行うためのアクセストークンを表します。
"a91f0396a0968ff593eafdd194e3d17d32c41b1da7b25e873b42e9058058cd9d"
/^[0-9a-f]{40}$/
"ea5d0a593b2655e9568f144fb1826342292f5c6b7d406fda00577b8d1530d8a5"
/^[0-9a-f]{40}$/
与えられた認証情報をもとに新しいアクセストークンを発行します。
"a91f0396a0968ff593eafdd194e3d17d32c41b1da7b25e873b42e9058058cd9d"
/^[0-9a-f]{40}$/
"01fc259c31fe39e72c8ef911c3432a33d51e9337ff34c4fac86c491a0d37251f"
/^[0-9a-f]{40}$/
"fefef5f067171f247fb415e38cb0631797b82f4141dcdee66db846c3ade57a03"
/^[0-9a-f]{40}$/
POST /api/v2/access_tokens HTTP/1.1
Content-Type: application/json
Host: api.example.com
{
"client_id": "a91f0396a0968ff593eafdd194e3d17d32c41b1da7b25e873b42e9058058cd9d",
"client_secret": "01fc259c31fe39e72c8ef911c3432a33d51e9337ff34c4fac86c491a0d37251f",
"code": "fefef5f067171f247fb415e38cb0631797b82f4141dcdee66db846c3ade57a03"
}
HTTP/1.1 201
Content-Type: application/json
{
"client_id": "a91f0396a0968ff593eafdd194e3d17d32c41b1da7b25e873b42e9058058cd9d",
"scopes": [
"read_qiita"
],
"token": "ea5d0a593b2655e9568f144fb1826342292f5c6b7d406fda00577b8d1530d8a5"
}
指定されたアクセストークンを失効させ、それ以降利用できないようにします。
DELETE /api/v2/access_tokens/:access_token HTTP/1.1
Host: api.example.com
HTTP/1.1 204
Qiita Teamのグループを表します。
"2000-01-01T00:00:00+00:00"
1
"Dev"
false
"2000-01-01T00:00:00+00:00"
"dev"
記事やプロジェクトに付けられたコメントを表します。プロジェクトへのコメントはQiita Teamでのみ有効です。
"# Example"
"2000-01-01T00:00:00+00:00"
"3391f50c35f953abfc4f"
/^[0-9a-f]{20}$/
"<h1>Example</h1>"
"2000-01-01T00:00:00+00:00"
コメントを削除します。
DELETE /api/v2/comments/:comment_id HTTP/1.1
Host: api.example.com
HTTP/1.1 204
コメントを取得します。
GET /api/v2/comments/:comment_id HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
{
"body": "# Example",
"created_at": "2000-01-01T00:00:00+00:00",
"id": "3391f50c35f953abfc4f",
"rendered_body": "<h1>Example</h1>",
"updated_at": "2000-01-01T00:00:00+00:00",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
}
}
コメントを更新します。
"# Example"
PATCH /api/v2/comments/:comment_id HTTP/1.1
Content-Type: application/json
Host: api.example.com
{
"body": "# Example"
}
HTTP/1.1 200
Content-Type: application/json
{
"body": "# Example",
"created_at": "2000-01-01T00:00:00+00:00",
"id": "3391f50c35f953abfc4f",
"rendered_body": "<h1>Example</h1>",
"updated_at": "2000-01-01T00:00:00+00:00",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
}
}
DELETE /api/v2/comments/:comment_id/thank は2016年11月16日より非推奨となりました。 コメントからいいねを外します。
DELETE /api/v2/comments/:comment_id/thank HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
{
"body": "# Example",
"created_at": "2000-01-01T00:00:00+00:00",
"id": "3391f50c35f953abfc4f",
"rendered_body": "<h1>Example</h1>",
"updated_at": "2000-01-01T00:00:00+00:00",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
}
}
PUT /api/v2/comments/:comment_id/thank は2016年11月16日より非推奨となりました。 コメントにいいねを付けます。
PUT /api/v2/comments/:comment_id/thank HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
{
"body": "# Example",
"created_at": "2000-01-01T00:00:00+00:00",
"id": "3391f50c35f953abfc4f",
"rendered_body": "<h1>Example</h1>",
"updated_at": "2000-01-01T00:00:00+00:00",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
}
}
投稿に付けられたコメント一覧を投稿日時の降順で取得します。
GET /api/v2/items/:item_id/comments HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
[
{
"body": "# Example",
"created_at": "2000-01-01T00:00:00+00:00",
"id": "3391f50c35f953abfc4f",
"rendered_body": "<h1>Example</h1>",
"updated_at": "2000-01-01T00:00:00+00:00",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
}
}
]
記事に対してコメントを投稿します。
"# Example"
POST /api/v2/items/:item_id/comments HTTP/1.1
Content-Type: application/json
Host: api.example.com
{
"body": "# Example"
}
HTTP/1.1 201
Content-Type: application/json
{
"body": "# Example",
"created_at": "2000-01-01T00:00:00+00:00",
"id": "3391f50c35f953abfc4f",
"rendered_body": "<h1>Example</h1>",
"updated_at": "2000-01-01T00:00:00+00:00",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
}
}
ユーザー名を指定して記事に対するコメントを作成します。(Qiita Teamでのみ有効。管理者権限が必要。)
"# Example"
"yaotti"
"2000-01-01T00:00:00+00:00"
"2000-01-01T00:00:00+00:00"
POST /api/v2/items/:item_id/imported_comments HTTP/1.1
Content-Type: application/json
Host: api.example.com
{
"body": "# Example",
"user_id": "yaotti",
"created_at": "2000-01-01T00:00:00+00:00",
"updated_at": "2000-01-01T00:00:00+00:00"
}
HTTP/1.1 201
Content-Type: application/json
{
"body": "# Example",
"created_at": "2000-01-01T00:00:00+00:00",
"id": "3391f50c35f953abfc4f",
"rendered_body": "<h1>Example</h1>",
"updated_at": "2000-01-01T00:00:00+00:00",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
}
}
プロジェクトに付けられたコメント一覧を投稿日時の降順で取得します。
GET /api/v2/projects/:project_id/comments HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
[
{
"body": "# Example",
"created_at": "2000-01-01T00:00:00+00:00",
"id": "3391f50c35f953abfc4f",
"rendered_body": "<h1>Example</h1>",
"updated_at": "2000-01-01T00:00:00+00:00",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
}
}
]
プロジェクトに対してコメントを投稿します。
"# Example"
POST /api/v2/projects/:project_id/comments HTTP/1.1
Content-Type: application/json
Host: api.example.com
{
"body": "# Example"
}
HTTP/1.1 201
Content-Type: application/json
{
"body": "# Example",
"created_at": "2000-01-01T00:00:00+00:00",
"id": "3391f50c35f953abfc4f",
"rendered_body": "<h1>Example</h1>",
"updated_at": "2000-01-01T00:00:00+00:00",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
}
}
ユーザー名を指定してプロジェクトに対するコメントを作成します。(Qiita Teamでのみ有効。管理者権限が必要。)
"# Example"
"yaotti"
"2000-01-01T00:00:00+00:00"
"2000-01-01T00:00:00+00:00"
POST /api/v2/projects/:project_id/imported_comments HTTP/1.1
Content-Type: application/json
Host: api.example.com
{
"body": "# Example",
"user_id": "yaotti",
"created_at": "2000-01-01T00:00:00+00:00",
"updated_at": "2000-01-01T00:00:00+00:00"
}
HTTP/1.1 201
Content-Type: application/json
{
"body": "# Example",
"created_at": "2000-01-01T00:00:00+00:00",
"id": "3391f50c35f953abfc4f",
"rendered_body": "<h1>Example</h1>",
"updated_at": "2000-01-01T00:00:00+00:00",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
}
}
記事とタグとの関連を表します。
"qiita"
["0.0.1"]
記事にタグを追加します。Qiita Teamでのみ有効です。
"qiita"
["0.0.1"]
POST /api/v2/items/:item_id/taggings HTTP/1.1
Content-Type: application/json
Host: api.example.com
{
"name": "qiita",
"versions": [
"0.0.1"
]
}
HTTP/1.1 201
Content-Type: application/json
{
"name": "qiita",
"versions": [
"0.0.1"
]
}
記事から指定されたタグを取り除きます。Qiita Teamでのみ有効です。
DELETE /api/v2/items/:item_id/taggings/:tagging_id HTTP/1.1
Host: api.example.com
HTTP/1.1 204
記事に付けられた個々のタグを表します。
100
"https://s3-ap-northeast-1.amazonaws.com/qiita-tag-image/9de6a11d330f5694820082438f88ccf4a1b289b2/medium.jpg"
"qiita"
200
タグ一覧を作成日時の降順で返します。
1
/^[0-9]+$/
20
/^[0-9]+$/
"count"
GET /api/v2/tags?page=1&per_page=20&sort=count HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
[
{
"followers_count": 100,
"icon_url": "https://s3-ap-northeast-1.amazonaws.com/qiita-tag-image/9de6a11d330f5694820082438f88ccf4a1b289b2/medium.jpg",
"id": "qiita",
"items_count": 200
}
]
タグを取得します。
GET /api/v2/tags/:tag_id HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
{
"followers_count": 100,
"icon_url": "https://s3-ap-northeast-1.amazonaws.com/qiita-tag-image/9de6a11d330f5694820082438f88ccf4a1b289b2/medium.jpg",
"id": "qiita",
"items_count": 200
}
ユーザがフォローしているタグ一覧をフォロー日時の降順で返します。
1
/^[0-9]+$/
20
/^[0-9]+$/
GET /api/v2/users/:user_id/following_tags?page=1&per_page=20 HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
[
{
"followers_count": 100,
"icon_url": "https://s3-ap-northeast-1.amazonaws.com/qiita-tag-image/9de6a11d330f5694820082438f88ccf4a1b289b2/medium.jpg",
"id": "qiita",
"items_count": 200
}
]
タグのフォローを外します。
DELETE /api/v2/tags/:tag_id/following HTTP/1.1
Host: api.example.com
HTTP/1.1 204
タグをフォローしているかどうかを調べます。
GET /api/v2/tags/:tag_id/following HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
{
"followers_count": 100,
"icon_url": "https://s3-ap-northeast-1.amazonaws.com/qiita-tag-image/9de6a11d330f5694820082438f88ccf4a1b289b2/medium.jpg",
"id": "qiita",
"items_count": 200
}
タグをフォローします。
PUT /api/v2/tags/:tag_id/following HTTP/1.1
Host: api.example.com
HTTP/1.1 204
Qiita Team上で所属しているチームを表します。Qiita Teamでのみ有効です。
true
"increments"
"Increments Inc."
ユーザが所属している全てのチームを、チーム作成日時の降順で返します。
GET /api/v2/teams HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
[
{
"active": true,
"id": "increments",
"name": "Increments Inc."
}
]
ユーザーをチームから離脱させます(Qiita Teamでのみ有効。管理者権限が必要。)。
指定のユーザーをチームから離脱させます。自身とチームのオーナーはこのAPIでは離脱させられません。
DELETE api/v2/remove_team_member/:user_id HTTP/1.1
Host: api.example.com
HTTP/1.1 204
記事のひな形に利用できるテンプレートを表します。Qiita Teamでのみ有効です。
"Weekly MTG on %{Year}/%{month}/%{day}"
1
"Weekly MTG"
"Weekly MTG on 2000/01/01"
[{"name"=>"MTG/2000/01/01", "versions"=>["0.0.1"]}]
"Weekly MTG on 2015/06/03"
[{"name"=>"MTG/%{Year}/%{month}/%{day}", "versions"=>["0.0.1"]}]
"Weekly MTG on %{Year}/%{month}/%{day}"
チーム内のテンプレート一覧を返します。
1
/^[0-9]+$/
20
/^[0-9]+$/
GET /api/v2/templates?page=1&per_page=20 HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
[
{
"body": "Weekly MTG on %{Year}/%{month}/%{day}",
"id": 1,
"name": "Weekly MTG",
"expanded_body": "Weekly MTG on 2000/01/01",
"expanded_tags": [
{
"name": "MTG/2000/01/01",
"versions": [
"0.0.1"
]
}
],
"expanded_title": "Weekly MTG on 2015/06/03",
"tags": [
{
"name": "MTG/%{Year}/%{month}/%{day}",
"versions": [
"0.0.1"
]
}
],
"title": "Weekly MTG on %{Year}/%{month}/%{day}"
}
]
テンプレートを削除します。
DELETE /api/v2/templates/:template_id HTTP/1.1
Host: api.example.com
HTTP/1.1 204
テンプレートを取得します。
GET /api/v2/templates/:template_id HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
{
"body": "Weekly MTG on %{Year}/%{month}/%{day}",
"id": 1,
"name": "Weekly MTG",
"expanded_body": "Weekly MTG on 2000/01/01",
"expanded_tags": [
{
"name": "MTG/2000/01/01",
"versions": [
"0.0.1"
]
}
],
"expanded_title": "Weekly MTG on 2015/06/03",
"tags": [
{
"name": "MTG/%{Year}/%{month}/%{day}",
"versions": [
"0.0.1"
]
}
],
"title": "Weekly MTG on %{Year}/%{month}/%{day}"
}
新しくテンプレートを作成します。
"Weekly MTG on %{Year}/%{month}/%{day}"
"Weekly MTG"
[{"name"=>"MTG/%{Year}/%{month}/%{day}", "versions"=>["0.0.1"]}]
"Weekly MTG on %{Year}/%{month}/%{day}"
POST /api/v2/templates HTTP/1.1
Content-Type: application/json
Host: api.example.com
{
"body": "Weekly MTG on %{Year}/%{month}/%{day}",
"name": "Weekly MTG",
"tags": [
{
"name": "MTG/%{Year}/%{month}/%{day}",
"versions": [
"0.0.1"
]
}
],
"title": "Weekly MTG on %{Year}/%{month}/%{day}"
}
HTTP/1.1 201
Content-Type: application/json
{
"body": "Weekly MTG on %{Year}/%{month}/%{day}",
"id": 1,
"name": "Weekly MTG",
"expanded_body": "Weekly MTG on 2000/01/01",
"expanded_tags": [
{
"name": "MTG/2000/01/01",
"versions": [
"0.0.1"
]
}
],
"expanded_title": "Weekly MTG on 2015/06/03",
"tags": [
{
"name": "MTG/%{Year}/%{month}/%{day}",
"versions": [
"0.0.1"
]
}
],
"title": "Weekly MTG on %{Year}/%{month}/%{day}"
}
テンプレートを更新します。
"Weekly MTG on %{Year}/%{month}/%{day}"
"Weekly MTG"
[{"name"=>"MTG/%{Year}/%{month}/%{day}", "versions"=>["0.0.1"]}]
"Weekly MTG on %{Year}/%{month}/%{day}"
PATCH /api/v2/templates/:template_id HTTP/1.1
Content-Type: application/json
Host: api.example.com
{
"body": "Weekly MTG on %{Year}/%{month}/%{day}",
"name": "Weekly MTG",
"tags": [
{
"name": "MTG/%{Year}/%{month}/%{day}",
"versions": [
"0.0.1"
]
}
],
"title": "Weekly MTG on %{Year}/%{month}/%{day}"
}
HTTP/1.1 200
Content-Type: application/json
{
"body": "Weekly MTG on %{Year}/%{month}/%{day}",
"id": 1,
"name": "Weekly MTG",
"expanded_body": "Weekly MTG on 2000/01/01",
"expanded_tags": [
{
"name": "MTG/2000/01/01",
"versions": [
"0.0.1"
]
}
],
"expanded_title": "Weekly MTG on 2015/06/03",
"tags": [
{
"name": "MTG/%{Year}/%{month}/%{day}",
"versions": [
"0.0.1"
]
}
],
"title": "Weekly MTG on %{Year}/%{month}/%{day}"
}
Qiita Team上でのプロジェクトを表します。Qiita Teamでのみ有効です。
"<h1>Example</h1>"
false
"# Example"
"2000-01-01T00:00:00+00:00"
1
"Kobiro Project"
100
"2000-01-01T00:00:00+00:00"
チーム内に存在するプロジェクト一覧をプロジェクト作成日時の降順で返します。
1
/^[0-9]+$/
20
/^[0-9]+$/
GET /api/v2/projects?page=1&per_page=20 HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
[
{
"rendered_body": "<h1>Example</h1>",
"archived": false,
"body": "# Example",
"created_at": "2000-01-01T00:00:00+00:00",
"id": 1,
"name": "Kobiro Project",
"reactions_count": 100,
"updated_at": "2000-01-01T00:00:00+00:00"
}
]
プロジェクトを新たに作成します。
false
"# Example"
"Kobiro Project"
[{"name"=>"Ruby", "versions"=>["0.0.1"]}]
POST /api/v2/projects HTTP/1.1
Content-Type: application/json
Host: api.example.com
{
"archived": false,
"body": "# Example",
"name": "Kobiro Project",
"tags": [
{
"name": "Ruby",
"versions": [
"0.0.1"
]
}
]
}
HTTP/1.1 201
Content-Type: application/json
{
"rendered_body": "<h1>Example</h1>",
"archived": false,
"body": "# Example",
"created_at": "2000-01-01T00:00:00+00:00",
"id": 1,
"name": "Kobiro Project",
"reactions_count": 100,
"updated_at": "2000-01-01T00:00:00+00:00"
}
プロジェクトを削除します。
DELETE /api/v2/projects/:project_id HTTP/1.1
Host: api.example.com
HTTP/1.1 204
プロジェクトを返します。
GET /api/v2/projects/:project_id HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
{
"rendered_body": "<h1>Example</h1>",
"archived": false,
"body": "# Example",
"created_at": "2000-01-01T00:00:00+00:00",
"id": 1,
"name": "Kobiro Project",
"reactions_count": 100,
"updated_at": "2000-01-01T00:00:00+00:00"
}
プロジェクトを更新します。
false
"# Example"
"Kobiro Project"
[{"name"=>"Ruby", "versions"=>["0.0.1"]}]
PATCH /api/v2/projects/:project_id HTTP/1.1
Content-Type: application/json
Host: api.example.com
{
"archived": false,
"body": "# Example",
"name": "Kobiro Project",
"tags": [
{
"name": "Ruby",
"versions": [
"0.0.1"
]
}
]
}
HTTP/1.1 200
Content-Type: application/json
{
"rendered_body": "<h1>Example</h1>",
"archived": false,
"body": "# Example",
"created_at": "2000-01-01T00:00:00+00:00",
"id": 1,
"name": "Kobiro Project",
"reactions_count": 100,
"updated_at": "2000-01-01T00:00:00+00:00"
}
ユーザー名を指定してプロジェクトを新たに作成します。
false
"# Example"
"Kobiro Project"
[{"name"=>"Ruby", "versions"=>["0.0.1"]}]
"yaotti"
"2000-01-01T00:00:00+00:00"
"2000-01-01T00:00:00+00:00"
POST /api/v2/imported_projects HTTP/1.1
Content-Type: application/json
Host: api.example.com
{
"archived": false,
"body": "# Example",
"name": "Kobiro Project",
"tags": [
{
"name": "Ruby",
"versions": [
"0.0.1"
]
}
],
"user_id": "yaotti",
"created_at": "2000-01-01T00:00:00+00:00",
"updated_at": "2000-01-01T00:00:00+00:00"
}
HTTP/1.1 201
Content-Type: application/json
{
"rendered_body": "<h1>Example</h1>",
"archived": false,
"body": "# Example",
"created_at": "2000-01-01T00:00:00+00:00",
"id": 1,
"name": "Kobiro Project",
"reactions_count": 100,
"updated_at": "2000-01-01T00:00:00+00:00"
}
Qiita上のユーザを表します。
"Hello, world."
"yaotti"
100
200
"yaotti"
"yaotti"
300
"yaotti"
"Tokyo, Japan"
"Hiroshige Umino"
"Increments Inc"
1
"https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg"
false
"yaotti"
"http://yaotti.hatenablog.com"
記事をストックしているユーザ一覧を、ストックした日時の降順で返します。
1
/^[0-9]+$/
20
/^[0-9]+$/
GET /api/v2/items/:item_id/stockers?page=1&per_page=20 HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
[
{
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
}
]
全てのユーザの一覧を作成日時の降順で取得します。
1
/^[0-9]+$/
20
/^[0-9]+$/
GET /api/v2/users?page=1&per_page=20 HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
[
{
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
}
]
ユーザを取得します。
GET /api/v2/users/:user_id HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
{
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
}
ユーザがフォローしているユーザ一覧を取得します。
1
/^[0-9]+$/
20
/^[0-9]+$/
GET /api/v2/users/:user_id/followees?page=1&per_page=20 HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
[
{
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
}
]
ユーザをフォローしているユーザ一覧を取得します。
1
/^[0-9]+$/
20
/^[0-9]+$/
GET /api/v2/users/:user_id/followers?page=1&per_page=20 HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
[
{
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
}
]
ユーザへのフォローを外します。
DELETE /api/v2/users/:user_id/following HTTP/1.1
Host: api.example.com
HTTP/1.1 204
ユーザをフォローしている場合に204を返します。
GET /api/v2/users/:user_id/following HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
{
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
}
ユーザをフォローします。
PUT /api/v2/users/:user_id/following HTTP/1.1
Host: api.example.com
HTTP/1.1 204
テンプレートを保存する前に変数展開後の状態をプレビューできます。Qiita Teamでのみ有効です。
"Weekly MTG on 2000/01/01"
[{"name"=>"MTG/2000/01/01", "versions"=>["0.0.1"]}]
"Weekly MTG on 2015/06/03"
受け取ったテンプレート用文字列の変数を展開して返します。
"Weekly MTG on %{Year}/%{month}/%{day}"
[{"name"=>"MTG/%{Year}/%{month}/%{day}", "versions"=>["0.0.1"]}]
"Weekly MTG on %{Year}/%{month}/%{day}"
POST /api/v2/expanded_templates HTTP/1.1
Content-Type: application/json
Host: api.example.com
{
"body": "Weekly MTG on %{Year}/%{month}/%{day}",
"tags": [
{
"name": "MTG/%{Year}/%{month}/%{day}",
"versions": [
"0.0.1"
]
}
],
"title": "Weekly MTG on %{Year}/%{month}/%{day}"
}
HTTP/1.1 201
Content-Type: application/json
{
"expanded_body": "Weekly MTG on 2000/01/01",
"expanded_tags": [
{
"name": "MTG/2000/01/01",
"versions": [
"0.0.1"
]
}
],
"expanded_title": "Weekly MTG on 2015/06/03"
}
ユーザからの投稿を表します。
"<h1>Example</h1>"
"# Example"
false
100
"2000-01-01T00:00:00+00:00"
"4bd431809afb1bb99e4f"
/^[0-9a-f]{20}$/
100
false
100
[{"name"=>"Ruby", "versions"=>["0.0.1"]}]
"Example title"
"2000-01-01T00:00:00+00:00"
"https://qiita.com/yaotti/items/4bd431809afb1bb99e4f"
100
認証中のユーザの記事の一覧を作成日時の降順で返します。
1
/^[0-9]+$/
20
/^[0-9]+$/
GET /api/v2/authenticated_user/items?page=1&per_page=20 HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
[
{
"rendered_body": "<h1>Example</h1>",
"body": "# Example",
"coediting": false,
"comments_count": 100,
"created_at": "2000-01-01T00:00:00+00:00",
"group": {
"created_at": "2000-01-01T00:00:00+00:00",
"id": 1,
"name": "Dev",
"private": false,
"updated_at": "2000-01-01T00:00:00+00:00",
"url_name": "dev"
},
"id": "4bd431809afb1bb99e4f",
"likes_count": 100,
"private": false,
"reactions_count": 100,
"tags": [
{
"name": "Ruby",
"versions": [
"0.0.1"
]
}
],
"title": "Example title",
"updated_at": "2000-01-01T00:00:00+00:00",
"url": "https://qiita.com/yaotti/items/4bd431809afb1bb99e4f",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
},
"page_views_count": 100
}
]
記事の一覧を作成日時の降順で返します。
1
/^[0-9]+$/
20
/^[0-9]+$/
"qiita user:yaotti"
GET /api/v2/items?page=1&per_page=20&query=qiita+user%3Ayaotti HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
[
{
"rendered_body": "<h1>Example</h1>",
"body": "# Example",
"coediting": false,
"comments_count": 100,
"created_at": "2000-01-01T00:00:00+00:00",
"group": {
"created_at": "2000-01-01T00:00:00+00:00",
"id": 1,
"name": "Dev",
"private": false,
"updated_at": "2000-01-01T00:00:00+00:00",
"url_name": "dev"
},
"id": "4bd431809afb1bb99e4f",
"likes_count": 100,
"private": false,
"reactions_count": 100,
"tags": [
{
"name": "Ruby",
"versions": [
"0.0.1"
]
}
],
"title": "Example title",
"updated_at": "2000-01-01T00:00:00+00:00",
"url": "https://qiita.com/yaotti/items/4bd431809afb1bb99e4f",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
},
"page_views_count": 100
}
]
新たに記事を作成します。
"# Example"
false
"dev"
false
[{"name"=>"Ruby", "versions"=>["0.0.1"]}]
"Example title"
false
POST /api/v2/items HTTP/1.1
Content-Type: application/json
Host: api.example.com
{
"body": "# Example",
"coediting": false,
"group_url_name": "dev",
"private": false,
"tags": [
{
"name": "Ruby",
"versions": [
"0.0.1"
]
}
],
"title": "Example title",
"tweet": false
}
HTTP/1.1 201
Content-Type: application/json
{
"rendered_body": "<h1>Example</h1>",
"body": "# Example",
"coediting": false,
"comments_count": 100,
"created_at": "2000-01-01T00:00:00+00:00",
"group": {
"created_at": "2000-01-01T00:00:00+00:00",
"id": 1,
"name": "Dev",
"private": false,
"updated_at": "2000-01-01T00:00:00+00:00",
"url_name": "dev"
},
"id": "4bd431809afb1bb99e4f",
"likes_count": 100,
"private": false,
"reactions_count": 100,
"tags": [
{
"name": "Ruby",
"versions": [
"0.0.1"
]
}
],
"title": "Example title",
"updated_at": "2000-01-01T00:00:00+00:00",
"url": "https://qiita.com/yaotti/items/4bd431809afb1bb99e4f",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
},
"page_views_count": 100
}
記事を削除します。
DELETE /api/v2/items/:item_id HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
{
"rendered_body": "<h1>Example</h1>",
"body": "# Example",
"coediting": false,
"comments_count": 100,
"created_at": "2000-01-01T00:00:00+00:00",
"group": {
"created_at": "2000-01-01T00:00:00+00:00",
"id": 1,
"name": "Dev",
"private": false,
"updated_at": "2000-01-01T00:00:00+00:00",
"url_name": "dev"
},
"id": "4bd431809afb1bb99e4f",
"likes_count": 100,
"private": false,
"reactions_count": 100,
"tags": [
{
"name": "Ruby",
"versions": [
"0.0.1"
]
}
],
"title": "Example title",
"updated_at": "2000-01-01T00:00:00+00:00",
"url": "https://qiita.com/yaotti/items/4bd431809afb1bb99e4f",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
},
"page_views_count": 100
}
記事を取得します。
GET /api/v2/items/:item_id HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
{
"rendered_body": "<h1>Example</h1>",
"body": "# Example",
"coediting": false,
"comments_count": 100,
"created_at": "2000-01-01T00:00:00+00:00",
"group": {
"created_at": "2000-01-01T00:00:00+00:00",
"id": 1,
"name": "Dev",
"private": false,
"updated_at": "2000-01-01T00:00:00+00:00",
"url_name": "dev"
},
"id": "4bd431809afb1bb99e4f",
"likes_count": 100,
"private": false,
"reactions_count": 100,
"tags": [
{
"name": "Ruby",
"versions": [
"0.0.1"
]
}
],
"title": "Example title",
"updated_at": "2000-01-01T00:00:00+00:00",
"url": "https://qiita.com/yaotti/items/4bd431809afb1bb99e4f",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
},
"page_views_count": 100
}
記事を更新します。
"# Example"
false
"dev"
false
[{"name"=>"Ruby", "versions"=>["0.0.1"]}]
"Example title"
PATCH /api/v2/items/:item_id HTTP/1.1
Content-Type: application/json
Host: api.example.com
{
"body": "# Example",
"coediting": false,
"group_url_name": "dev",
"private": false,
"tags": [
{
"name": "Ruby",
"versions": [
"0.0.1"
]
}
],
"title": "Example title"
}
HTTP/1.1 200
Content-Type: application/json
{
"rendered_body": "<h1>Example</h1>",
"body": "# Example",
"coediting": false,
"comments_count": 100,
"created_at": "2000-01-01T00:00:00+00:00",
"group": {
"created_at": "2000-01-01T00:00:00+00:00",
"id": 1,
"name": "Dev",
"private": false,
"updated_at": "2000-01-01T00:00:00+00:00",
"url_name": "dev"
},
"id": "4bd431809afb1bb99e4f",
"likes_count": 100,
"private": false,
"reactions_count": 100,
"tags": [
{
"name": "Ruby",
"versions": [
"0.0.1"
]
}
],
"title": "Example title",
"updated_at": "2000-01-01T00:00:00+00:00",
"url": "https://qiita.com/yaotti/items/4bd431809afb1bb99e4f",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
},
"page_views_count": 100
}
ユーザー名、日時を指定して記事を作成します。(Qiita Teamでのみ有効。管理者権限が必要。)
"# Example"
false
"dev"
[{"name"=>"Ruby", "versions"=>["0.0.1"]}]
"Example title"
"yaotti"
"2000-01-01T00:00:00+00:00"
"2000-01-01T00:00:00+00:00"
POST /api/v2/imported_items HTTP/1.1
Content-Type: application/json
Host: api.example.com
{
"body": "# Example",
"coediting": false,
"group_url_name": "dev",
"tags": [
{
"name": "Ruby",
"versions": [
"0.0.1"
]
}
],
"title": "Example title",
"user_id": "yaotti",
"created_at": "2000-01-01T00:00:00+00:00",
"updated_at": "2000-01-01T00:00:00+00:00"
}
HTTP/1.1 201
Content-Type: application/json
{
"rendered_body": "<h1>Example</h1>",
"body": "# Example",
"coediting": false,
"comments_count": 100,
"created_at": "2000-01-01T00:00:00+00:00",
"group": {
"created_at": "2000-01-01T00:00:00+00:00",
"id": 1,
"name": "Dev",
"private": false,
"updated_at": "2000-01-01T00:00:00+00:00",
"url_name": "dev"
},
"id": "4bd431809afb1bb99e4f",
"likes_count": 100,
"private": false,
"reactions_count": 100,
"tags": [
{
"name": "Ruby",
"versions": [
"0.0.1"
]
}
],
"title": "Example title",
"updated_at": "2000-01-01T00:00:00+00:00",
"url": "https://qiita.com/yaotti/items/4bd431809afb1bb99e4f",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
},
"page_views_count": 100
}
Qiita TeamのいいねAPIは2017年8月24日に非推奨となりました。今後は絵文字リアクションAPIをご利用ください。 記事への「いいね!」を取り消します。
DELETE /api/v2/items/:item_id/like HTTP/1.1
Host: api.example.com
HTTP/1.1 204
Qiita TeamのいいねAPIは2017年8月24日に非推奨となりました。今後は絵文字リアクションAPIをご利用ください。 記事に「いいね!」を付けます。
PUT /api/v2/items/:item_id/like HTTP/1.1
Host: api.example.com
HTTP/1.1 204
記事をストックします。
PUT /api/v2/items/:item_id/stock HTTP/1.1
Host: api.example.com
HTTP/1.1 204
記事をストックから取り除きます。
DELETE /api/v2/items/:item_id/stock HTTP/1.1
Host: api.example.com
HTTP/1.1 204
記事をストックしているかどうかを調べます。
GET /api/v2/items/:item_id/stock HTTP/1.1
Host: api.example.com
HTTP/1.1 204
Qiita TeamのいいねAPIは2017年8月24日に非推奨となりました。今後は絵文字リアクションAPIをご利用ください。 記事に「いいね!」を付けているかどうかを調べます。
GET /api/v2/items/:item_id/like HTTP/1.1
Host: api.example.com
HTTP/1.1 204
記事をストックします。
PUT /api/v2/items/:item_id/stock HTTP/1.1
Host: api.example.com
HTTP/1.1 204
指定されたタグが付けられた記事一覧を、タグを付けた日時の降順で返します。
1
/^[0-9]+$/
20
/^[0-9]+$/
GET /api/v2/tags/:tag_id/items?page=1&per_page=20 HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
[
{
"rendered_body": "<h1>Example</h1>",
"body": "# Example",
"coediting": false,
"comments_count": 100,
"created_at": "2000-01-01T00:00:00+00:00",
"group": {
"created_at": "2000-01-01T00:00:00+00:00",
"id": 1,
"name": "Dev",
"private": false,
"updated_at": "2000-01-01T00:00:00+00:00",
"url_name": "dev"
},
"id": "4bd431809afb1bb99e4f",
"likes_count": 100,
"private": false,
"reactions_count": 100,
"tags": [
{
"name": "Ruby",
"versions": [
"0.0.1"
]
}
],
"title": "Example title",
"updated_at": "2000-01-01T00:00:00+00:00",
"url": "https://qiita.com/yaotti/items/4bd431809afb1bb99e4f",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
},
"page_views_count": 100
}
]
指定されたユーザの記事一覧を、作成日時の降順で返します。
1
/^[0-9]+$/
20
/^[0-9]+$/
GET /api/v2/users/:user_id/items?page=1&per_page=20 HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
[
{
"rendered_body": "<h1>Example</h1>",
"body": "# Example",
"coediting": false,
"comments_count": 100,
"created_at": "2000-01-01T00:00:00+00:00",
"group": {
"created_at": "2000-01-01T00:00:00+00:00",
"id": 1,
"name": "Dev",
"private": false,
"updated_at": "2000-01-01T00:00:00+00:00",
"url_name": "dev"
},
"id": "4bd431809afb1bb99e4f",
"likes_count": 100,
"private": false,
"reactions_count": 100,
"tags": [
{
"name": "Ruby",
"versions": [
"0.0.1"
]
}
],
"title": "Example title",
"updated_at": "2000-01-01T00:00:00+00:00",
"url": "https://qiita.com/yaotti/items/4bd431809afb1bb99e4f",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
},
"page_views_count": 100
}
]
指定されたユーザがストックした記事一覧を、ストックした日時の降順で返します。
1
/^[0-9]+$/
20
/^[0-9]+$/
GET /api/v2/users/:user_id/stocks?page=1&per_page=20 HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
[
{
"rendered_body": "<h1>Example</h1>",
"body": "# Example",
"coediting": false,
"comments_count": 100,
"created_at": "2000-01-01T00:00:00+00:00",
"group": {
"created_at": "2000-01-01T00:00:00+00:00",
"id": 1,
"name": "Dev",
"private": false,
"updated_at": "2000-01-01T00:00:00+00:00",
"url_name": "dev"
},
"id": "4bd431809afb1bb99e4f",
"likes_count": 100,
"private": false,
"reactions_count": 100,
"tags": [
{
"name": "Ruby",
"versions": [
"0.0.1"
]
}
],
"title": "Example title",
"updated_at": "2000-01-01T00:00:00+00:00",
"url": "https://qiita.com/yaotti/items/4bd431809afb1bb99e4f",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
},
"page_views_count": 100
}
]
Qiita Teamでの招待中のメンバーを表します。(Qiita Teamでのみ有効。管理者権限が必要。)
"example@example.com"
"https://team-name.qiita.com/registration/confirm?id=3&token=456c84ae60070161a36c08c9e710050abe5852cc"
招待中のメンバーの一覧を返します
GET api/v2/team_invitations HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
[
{
"email": "example@example.com",
"url": "https://team-name.qiita.com/registration/confirm?id=3&token=456c84ae60070161a36c08c9e710050abe5852cc"
}
]
チームにメンバーを招待します
POST api/v2/team_invitations HTTP/1.1
Host: api.example.com
HTTP/1.1 201
Content-Type: application/json
{
"email": "example@example.com",
"url": "https://team-name.qiita.com/registration/confirm?id=3&token=456c84ae60070161a36c08c9e710050abe5852cc"
}
招待を取り消します
DELETE api/v2/team_invitations/:email HTTP/1.1
Host: api.example.com
HTTP/1.1 204
Qiita Team上での絵文字リアクションを表します。Qiita Teamでのみ有効です。
"2000-01-01T00:00:00+00:00"
"https://cdn.qiita.com/emoji/twemoji/unicode/1f44d.png"
"+1"
コメントに絵文字リアクションを付けます。
"+1"
POST /api/v2/comments/:comment_id/reactions HTTP/1.1
Content-Type: application/json
Host: api.example.com
{
"name": "+1"
}
HTTP/1.1 201
Content-Type: application/json
{
"created_at": "2000-01-01T00:00:00+00:00",
"image_url": "https://cdn.qiita.com/emoji/twemoji/unicode/1f44d.png",
"name": "+1",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
}
}
記事に絵文字リアクションを付けます。
"+1"
POST /api/v2/items/:item_id/reactions HTTP/1.1
Content-Type: application/json
Host: api.example.com
{
"name": "+1"
}
HTTP/1.1 201
Content-Type: application/json
{
"created_at": "2000-01-01T00:00:00+00:00",
"image_url": "https://cdn.qiita.com/emoji/twemoji/unicode/1f44d.png",
"name": "+1",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
}
}
プロジェクトに絵文字リアクションを付けます。
"+1"
POST /api/v2/projects/:project_id/reactions HTTP/1.1
Content-Type: application/json
Host: api.example.com
{
"name": "+1"
}
HTTP/1.1 201
Content-Type: application/json
{
"created_at": "2000-01-01T00:00:00+00:00",
"image_url": "https://cdn.qiita.com/emoji/twemoji/unicode/1f44d.png",
"name": "+1",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
}
}
コメントから絵文字リアクションを削除します。
DELETE /api/v2/comments/:comment_id/reactions/:reaction_name HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
{
"created_at": "2000-01-01T00:00:00+00:00",
"image_url": "https://cdn.qiita.com/emoji/twemoji/unicode/1f44d.png",
"name": "+1",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
}
}
記事から絵文字リアクションを削除します。
DELETE /api/v2/items/:item_id/reactions/:reaction_name HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
{
"created_at": "2000-01-01T00:00:00+00:00",
"image_url": "https://cdn.qiita.com/emoji/twemoji/unicode/1f44d.png",
"name": "+1",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
}
}
プロジェクトから絵文字リアクションを削除します。
DELETE /api/v2/projects/:project_id/reactions/:reaction_name HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
{
"created_at": "2000-01-01T00:00:00+00:00",
"image_url": "https://cdn.qiita.com/emoji/twemoji/unicode/1f44d.png",
"name": "+1",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
}
}
コメントに付けられた絵文字リアクション一覧を作成日時の降順で返します。
GET /api/v2/comments/:comment_id/reactions HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
[
{
"created_at": "2000-01-01T00:00:00+00:00",
"image_url": "https://cdn.qiita.com/emoji/twemoji/unicode/1f44d.png",
"name": "+1",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
}
}
]
記事に付けられた絵文字リアクション一覧を作成日時の降順で返します。
GET /api/v2/items/:item_id/reactions HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
[
{
"created_at": "2000-01-01T00:00:00+00:00",
"image_url": "https://cdn.qiita.com/emoji/twemoji/unicode/1f44d.png",
"name": "+1",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
}
}
]
プロジェクトに付けられた絵文字リアクション一覧を作成日時の降順で返します。
GET /api/v2/projects/:project_id/reactions HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
[
{
"created_at": "2000-01-01T00:00:00+00:00",
"image_url": "https://cdn.qiita.com/emoji/twemoji/unicode/1f44d.png",
"name": "+1",
"user": {
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com"
}
}
]
現在のアクセストークンで認証中のユーザを表します。通常のユーザ情報よりも詳細な情報を含んでいます。
"Hello, world."
"yaotti"
100
200
"yaotti"
"yaotti"
300
"yaotti"
"Tokyo, Japan"
"Hiroshige Umino"
"Increments Inc"
1
"https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg"
false
"yaotti"
"http://yaotti.hatenablog.com"
1048576
524288
アクセストークンに紐付いたユーザを返します。
GET /api/v2/authenticated_user HTTP/1.1
Host: api.example.com
HTTP/1.1 200
Content-Type: application/json
{
"description": "Hello, world.",
"facebook_id": "yaotti",
"followees_count": 100,
"followers_count": 200,
"github_login_name": "yaotti",
"id": "yaotti",
"items_count": 300,
"linkedin_id": "yaotti",
"location": "Tokyo, Japan",
"name": "Hiroshige Umino",
"organization": "Increments Inc",
"permanent_id": 1,
"profile_image_url": "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg",
"team_only": false,
"twitter_screen_name": "yaotti",
"website_url": "http://yaotti.hatenablog.com",
"image_monthly_upload_limit": 1048576,
"image_monthly_upload_remaining": 524288
}