---
# System prepended metadata

title: 取得認證Token
tags: [Token]

---

# 機台認證&取得Token

**檢查機台安全碼&註冊一個新的合法Token，使用效期為12小時**


#### 網址
正式：https://api-v2.hillcorp.com/api/auth/check-security-key
測試：https://api-v2-s.hillcorp.com/api/auth/check-security-key

#### Method
`POST`

#### 傳入參數

|欄位名稱|必填|型態|欄位|備註|
| ------------ | :-----------: |:-----------: |------------ |------------ |
|machine_code|Y|string|機器辨別碼|
|security_key|Y|string|安全碼|


#### 回傳參數

|Name|Type|說明|
| ------------ | ------------ |------------ |
|--  |string |token 純字串(非Json) |



#### Json Example
Request Json
```json
{
    "machine_code": "HE1035"
}
```

Response String
```
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9oaWxsY29ycC12ZXIxLmxvY2FsLmNvbVwvYXBpXC9hdXRoXC9nZXQtdG9rZW4iLCJpYXQiOjE1ODg2Njc3NzYsImV4cCI6MTU4ODg4Mzc3NiwibmJmIjoxNTg4NjY3Nzc2LCJqdGkiOiJCZWtja0s3dFBZbE1CZEU3Iiwic3ViIjoyLCJwcnYiOiIyODgyZjdjYzkzNWUwNTAwMDY3YzYwMTQ1MWZhZjljYzUyNTk4YzY2In0.nLxHGZ2q_HLMbGlK-ddqtp-c68GQ-nHTvUmwqHN5Iag
```

Response Json Error
```json
{
    "status": "false",
    "message": "invalid_credentials",
    "errors": "401"
}
```
