> For the complete documentation index, see [llms.txt](https://api.esignon.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api.esignon.net/jp-1/issued/token.md).

# 認証トークン発行

## 認証トークン発行

<mark style="color:green;">`POST`</mark> `https://docs.esignon.net/api/:companyId/login`&#x20;

esignon APIを使用する時に必要なユーザーの認証トークン(accesstoken)を発行します。

#### Path Parameters

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| companyId | string | 会社 ID       |

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | string | application/json |

#### Request Body

| Name                 | Type   | Description  |
| -------------------- | ------ | ------------ |
| header               | object |              |
| header.request\_code | string | 1001Q        |
| body                 | object |              |
| body.memb\_email     | string | 使用者 email    |
| body.memb\_pwd       | string | 使用者 password |

{% tabs %}
{% tab title="200 성공" %}

```javascript
{
  "header": {
    "response_code": "1001A",
    "result_code": "00",
    "result_msg": "成功裏にログインされました。",
    "session_id": ""
  },
  "body": {
    "access_token": "{accesstoken}",
    "comp_id": "{会社 ID}",
    "device_id": "{Device ID}",
    "expire_date": "{満了日}",
    "memb_email": "{使用者 email}"
  }
}
```

{% endtab %}
{% endtabs %}

## Request Body Example

```javascript
{
  "header": {
    "request_code": "1001Q",
  },
  "body": {
    "memb_email": "{使用者 email}",
    "memb_pwd": "{使用者 password}",
  }
}
```

## Response Body Example

```javascript
{
  "header": {
    "response_code": "1001A",
    "result_code": "00",
    "result_msg": "成功裏にログインされました。",
    "session_id": ""
  },
  "body": {
    "access_token": "{accesstoken}",
    "comp_id": "{会社 ID}",
    "device_id": "{Device ID}",
    "expire_date": "{満了日}",
    "memb_email": "{使用者 email}"
  }
}
```

## Response Body  header.result\_code

| Code | **Description** | **Reference**                        |
| ---- | --------------- | ------------------------------------ |
| 00   | 成功              | 成功                                   |
| 10   | 失敗              | ログイン情報が正確ではありません。                    |
| 12   | 失敗              | 受信メッセージのBody情報が正しくない形のため、パスできませんでした。 |
| 95   | 失敗              | APIを呼び出せない会社です。 管理者にお問い合わせください。      |
| 99   | 失敗              | Unexpected exception（誤ったフォーマット）      |
