跳转到内容

当前用户

返回当前 Key 的归属用户与 Key 信息,适合用来快速验证 Key 是否有效。

GEThttps://geo-api.geoeval.com/v1/me

需在 Authorization 请求头中传入 API Key。 前往下方在线调试

请求示例

curl "https://geo-api.geoeval.com/v1/me" \
-H "Authorization: Bearer $GEOEVAL_API_KEY"

响应 200

  • userobject

    该 Key 所属的用户。

    子字段: user
    • idstring

      用户 ID。

    • emailstring

      账号邮箱。

    • namestring

      显示名称。

    • created_atinteger (ms)

      账号创建时间。

  • api_keyobject

    本次请求使用的 Key。

    子字段: api_key
    • idstring

      Key ID,对应其他接口中的 api_key_id。

    • namestring

      创建 Key 时设置的名称。

    • key_prefixstring

      用于区分不同 Key 的前缀。

    • expires_atinteger (ms) | null

      过期时间;null 表示永不过期。

    • created_atinteger (ms)

      Key 创建时间。

响应示例

{
"user": {
"id": "01a224f1-0b7e-7f10-9a44-2c1d5e8b7a31",
"email": "you@example.com",
"name": "Your Name",
"created_at": 1797000000000
},
"api_key": {
"id": "01a22524-6869-7d2d-bdab-b3a29b49ccc2",
"name": "production",
"key_prefix": "geo_live_8hK2mPq4Xa1Z",
"expires_at": null,
"created_at": 1797000100000
}
}

错误

所有接口还可能返回 400、401、403 或 500,详见错误.