身份验证

GET /api/auth/me

GET https://api.iagenify.com/api/auth/me

退回已确认的电话人的公共账户记录

Bearer 或 API 密钥JSONread

HTTP 请求

curl https://api.iagenify.com/api/auth/me \
  -X GET \
  -H "Authorization: Bearer $IAGENIFY_TOKEN"

JavaScript

const response = await fetch("https://api.iagenify.com/api/auth/me", {
  method: "GET",
  headers: { Authorization: `Bearer ${process.env.IAGENIFY_TOKEN}` },
});
const result = await response.json();
if (!response.ok) throw new Error(result.error);

Python

import os, requests

response = requests.request(
    "GET",
    "https://api.iagenify.com/api/auth/me",
    headers={"Authorization": "Bearer " + os.environ["IAGENIFY_TOKEN"]},
    timeout=30,
)
response.raise_for_status()
result = response.json()

成功响应

{ ok: true, user: { id: "…", email: "…", credits: 120 } }

用户对象为账户的公共代表。 将其他字段视为可选字段, 除非有文件证明您要整合 。

错误

代码含义
no_token没有发送支持的授权信头 。
invalid_token无记名牌无效 。
session_expired持牌会议不再活跃。
user_not_found此账户无法使用 。