概要

このドキュメントでは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

JSON Schema

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にデータを書き込む

GET /api/v2/oauth/authorize

アクセストークンを発行するには、アプリケーションのユーザに認可画面を表示する必要があります。ユーザがアプリケーションからのアクセスを認可すると、アプリケーション登録時に指定されたURLにリダイレクトされます。このとき、リダイレクト先のURLクエリにcodeが付与されます。また指定した場合は state も付与されます。アプリケーションでは、この code の値を利用して POST /api/v2/access_tokens にリクエストを送り、アクセストークンを発行します。

  • client_id
    • 登録されたAPIクライアントを特定するためのIDです。40桁の16進数で表現されます。
    • Example: "a91f0396a0968ff593eafdd194e3d17d32c41b1da7b25e873b42e9058058cd9d"
  • scope
    • アプリケーションが利用するスコープをスペース区切りで指定できます。
    • Example: "read_qiita write_qiita_team"
  • state
    • CSRF対策のため、認可後にリダイレクトするURLのクエリに含まれる値を指定できます。
    • Example: "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をご利用ください。 記事につけられた「いいね!」を表します。

  • created_at
    • データが作成された日時
    • Example: "2000-01-01T00:00:00+00:00"
    • Type: string
    • Format: date-time
  • user
    • Qiita上のユーザを表します。

GET /api/v2/items/:item_id/likes

記事につけられた「いいね!」を作成日時の降順で返します。

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で認証・認可を行うためのアクセストークンを表します。

  • client_id
    • 登録されたAPIクライアントを特定するためのID
    • Example: "a91f0396a0968ff593eafdd194e3d17d32c41b1da7b25e873b42e9058058cd9d"
    • Type: string
    • Pattern: /^[0-9a-f]{40}$/
  • scopes
    • アクセストークンに許された操作の一覧
    • Type: array
  • token
    • アクセストークンを表現する文字列
    • Example: "ea5d0a593b2655e9568f144fb1826342292f5c6b7d406fda00577b8d1530d8a5"
    • Type: string
    • Pattern: /^[0-9a-f]{40}$/

POST /api/v2/access_tokens

与えられた認証情報をもとに新しいアクセストークンを発行します。

  • client_id
    • 登録されたAPIクライアントを特定するためのID
    • Example: "a91f0396a0968ff593eafdd194e3d17d32c41b1da7b25e873b42e9058058cd9d"
    • Type: string
    • Pattern: /^[0-9a-f]{40}$/
  • client_secret
    • 登録されたAPIクライアントを認証するための秘密鍵
    • Example: "01fc259c31fe39e72c8ef911c3432a33d51e9337ff34c4fac86c491a0d37251f"
    • Type: string
    • Pattern: /^[0-9a-f]{40}$/
  • code
    • リダイレクト用のURLに付与された、アクセストークンと交換するための文字列
    • Example: "fefef5f067171f247fb415e38cb0631797b82f4141dcdee66db846c3ade57a03"
    • Type: string
    • Pattern: /^[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

指定されたアクセストークンを失効させ、それ以降利用できないようにします。

DELETE /api/v2/access_tokens/:access_token HTTP/1.1
Host: api.example.com
HTTP/1.1 204

グループ

Qiita Teamのグループを表します。

  • created_at
    • データが作成された日時
    • Example: "2000-01-01T00:00:00+00:00"
    • Type: string
    • Format: date-time
  • id
    • グループの一意なIDを表します。
    • Example: 1
    • Type: integer
  • name
    • グループに付けられた表示用の名前を表します。
    • Example: "Dev"
    • Type: string
  • private
    • 非公開グループかどうかを表します。
    • Example: false
    • Type: boolean
  • updated_at
    • データが最後に更新された日時
    • Example: "2000-01-01T00:00:00+00:00"
    • Type: string
    • Format: date-time
  • url_name
    • グループのチーム上での一意な名前を表します。
    • Example: "dev"
    • Type: string

コメント

記事やプロジェクトに付けられたコメントを表します。プロジェクトへのコメントはQiita Teamでのみ有効です。

  • body
    • コメントの内容を表すMarkdown形式の文字列
    • Example: "# Example"
    • Type: string
  • created_at
    • データが作成された日時
    • Example: "2000-01-01T00:00:00+00:00"
    • Type: string
    • Format: date-time
  • id
    • コメントの一意なID
    • Example: "3391f50c35f953abfc4f"
    • Type: string
    • Pattern: /^[0-9a-f]{20}$/
  • rendered_body
    • コメントの内容を表すHTML形式の文字列
    • Example: "<h1>Example</h1>"
    • Type: string
  • updated_at
    • データが最後に更新された日時
    • Example: "2000-01-01T00:00:00+00:00"
    • Type: string
    • Format: date-time
  • user
    • Qiita上のユーザを表します。

DELETE /api/v2/comments/:comment_id

コメントを削除します。

DELETE /api/v2/comments/:comment_id HTTP/1.1
Host: api.example.com
HTTP/1.1 204

GET /api/v2/comments/:comment_id

コメントを取得します。

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"
  }
}

PATCH /api/v2/comments/:comment_id

コメントを更新します。

  • body
    • コメントの内容を表すMarkdown形式の文字列
    • Example: "# Example"
    • Type: string
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

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

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

投稿に付けられたコメント一覧を投稿日時の降順で取得します。

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"
    }
  }
]

POST /api/v2/items/:item_id/comments

記事に対してコメントを投稿します。

  • body
    • コメントの内容を表すMarkdown形式の文字列
    • Example: "# Example"
    • Type: string
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"
  }
}

POST /api/v2/items/:item_id/imported_comments

ユーザー名を指定して記事に対するコメントを作成します。(Qiita Teamでのみ有効。管理者権限が必要。)

  • body
    • コメントの内容を表すMarkdown形式の文字列
    • Example: "# Example"
    • Type: string
  • user_id
    • ユーザID
    • Example: "yaotti"
    • Type: string
  • created_at
    • データが作成された日時
    • Example: "2000-01-01T00:00:00+00:00"
    • Type: string
    • Format: date-time
  • updated_at
    • データが最後に更新された日時
    • Example: "2000-01-01T00:00:00+00:00"
    • Type: string
    • Format: date-time
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

プロジェクトに付けられたコメント一覧を投稿日時の降順で取得します。

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"
    }
  }
]

POST /api/v2/projects/:project_id/comments

プロジェクトに対してコメントを投稿します。

  • body
    • コメントの内容を表すMarkdown形式の文字列
    • Example: "# Example"
    • Type: string
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"
  }
}

POST /api/v2/projects/:project_id/imported_comments

ユーザー名を指定してプロジェクトに対するコメントを作成します。(Qiita Teamでのみ有効。管理者権限が必要。)

  • body
    • コメントの内容を表すMarkdown形式の文字列
    • Example: "# Example"
    • Type: string
  • user_id
    • ユーザID
    • Example: "yaotti"
    • Type: string
  • created_at
    • データが作成された日時
    • Example: "2000-01-01T00:00:00+00:00"
    • Type: string
    • Format: date-time
  • updated_at
    • データが最後に更新された日時
    • Example: "2000-01-01T00:00:00+00:00"
    • Type: string
    • Format: date-time
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"
  }
}

タギング

記事とタグとの関連を表します。

  • name
    • タグを特定するための一意な名前
    • Example: "qiita"
    • Type: string
  • versions
    • Example: ["0.0.1"]
    • Type: array

POST /api/v2/items/:item_id/taggings

記事にタグを追加します。Qiita Teamでのみ有効です。

  • name
    • タグを特定するための一意な名前
    • Example: "qiita"
    • Type: string
  • versions
    • Example: ["0.0.1"]
    • Type: array
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"
  ]
}

DELETE /api/v2/items/:item_id/taggings/:tagging_id

記事から指定されたタグを取り除きます。Qiita Teamでのみ有効です。

DELETE /api/v2/items/:item_id/taggings/:tagging_id HTTP/1.1
Host: api.example.com
HTTP/1.1 204

タグ

記事に付けられた個々のタグを表します。

  • followers_count
    • このタグをフォローしているユーザの数
    • Example: 100
    • Type: integer
  • icon_url
    • このタグに設定されたアイコン画像のURL
    • Example: "https://s3-ap-northeast-1.amazonaws.com/qiita-tag-image/9de6a11d330f5694820082438f88ccf4a1b289b2/medium.jpg"
    • Type: null, string
  • id
    • タグを特定するための一意な名前
    • Example: "qiita"
    • Type: string
  • items_count
    • このタグが付けられた記事の数
    • Example: 200
    • Type: integer

GET /api/v2/tags

タグ一覧を作成日時の降順で返します。

  • page
    • ページ番号 (1から100まで)
    • Example: 1
    • Type: string
    • Pattern: /^[0-9]+$/
  • per_page
    • 1ページあたりに含まれる要素数 (1から100まで)
    • Example: 20
    • Type: string
    • Pattern: /^[0-9]+$/
  • sort
    • 並び順 (countで記事数順、nameで名前順)
    • Example: "count"
    • Type: string
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

タグを取得します。

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
}

GET /api/v2/users/:user_id/following_tags

ユーザがフォローしているタグ一覧をフォロー日時の降順で返します。

  • page
    • ページ番号 (1から100まで)
    • Example: 1
    • Type: string
    • Pattern: /^[0-9]+$/
  • per_page
    • 1ページあたりに含まれる要素数 (1から100まで)
    • Example: 20
    • Type: string
    • Pattern: /^[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

タグのフォローを外します。

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

タグをフォローしているかどうかを調べます。

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

タグをフォローします。

PUT /api/v2/tags/:tag_id/following HTTP/1.1
Host: api.example.com
HTTP/1.1 204

チーム

Qiita Team上で所属しているチームを表します。Qiita Teamでのみ有効です。

  • active
    • チームが利用可能な状態かどうか
    • Example: true
    • Type: boolean
  • id
    • チームの一意なID
    • Example: "increments"
    • Type: string
  • name
    • チームに設定されている名前を表します。
    • Example: "Increments Inc."
    • Type: string

GET /api/v2/teams

ユーザが所属している全てのチームを、チーム作成日時の降順で返します。

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でのみ有効。管理者権限が必要。)。

DELETE api/v2/remove_team_member/:user_id

指定のユーザーをチームから離脱させます。自身とチームのオーナーはこのAPIでは離脱させられません。

DELETE api/v2/remove_team_member/:user_id HTTP/1.1
Host: api.example.com
HTTP/1.1 204

テンプレート

記事のひな形に利用できるテンプレートを表します。Qiita Teamでのみ有効です。

  • body
    • テンプレートの本文
    • Example: "Weekly MTG on %{Year}/%{month}/%{day}"
    • Type: string
  • id
    • テンプレートの一意なID
    • Example: 1
    • Type: integer
  • name
    • テンプレートを判別するための名前
    • Example: "Weekly MTG"
    • Type: string
  • expanded_body
    • 変数を展開した状態の本文
    • Example: "Weekly MTG on 2000/01/01"
    • Type: string
  • expanded_tags
    • 変数を展開した状態のタグ一覧
    • Example: [{"name"=>"MTG/2000/01/01", "versions"=>["0.0.1"]}]
    • Type: array
  • expanded_title
    • 変数を展開した状態のタイトル
    • Example: "Weekly MTG on 2015/06/03"
    • Type: string
  • tags
    • タグ一覧
    • Example: [{"name"=>"MTG/%{Year}/%{month}/%{day}", "versions"=>["0.0.1"]}]
    • Type: array
  • title
    • 生成される記事のタイトルの雛形
    • Example: "Weekly MTG on %{Year}/%{month}/%{day}"
    • Type: string

GET /api/v2/templates

チーム内のテンプレート一覧を返します。

  • page
    • ページ番号 (1から100まで)
    • Example: 1
    • Type: string
    • Pattern: /^[0-9]+$/
  • per_page
    • 1ページあたりに含まれる要素数 (1から100まで)
    • Example: 20
    • Type: string
    • Pattern: /^[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

テンプレートを削除します。

DELETE /api/v2/templates/:template_id HTTP/1.1
Host: api.example.com
HTTP/1.1 204

GET /api/v2/templates/:template_id

テンプレートを取得します。

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}"
}

POST /api/v2/templates

新しくテンプレートを作成します。

  • body
    • テンプレートの本文
    • Example: "Weekly MTG on %{Year}/%{month}/%{day}"
    • Type: string
  • name
    • テンプレートを判別するための名前
    • Example: "Weekly MTG"
    • Type: string
  • tags
    • タグ一覧
    • Example: [{"name"=>"MTG/%{Year}/%{month}/%{day}", "versions"=>["0.0.1"]}]
    • Type: array
  • title
    • 生成される記事のタイトルの雛形
    • Example: "Weekly MTG on %{Year}/%{month}/%{day}"
    • Type: string
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}"
}

PATCH /api/v2/templates/:template_id

テンプレートを更新します。

  • body
    • テンプレートの本文
    • Example: "Weekly MTG on %{Year}/%{month}/%{day}"
    • Type: string
  • name
    • テンプレートを判別するための名前
    • Example: "Weekly MTG"
    • Type: string
  • tags
    • タグ一覧
    • Example: [{"name"=>"MTG/%{Year}/%{month}/%{day}", "versions"=>["0.0.1"]}]
    • Type: array
  • title
    • 生成される記事のタイトルの雛形
    • Example: "Weekly MTG on %{Year}/%{month}/%{day}"
    • Type: string
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でのみ有効です。

  • rendered_body
    • HTML形式の本文
    • Example: "<h1>Example</h1>"
    • Type: string
  • archived
    • このプロジェクトが進行中かどうか
    • Example: false
    • Type: boolean
  • body
    • Markdown形式の本文
    • Example: "# Example"
    • Type: string
  • created_at
    • データが作成された日時
    • Example: "2000-01-01T00:00:00+00:00"
    • Type: string
    • Format: date-time
  • id
    • プロジェクトのチーム上での一意なID
    • Example: 1
    • Type: integer
  • name
    • プロジェクト名
    • Example: "Kobiro Project"
    • Type: string
  • reactions_count
    • 絵文字リアクション数
    • Example: 100
    • Type: integer
  • updated_at
    • データが最後に更新された日時
    • Example: "2000-01-01T00:00:00+00:00"
    • Type: string
    • Format: date-time

GET /api/v2/projects

チーム内に存在するプロジェクト一覧をプロジェクト作成日時の降順で返します。

  • page
    • ページ番号 (1から100まで)
    • Example: 1
    • Type: string
    • Pattern: /^[0-9]+$/
  • per_page
    • 1ページあたりに含まれる要素数 (1から100まで)
    • Example: 20
    • Type: string
    • Pattern: /^[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"
  }
]

POST /api/v2/projects

プロジェクトを新たに作成します。

  • archived
    • このプロジェクトが進行中かどうか
    • Example: false
    • Type: boolean
  • body
    • Markdown形式の本文
    • Example: "# Example"
    • Type: string
  • name
    • プロジェクト名
    • Example: "Kobiro Project"
    • Type: string
  • tags
    • 記事に付いたタグ一覧
    • Example: [{"name"=>"Ruby", "versions"=>["0.0.1"]}]
    • Type: array
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

プロジェクトを削除します。

DELETE /api/v2/projects/:project_id HTTP/1.1
Host: api.example.com
HTTP/1.1 204

GET /api/v2/projects/:project_id

プロジェクトを返します。

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"
}

PATCH /api/v2/projects/:project_id

プロジェクトを更新します。

  • archived
    • このプロジェクトが進行中かどうか
    • Example: false
    • Type: boolean
  • body
    • Markdown形式の本文
    • Example: "# Example"
    • Type: string
  • name
    • プロジェクト名
    • Example: "Kobiro Project"
    • Type: string
  • tags
    • 記事に付いたタグ一覧
    • Example: [{"name"=>"Ruby", "versions"=>["0.0.1"]}]
    • Type: array
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"
}

POST /api/v2/imported_projects

ユーザー名を指定してプロジェクトを新たに作成します。

  • archived
    • このプロジェクトが進行中かどうか
    • Example: false
    • Type: boolean
  • body
    • Markdown形式の本文
    • Example: "# Example"
    • Type: string
  • name
    • プロジェクト名
    • Example: "Kobiro Project"
    • Type: string
  • tags
    • 記事に付いたタグ一覧
    • Example: [{"name"=>"Ruby", "versions"=>["0.0.1"]}]
    • Type: array
  • user_id
    • ユーザID
    • Example: "yaotti"
    • Type: string
  • created_at
    • データが作成された日時
    • Example: "2000-01-01T00:00:00+00:00"
    • Type: string
    • Format: date-time
  • updated_at
    • データが最後に更新された日時
    • Example: "2000-01-01T00:00:00+00:00"
    • Type: string
    • Format: date-time
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上のユーザを表します。

  • description
    • 自己紹介文
    • Example: "Hello, world."
    • Type: null, string
  • facebook_id
    • Facebook ID
    • Example: "yaotti"
    • Type: null, string
  • followees_count
    • このユーザがフォローしているユーザの数
    • Example: 100
    • Type: integer
  • followers_count
    • このユーザをフォローしているユーザの数
    • Example: 200
    • Type: integer
  • github_login_name
    • GitHub ID
    • Example: "yaotti"
    • Type: null, string
  • id
    • ユーザID
    • Example: "yaotti"
    • Type: string
  • items_count
    • このユーザが qiita.com 上で公開している記事の数 (Qiita Teamでの記事数は含まれません)
    • Example: 300
    • Type: integer
  • linkedin_id
    • LinkedIn ID
    • Example: "yaotti"
    • Type: null, string
  • location
    • 居住地
    • Example: "Tokyo, Japan"
    • Type: null, string
  • name
    • 設定している名前
    • Example: "Hiroshige Umino"
    • Type: null, string
  • organization
    • 所属している組織
    • Example: "Increments Inc"
    • Type: null, string
  • permanent_id
    • ユーザごとに割り当てられる整数のID
    • Example: 1
    • Type: integer
  • profile_image_url
    • 設定しているプロフィール画像のURL
    • Example: "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg"
    • Type: string
  • team_only
    • Qiita Team専用モードに設定されているかどうか
    • Example: false
    • Type: boolean
  • twitter_screen_name
    • Twitterのスクリーンネーム
    • Example: "yaotti"
    • Type: null, string
  • website_url
    • 設定しているWebサイトのURL
    • Example: "http://yaotti.hatenablog.com"
    • Type: null, string

GET /api/v2/items/:item_id/stockers

記事をストックしているユーザ一覧を、ストックした日時の降順で返します。

  • page
    • ページ番号 (1から100まで)
    • Example: 1
    • Type: string
    • Pattern: /^[0-9]+$/
  • per_page
    • 1ページあたりに含まれる要素数 (1から100まで)
    • Example: 20
    • Type: string
    • Pattern: /^[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"
  }
]

GET /api/v2/users

全てのユーザの一覧を作成日時の降順で取得します。

  • page
    • ページ番号 (1から100まで)
    • Example: 1
    • Type: string
    • Pattern: /^[0-9]+$/
  • per_page
    • 1ページあたりに含まれる要素数 (1から100まで)
    • Example: 20
    • Type: string
    • Pattern: /^[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

ユーザを取得します。

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"
}

GET /api/v2/users/:user_id/followees

ユーザがフォローしているユーザ一覧を取得します。

  • page
    • ページ番号 (1から100まで)
    • Example: 1
    • Type: string
    • Pattern: /^[0-9]+$/
  • per_page
    • 1ページあたりに含まれる要素数 (1から100まで)
    • Example: 20
    • Type: string
    • Pattern: /^[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"
  }
]

GET /api/v2/users/:user_id/followers

ユーザをフォローしているユーザ一覧を取得します。

  • page
    • ページ番号 (1から100まで)
    • Example: 1
    • Type: string
    • Pattern: /^[0-9]+$/
  • per_page
    • 1ページあたりに含まれる要素数 (1から100まで)
    • Example: 20
    • Type: string
    • Pattern: /^[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

ユーザへのフォローを外します。

DELETE /api/v2/users/:user_id/following HTTP/1.1
Host: api.example.com
HTTP/1.1 204

GET /api/v2/users/:user_id/following

ユーザをフォローしている場合に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

ユーザをフォローします。

PUT /api/v2/users/:user_id/following HTTP/1.1
Host: api.example.com
HTTP/1.1 204

展開済みテンプレート

テンプレートを保存する前に変数展開後の状態をプレビューできます。Qiita Teamでのみ有効です。

  • expanded_body
    • 変数を展開した状態の本文
    • Example: "Weekly MTG on 2000/01/01"
    • Type: string
  • expanded_tags
    • 変数を展開した状態のタグ一覧
    • Example: [{"name"=>"MTG/2000/01/01", "versions"=>["0.0.1"]}]
    • Type: array
  • expanded_title
    • 変数を展開した状態のタイトル
    • Example: "Weekly MTG on 2015/06/03"
    • Type: string

POST /api/v2/expanded_templates

受け取ったテンプレート用文字列の変数を展開して返します。

  • body
    • テンプレートの本文
    • Example: "Weekly MTG on %{Year}/%{month}/%{day}"
    • Type: string
  • tags
    • タグ一覧
    • Example: [{"name"=>"MTG/%{Year}/%{month}/%{day}", "versions"=>["0.0.1"]}]
    • Type: array
  • title
    • 生成される記事のタイトルの雛形
    • Example: "Weekly MTG on %{Year}/%{month}/%{day}"
    • Type: string
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"
}

投稿

ユーザからの投稿を表します。

  • rendered_body
    • HTML形式の本文
    • Example: "<h1>Example</h1>"
    • Type: string
  • body
    • Markdown形式の本文
    • Example: "# Example"
    • Type: string
  • coediting
    • この記事が共同更新状態かどうか (Qiita Teamでのみ有効)
    • Example: false
    • Type: boolean
  • comments_count
    • この記事へのコメントの数
    • Example: 100
    • Type: integer
  • created_at
    • データが作成された日時
    • Example: "2000-01-01T00:00:00+00:00"
    • Type: string
    • Format: date-time
  • group
    • Qiita Teamのグループを表します。
  • id
    • 記事の一意なID
    • Example: "4bd431809afb1bb99e4f"
    • Type: string
    • Pattern: /^[0-9a-f]{20}$/
  • likes_count
    • この記事への「いいね!」の数(Qiitaでのみ有効)
    • Example: 100
    • Type: integer
  • private
    • 限定共有状態かどうかを表すフラグ (Qiita Teamでは無効)
    • Example: false
    • Type: boolean
  • reactions_count
    • 絵文字リアクションの数(Qiita Teamでのみ有効)
    • Example: 100
    • Type: integer
  • tags
    • 記事に付いたタグ一覧
    • Example: [{"name"=>"Ruby", "versions"=>["0.0.1"]}]
    • Type: array
  • title
    • 記事のタイトル
    • Example: "Example title"
    • Type: string
  • updated_at
    • データが最後に更新された日時
    • Example: "2000-01-01T00:00:00+00:00"
    • Type: string
    • Format: date-time
  • url
    • 記事のURL
    • Example: "https://qiita.com/yaotti/items/4bd431809afb1bb99e4f"
    • Type: string
  • user
    • Qiita上のユーザを表します。
  • page_views_count
    • 閲覧数
    • Example: 100
    • Type: null, integer

GET /api/v2/authenticated_user/items

認証中のユーザの記事の一覧を作成日時の降順で返します。

  • page
    • ページ番号 (1から100まで)
    • Example: 1
    • Type: string
    • Pattern: /^[0-9]+$/
  • per_page
    • 1ページあたりに含まれる要素数 (1から100まで)
    • Example: 20
    • Type: string
    • Pattern: /^[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
  }
]

GET /api/v2/items

記事の一覧を作成日時の降順で返します。

  • page
    • ページ番号 (1から100まで)
    • Example: 1
    • Type: string
    • Pattern: /^[0-9]+$/
  • per_page
    • 1ページあたりに含まれる要素数 (1から100まで)
    • Example: 20
    • Type: string
    • Pattern: /^[0-9]+$/
  • query
    • 検索クエリ
    • Example: "qiita user:yaotti"
    • Type: string
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
  }
]

POST /api/v2/items

新たに記事を作成します。

  • body
    • Markdown形式の本文
    • Example: "# Example"
    • Type: string
  • coediting
    • この記事が共同更新状態かどうか (Qiita Teamでのみ有効)
    • Example: false
    • Type: boolean
  • group_url_name
    • この投稿を公開するグループの url_name (null で全体に公開。Qiita Teamでのみ有効)
    • Example: "dev"
    • Type: null, string
  • private
    • 限定共有状態かどうかを表すフラグ (Qiita Teamでは無効)
    • Example: false
    • Type: boolean
  • tags
    • 記事に付いたタグ一覧
    • Example: [{"name"=>"Ruby", "versions"=>["0.0.1"]}]
    • Type: array
  • title
    • 記事のタイトル
    • Example: "Example title"
    • Type: string
  • tweet
    • Twitterに投稿するかどうか (Twitter連携を有効化している場合のみ有効)
    • Example: false
    • Type: boolean
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

記事を削除します。

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

記事を取得します。

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
}

PATCH /api/v2/items/:item_id

記事を更新します。

  • body
    • Markdown形式の本文
    • Example: "# Example"
    • Type: string
  • coediting
    • この記事が共同更新状態かどうか (Qiita Teamでのみ有効)
    • Example: false
    • Type: boolean
  • group_url_name
    • この投稿を公開するグループの url_name (null で全体に公開。Qiita Teamでのみ有効)
    • Example: "dev"
    • Type: null, string
  • private
    • 限定共有状態かどうかを表すフラグ (Qiita Teamでは無効)
    • Example: false
    • Type: boolean
  • tags
    • 記事に付いたタグ一覧
    • Example: [{"name"=>"Ruby", "versions"=>["0.0.1"]}]
    • Type: array
  • title
    • 記事のタイトル
    • Example: "Example title"
    • Type: string
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
}

POST /api/v2/imported_items

ユーザー名、日時を指定して記事を作成します。(Qiita Teamでのみ有効。管理者権限が必要。)

  • body
    • Markdown形式の本文
    • Example: "# Example"
    • Type: string
  • coediting
    • この記事が共同更新状態かどうか (Qiita Teamでのみ有効)
    • Example: false
    • Type: boolean
  • group_url_name
    • この投稿を公開するグループの url_name (null で全体に公開。Qiita Teamでのみ有効)
    • Example: "dev"
    • Type: null, string
  • tags
    • 記事に付いたタグ一覧
    • Example: [{"name"=>"Ruby", "versions"=>["0.0.1"]}]
    • Type: array
  • title
    • 記事のタイトル
    • Example: "Example title"
    • Type: string
  • user_id
    • ユーザID
    • Example: "yaotti"
    • Type: string
  • created_at
    • データが作成された日時
    • Example: "2000-01-01T00:00:00+00:00"
    • Type: string
    • Format: date-time
  • updated_at
    • データが最後に更新された日時
    • Example: "2000-01-01T00:00:00+00:00"
    • Type: string
    • Format: date-time
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
}

DELETE /api/v2/items/:item_id/like

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

PUT /api/v2/items/:item_id/like

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

記事をストックします。

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

記事をストックから取り除きます。

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

記事をストックしているかどうかを調べます。

GET /api/v2/items/:item_id/stock HTTP/1.1
Host: api.example.com
HTTP/1.1 204

GET /api/v2/items/:item_id/like

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

記事をストックします。

PUT /api/v2/items/:item_id/stock HTTP/1.1
Host: api.example.com
HTTP/1.1 204

GET /api/v2/tags/:tag_id/items

指定されたタグが付けられた記事一覧を、タグを付けた日時の降順で返します。

  • page
    • ページ番号 (1から100まで)
    • Example: 1
    • Type: string
    • Pattern: /^[0-9]+$/
  • per_page
    • 1ページあたりに含まれる要素数 (1から100まで)
    • Example: 20
    • Type: string
    • Pattern: /^[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
  }
]

GET /api/v2/users/:user_id/items

指定されたユーザの記事一覧を、作成日時の降順で返します。

  • page
    • ページ番号 (1から100まで)
    • Example: 1
    • Type: string
    • Pattern: /^[0-9]+$/
  • per_page
    • 1ページあたりに含まれる要素数 (1から100まで)
    • Example: 20
    • Type: string
    • Pattern: /^[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
  }
]

GET /api/v2/users/:user_id/stocks

指定されたユーザがストックした記事一覧を、ストックした日時の降順で返します。

  • page
    • ページ番号 (1から100まで)
    • Example: 1
    • Type: string
    • Pattern: /^[0-9]+$/
  • per_page
    • 1ページあたりに含まれる要素数 (1から100まで)
    • Example: 20
    • Type: string
    • Pattern: /^[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でのみ有効。管理者権限が必要。)

  • email
    • 招待中のメンバーのemailアドレスです。
    • Example: "example@example.com"
    • Type: string
  • url
    • 招待用URLです。有効期限は1日です。
    • Example: "https://team-name.qiita.com/registration/confirm?id=3&token=456c84ae60070161a36c08c9e710050abe5852cc"
    • Type: string

GET api/v2/team_invitations

招待中のメンバーの一覧を返します

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

チームにメンバーを招待します

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

招待を取り消します

DELETE api/v2/team_invitations/:email HTTP/1.1
Host: api.example.com
HTTP/1.1 204

絵文字リアクション

Qiita Team上での絵文字リアクションを表します。Qiita Teamでのみ有効です。

  • created_at
    • データが作成された日時
    • Example: "2000-01-01T00:00:00+00:00"
    • Type: string
    • Format: date-time
  • image_url
    • 絵文字画像のURL
    • Example: "https://cdn.qiita.com/emoji/twemoji/unicode/1f44d.png"
    • Type: string
  • name
    • 絵文字の識別子
    • Example: "+1"
    • Type: string
  • user
    • Qiita上のユーザを表します。

POST /api/v2/comments/:comment_id/reactions

コメントに絵文字リアクションを付けます。

  • name
    • 絵文字の識別子
    • Example: "+1"
    • Type: string
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"
  }
}

POST /api/v2/items/:item_id/reactions

記事に絵文字リアクションを付けます。

  • name
    • 絵文字の識別子
    • Example: "+1"
    • Type: string
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"
  }
}

POST /api/v2/projects/:project_id/reactions

プロジェクトに絵文字リアクションを付けます。

  • name
    • 絵文字の識別子
    • Example: "+1"
    • Type: string
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

コメントから絵文字リアクションを削除します。

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

記事から絵文字リアクションを削除します。

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

プロジェクトから絵文字リアクションを削除します。

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

コメントに付けられた絵文字リアクション一覧を作成日時の降順で返します。

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

記事に付けられた絵文字リアクション一覧を作成日時の降順で返します。

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

プロジェクトに付けられた絵文字リアクション一覧を作成日時の降順で返します。

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"
    }
  }
]

認証中のユーザ

現在のアクセストークンで認証中のユーザを表します。通常のユーザ情報よりも詳細な情報を含んでいます。

  • description
    • 自己紹介文
    • Example: "Hello, world."
    • Type: null, string
  • facebook_id
    • Facebook ID
    • Example: "yaotti"
    • Type: null, string
  • followees_count
    • このユーザがフォローしているユーザの数
    • Example: 100
    • Type: integer
  • followers_count
    • このユーザをフォローしているユーザの数
    • Example: 200
    • Type: integer
  • github_login_name
    • GitHub ID
    • Example: "yaotti"
    • Type: null, string
  • id
    • ユーザID
    • Example: "yaotti"
    • Type: string
  • items_count
    • このユーザが qiita.com 上で公開している記事の数 (Qiita Teamでの記事数は含まれません)
    • Example: 300
    • Type: integer
  • linkedin_id
    • LinkedIn ID
    • Example: "yaotti"
    • Type: null, string
  • location
    • 居住地
    • Example: "Tokyo, Japan"
    • Type: null, string
  • name
    • 設定している名前
    • Example: "Hiroshige Umino"
    • Type: null, string
  • organization
    • 所属している組織
    • Example: "Increments Inc"
    • Type: null, string
  • permanent_id
    • ユーザごとに割り当てられる整数のID
    • Example: 1
    • Type: integer
  • profile_image_url
    • 設定しているプロフィール画像のURL
    • Example: "https://si0.twimg.com/profile_images/2309761038/1ijg13pfs0dg84sk2y0h_normal.jpeg"
    • Type: string
  • team_only
    • Qiita Team専用モードに設定されているかどうか
    • Example: false
    • Type: boolean
  • twitter_screen_name
    • Twitterのスクリーンネーム
    • Example: "yaotti"
    • Type: null, string
  • website_url
    • 設定しているWebサイトのURL
    • Example: "http://yaotti.hatenablog.com"
    • Type: null, string
  • image_monthly_upload_limit
    • 1ヶ月あたりにQiitaにアップロードできる画像の総容量
    • Example: 1048576
    • Type: integer
  • image_monthly_upload_remaining
    • その月にQiitaにアップロードできる画像の残りの容量
    • Example: 524288
    • Type: integer

GET /api/v2/authenticated_user

アクセストークンに紐付いたユーザを返します。

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
}