---
title: "REST APIエンドポイント | Tajo"
description: "REST APIエンドポイントのドキュメント"
url: https://tajo.io/jp/docs/endpoints/rest-api/
markdown: https://tajo.io/jp/docs/endpoints/rest-api.md
lang: ja-JP
author: "Set Noa"
author_url: https://tajo.io/jp/set-noa/
robots: noindex
---

先行利用を申し込む

お名前と会社のメールアドレスを入力してください。Tajoへのアクセス申請を確認するためのリンクをメールでお送りします。

# REST APIエンドポイント

[Set Noa](https://tajo.io/jp/set-noa/)

Caution

**デモページ** - これはマルチタブドキュメント機能を紹介するデモページです。このコンテンツは説明目的のみです。

REST APIは、データにアクセスおよび操作するためのエンドポイントを提供します。すべてのエンドポイントはJSON形式でデータを返します。

## ベースURL

すべてのAPIリクエストは以下のベースURLに対して行う必要があります:

```
https://api.example.com/v1
```

## ユーザーエンドポイント

### すべてのユーザーを取得

```http
GET /users
```

すべてのユーザーのリストを返します。ページネーションパラメータをサポートしています。

**クエリパラメータ:**

| パラメータ | 型 | 説明 |
| --- | --- | --- |
| page | integer | ページ番号（デフォルト: 1） |
| limit | integer | ページあたりのレコード数（デフォルト: 50、最大: 100） |
| sort | string | ソートするフィールド（例: “name”、“created\_at”） |

**レスポンス:**

```json
{
  "data": [
    {
      "id": "user_123",
      "name": "John Doe",
      "email": "john@example.com",
      "created_at": "2023-01-15T08:30:00Z"
    },
    // More users...
  ],
  "meta": {
    "total": 250,
    "page": 1,
    "limit": 50
  }
}
```

### IDでユーザーを取得

```http
GET /users/{id}
```

IDで単一のユーザーを返します。

**レスポンス:**

```json
{
  "data": {
    "id": "user_123",
    "name": "John Doe",
    "email": "john@example.com",
    "created_at": "2023-01-15T08:30:00Z",
    "profile": {
      "bio": "Software developer",
      "location": "New York",
      "avatar_url": "https://example.com/avatars/john.jpg"
    }
  }
}
```

## 製品エンドポイント

### すべての製品を取得

```http
GET /products
```

すべての製品のリストを返します。フィルタリングとページネーションをサポートしています。

**クエリパラメータ:**

| パラメータ | 型 | 説明 |
| --- | --- | --- |
| category | string | カテゴリでフィルタ |
| min\_price | number | 最低価格でフィルタ |
| max\_price | number | 最高価格でフィルタ |
| page | integer | ページ番号（デフォルト: 1） |
| limit | integer | ページあたりのレコード数（デフォルト: 50、最大: 100） |

**レスポンス:**

```json
{
  "data": [
    {
      "id": "prod_123",
      "name": "Example Product",
      "description": "This is an example product",
      "price": 49.99,
      "category": "electronics"
    },
    // More products...
  ],
  "meta": {
    "total": 350,
    "page": 1,
    "limit": 50
  }
}
```

## エラー処理

すべてのエンドポイントは標準のHTTPステータスコードに従い、適切な場合には詳細なエラーメッセージを含みます:

| ステータスコード | 説明 |
| --- | --- |
| 200 | OK - リクエスト成功 |
| 400 | Bad Request - 無効なパラメータ |
| 401 | Unauthorized - 認証が必要 |
| 403 | Forbidden - 権限不足 |
| 404 | Not Found - リソースが存在しません |
| 429 | Too Many Requests - レート制限を超過 |
| 500 | Internal Server Error - サーバーエラーが発生 |

エラーレスポンスには、何が問題だったかを説明するメッセージが含まれます:

```json
{
  "error": {
    "code": "invalid_parameter",
    "message": "The parameter 'email' is not a valid email address",
    "request_id": "req_abc123"
  }
}
```
