> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.orderupb2b.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.orderupb2b.com/_mcp/server.

# 查詢單一後台使用者

GET https://api.example.com/v1/internal-users/{id}

依 id 查詢單一後台使用者。若該 id 不存在，或屬於其他租戶，一律回傳 404 not_found，兩種情況無法從回應內容區分。

Reference: https://docs.orderupb2b.com/api-reference/internal-users/get-internal-user

## Authentication

- `X-Signature` header (required) — 每個 /v1 請求都必須帶 X-Client-Id、X-Timestamp、X-Nonce 與 X-Signature 四個標頭。X-Signature 是以 client secret 對 canonical string 做 HMAC-SHA256 後的 Base64。canonical string 的組成、可複製的簽章範例與 401 排查步驟，請參閱「驗證與簽章」。

## Request

### Path parameters

- `id` (long, required) — 要查詢的後台使用者序號。不存在或屬於其他租戶時，一律回傳 404 not_found。

## Response

### 200

OK

- `id` (long, optional) — 使用者序號。
- `account` (string, optional, nullable) — 帳號。
- `name` (string, optional, nullable) — 姓名。
- `email` (string, optional, nullable) — 電子郵件。
- `roleId` (long, optional, nullable) — 目前指派的角色序號。清單與單筆查詢回傳的都是實際的角色序號，不會是 null——沒有角色指派的使用者不會出現在查詢結果中。
- `roleName` (string, optional, nullable) — 目前指派的角色名稱，與 roleId 對應。
- `status` (string, optional, nullable) — 帳號狀態，Active（生效）或 Inactive（停用）。
- `outerSysCode` (string, optional, nullable) — ERP 端的使用者代碼。

## Errors

### 401 Unauthorized Error

Unauthorized

- `error` (string, optional, nullable) — 錯誤代碼，固定為 snake_case 字串，依代碼判斷失敗原因。

### 403 Forbidden Error

Forbidden

- `error` (string, optional, nullable) — 錯誤代碼，固定為 snake_case 字串，依代碼判斷失敗原因。

### 404 Not Found Error

Not Found

- `type` (string, optional, nullable) — 錯誤類型的識別 URI，通常可以忽略。
- `title` (string, optional, nullable) — 簡短的錯誤摘要。
- `status` (integer, optional, nullable) — 對應的 HTTP 狀態碼。
- `detail` (string, optional, nullable) — 詳細的錯誤說明文字。
- `instance` (string, optional, nullable) — 發生錯誤的請求路徑。

### 500 Internal Server Error

Internal Server Error

- `code` (string, optional, nullable) — 錯誤代碼字串。
- `message` (string, optional, nullable) — 對應的錯誤說明文字。

## Examples

**Response**

```json
{
  "id": 1,
  "account": "string",
  "name": "string",
  "email": "string",
  "roleId": 1,
  "roleName": "string",
  "status": "string",
  "outerSysCode": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.example.com/v1/internal-users/1"

headers = {"X-Signature": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.example.com/v1/internal-users/1';
const options = {method: 'GET', headers: {'X-Signature': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/v1/internal-users/1"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-Signature", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/internal-users/1")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-Signature"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.example.com/v1/internal-users/1")
  .header("X-Signature", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.example.com/v1/internal-users/1', [
  'headers' => [
    'X-Signature' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.example.com/v1/internal-users/1");
var request = new RestRequest(Method.GET);
request.AddHeader("X-Signature", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-Signature": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/internal-users/1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```