BioTech Open Platform Docs
Type to search documentation.

Authentication

Authentication and Tokens

Issue, refresh, and revoke tokens, and send an Access Token with business requests.

Credential lifecycle

CredentialPrefixDefault lifetimePurpose
App Keyak_Long-livedIdentifies the application and remains visible in the admin console
App Secretsk_Until resetProves the application identity and is shown only after creation or reset
Access Tokenoat_24 hoursAuthorizes protected API requests
Refresh Tokenort_30 daysRotates both the Access Token and Refresh Token

Resetting the App Secret or disabling the application immediately revokes all active tokens for that application.

Issue tokens

ItemValue
MethodPOST
Request URLhttps://backend.biotech-mkt.com/openapi/auth/token
AuthenticationApp Key + App Secret
PermissionNo endpoint grant required
Content-Typeapplication/json

Response

The HTTP status, duration, and response body appear here after the request is sent.

This endpoint does not require an Access Token. Send a JSON body:

Request body

FieldTypeRequiredConstraint
app_keystringYesMaximum 64 characters
app_secretstringYesMaximum 128 characters

Request example

Terminal window
curl --request POST "https://backend.biotech-mkt.com/openapi/auth/token" \
--header "Content-Type: application/json" \
--data '{"app_key":"ak_xxx","app_secret":"sk_xxx"}'

Response example

json
{
"code": 200,
"message": "Success",
"data": {
"token_type": "Bearer",
"app_id": 1,
"app_key": "ak_xxx",
"access_token": "oat_xxx",
"expires_in": 86400,
"access_expires_at": "2026-08-27 12:00:00",
"refresh_token": "ort_xxx",
"refresh_expires_in": 2592000,
"refresh_expires_at": "2026-09-25 12:00:00"
}
}

Response fields

FieldReturn typeDescription
token_typestringAlways Bearer
app_idintegerInternal OpenAPI application ID
app_keystringApp Key of the current application
access_tokenstringFull Access Token, returned only in this response
expires_inintegerAccess Token lifetime in seconds; default 86400
access_expires_atstringAbsolute Access Token expiration time
refresh_tokenstringFull Refresh Token, returned only in this response
refresh_expires_inintegerRefresh Token lifetime in seconds; default 2592000
refresh_expires_atstringAbsolute Refresh Token expiration time

On success, data contains the token type, application details, both tokens, their lifetimes in seconds, and absolute expiration timestamps. Authentication failures return 401 without revealing whether the App Key or App Secret was incorrect.

Refresh tokens

ItemValue
MethodPOST
Request URLhttps://backend.biotech-mkt.com/openapi/auth/refresh
AuthenticationRefresh Token
PermissionNo endpoint grant required
Content-Typeapplication/json

Response

The HTTP status, duration, and response body appear here after the request is sent.

Request body

FieldTypeRequiredConstraint
refresh_tokenstringYesMaximum 128 characters

Request example

Terminal window
curl --request POST "https://backend.biotech-mkt.com/openapi/auth/refresh" \
--header "Content-Type: application/json" \
--data '{"refresh_token":"ort_xxx"}'

Response example

The response has the same fields as the issue-token endpoint, but both tokens and expiration timestamps are new:

json
{
"code": 200,
"message": "Success",
"data": {
"token_type": "Bearer",
"app_id": 1,
"app_key": "ak_xxx",
"access_token": "oat_new_xxx",
"expires_in": 86400,
"access_expires_at": "2026-08-27 13:00:00",
"refresh_token": "ort_new_xxx",
"refresh_expires_in": 2592000,
"refresh_expires_at": "2026-09-25 13:00:00"
}
}

Refresh uses token rotation. A successful response returns a new Access Token and a new Refresh Token, and both old tokens stop working.

Atomic replacement

Serialize refresh attempts for the same Refresh Token and replace both stored tokens in one transaction or atomic write. Do not let multiple processes refresh the same token concurrently.

Revoke tokens

ItemValue
MethodPOST
Request URLhttps://backend.biotech-mkt.com/openapi/auth/revoke
AuthenticationRefresh Token
PermissionNo endpoint grant required
Content-Typeapplication/json

Response

The HTTP status, duration, and response body appear here after the request is sent.

Request body

FieldTypeRequiredConstraint
refresh_tokenstringYesMaximum 128 characters

Request example

Terminal window
curl --request POST "https://backend.biotech-mkt.com/openapi/auth/revoke" \
--header "Content-Type: application/json" \
--data '{"refresh_token":"ort_xxx"}'

Response example

json
{
"code": 200,
"message": "Success",
"data": []
}

Revocation targets the token record identified by the Refresh Token. Repeating the request, or submitting a Refresh Token that no longer exists, is treated as an idempotent success.

Send an Access Token

Use the standard Bearer header:

http
Authorization: Bearer oat_xxx

Compatible alternative:

http
X-Openapi-Token: oat_xxx

When both headers are present and the Bearer header is validly formatted, the server uses Authorization. Access Tokens are not accepted in URL query parameters.

Authentication response headers

Token endpoints return:

  • Cache-Control: no-store
  • Pragma: no-cache
  • X-Request-Id: <request ID>

A 401 response also includes WWW-Authenticate: Bearer.

Errors and rate limits

Authentication endpoints can return 401, 422, 429, 500, or 503. Deployment settings can override the defaults. See Errors and Rate Limits for limits, Retry-After, and retry guidance.

Security recommendations

  • Store the App Secret and Refresh Token only in a server-side secret manager or encrypted storage.
  • Log only token prefixes or irreversible fingerprints, never full values.
  • Use HTTPS and never transmit credentials over plaintext HTTP.
  • Reset the Secret immediately after a leak; doing so invalidates all existing tokens.

Last updated Aug 27, 2026