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 | 此账户无法使用 。 |