跳到导航

Algolia search credentials

以 Markdown 格式查看

Get Algolia search credentials for querying documentation.

Authentication is optional. Without credentials, the returned key searches only public pages, which is how the search widget calls this endpoint. Pass FERN_TOKEN to search with a logged-in user’s roles, or FERN_API_KEY from a server to also search pages that require login, with roles set by the ROLES header. Don’t send FERN_API_KEY from a browser.

身份验证

FERN_API_KEYstring

Fern API key, from fern token.

OR
FERN_TOKENstring
JWT token for this user.

请求头

ROLESstring可选

Comma-separated list of roles (only with FERN_API_KEY). Sets roles for returned search key if provided, otherwise, roles are empty.

x-fern-hoststring可选

Documentation domain (required on preview URLs)

X-User-Tokenstring可选
Your own identifier for the end user, used to group search analytics by user. Works with or without credentials.

响应

Successfully retrieved search credentials
appIdstring
Algolia application ID
apiKeystring

Short-lived Algolia search API key

roleslist of strings可选

Roles included in the search key (only with FERN_API_KEY auth)

错误

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error