---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://docs.sendcorex.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://docs.sendcorex.com/llms.txt"
---

Source: https://docs.sendcorex.com/th/api-reference/receive-emails/identity/whoami

รับอีเมล: ตัวตน

# Whoami

ส่งกลับว่าข้อมูลรับรองนี้เป็นของกล่องจดหมายใด และรายละเอียดของข้อมูลรับรอง โดยไม่อ่านข้อความใด ใช้ตรวจว่าข้อมูลรับรองเป็นของกล่องจดหมายที่ต้องการ

POST `https://g.sendcorex.com/v1` command: whoami

ทุกฟิลด์ใต้ `token` ยกเว้น `type` จะส่งกลับเฉพาะเมื่อข้อมูลรับรองเป็นโทเค็นกล่องจดหมาย (`mailbox_token`) access token ของ OAuth ส่งกลับเฉพาะ `token.type`

## อาร์กิวเมนต์

endpoint นี้ไม่มีอาร์กิวเมนต์

## เริ่มต้นอย่างรวดเร็ว

```
import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1',
  {
    commands: [
      {
        command: "whoami"
      }
    ]
  },
  { headers: { Authorization: process.env.SENDCOREX_TOKEN } },
);

const [result] = response.data.results;
if (result.type !== 'SUCCESS') throw new Error(`${result.code}: ${result.message}`);
console.log(result.data);
```

## การตอบกลับ

```
{
  "type": "SUCCESS",
  "results": [
    {
      "command": "whoami",
      "id": "0",
      "type": "SUCCESS",
      "data": {
        "mailbox": {
          "email": "support@acme.com",
          "from_name": "Acme Support",
          "sender_ref": "snd_7Kq2Xr9P"
        },
        "token": {
          "type": "mailbox_token",
          "id": "mbt_3Fh8LwQ1",
          "name": "Helpdesk bot",
          "prefix": "scx_mb_4f9a",
          "created_at": "2026-10-02T09:14:00.000Z",
          "expires_at": null,
          "last_used_at": "2026-11-19T00:31:12.000Z"
        }
      }
    }
  ]
}
```

### ฟิลด์การตอบกลับ

- `mailbox.email`
ที่อยู่กล่องจดหมายที่ข้อมูลรับรองนี้เป็นของ
- `mailbox.from_name`
ชื่อที่แสดงเมื่อส่งจากกล่องจดหมายนี้
- `mailbox.sender_ref`
การอ้างอิงโปรไฟล์ผู้ส่งของกล่องจดหมายนี้
- `token.type`
`mailbox_token` สำหรับโทเค็นกล่องจดหมาย `oauth` สำหรับ access token ของ OAuth
- `token.id`
ID ของโทเค็น เฉพาะ `mailbox_token`
- `token.name`
ชื่อที่ตั้งให้โทเค็น เฉพาะ `mailbox_token`
- `token.prefix`
อักขระแรกของโทเค็นตามที่แสดงในแดชบอร์ด เฉพาะ `mailbox_token`
- `token.created_at`
เวลาที่สร้างโทเค็น เฉพาะ `mailbox_token`
- `token.expires_at`
เวลาที่โทเค็นหมดอายุ หรือ `null` หากไม่หมดอายุ เฉพาะ `mailbox_token`
- `token.last_used_at`
ครั้งล่าสุดที่ใช้โทเค็น หรือ `null` เฉพาะ `mailbox_token`

## ข้อผิดพลาด

ข้อผิดพลาดระดับ HTTP ส่งกลับ `type`, `code` และ `message` ข้อผิดพลาดที่มีเครื่องหมาย CMD จะกลับมาในผลลัพธ์ของคำสั่ง พร้อม HTTP 200

- 401`TOKEN_EXPIRED`
access token หมดอายุแล้ว เรียก Refresh Token แล้วส่งคำขอซ้ำ
- 401`INVALID_TOKEN`
โทเค็นผิดรูปแบบ ไม่รู้จัก หรือถูกเพิกถอน
- 429`RATE_LIMITED`
เกิน 15 คำขอ/วินาที หรือ 15 คำขอพร้อมกันสำหรับ IP + กล่องจดหมายเดียวกัน รอจำนวนวินาทีใน Retry-After
- CMD`INTERNAL`
ข้อผิดพลาดของเซิร์ฟเวอร์ รายละเอียดเขียนเฉพาะในล็อกเซิร์ฟเวอร์
