A third-party server uses the primary API Key to exchange for a short-lived, single-use ticket, then securely delivers it to the client. This endpoint only validates World ownership, status, and quota; it does not create a Travel.
Scope
A third-party server uses the primary API Key to exchange for a short-lived, single-use ticket, then securely delivers it to the client. Before calling, confirm the following:
-
Authentication: Only the primary API Key is supported; temporary API Keys cannot be used (error code
403003).- Get the primary API Key: Get and configure an API Key.
-
Prerequisites: The World must belong to the current primary account and the Directing model, and its status must be
ready. Confirm via Query World Build Status. -
Caller: Called by your server; the resulting
ticketshould be delivered only to a client that is about to enter the room immediately.
HTTP request
- Singapore
- US (Virginia)
POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v2/apps/happyoyster-1.0-directing/openapi/v1/worlds/get-travel-credentialReplace {WorkspaceId} with your actual Workspace ID.Request parameters |
|
Content-Typestring(Required)Request content type. This parameter must be set to application/json. | |
Authorization string (Required)API Key authentication. Only the primary API Key is supported; it starts with sk-, e.g. sk-xxx. It is typically configured as the environment variable $DASHSCOPE_API_KEY. A temporary API Key (starting with st-) returns 403003. | |
Request Body | |
encryptedWorldId string (Required)A Directing World ID under the current primary account with status ready. Returned by Create World. |
Response parameters |
|
code integerReturn code. 0 means success; non-zero is an error code. | |
message stringError message. null on success. | |
data objectResponse data. null on failure.
Properties ticket stringA single-use Travel credential prefixed with tk_. Valid for 1800 seconds (30 minutes) and can be used successfully only once.expiresIn integerValidity in seconds, fixed at 1800 (30 minutes).encryptedWorldId stringThe encrypted World ID that the credential corresponds to. |
Prerequisite states and call notes
- The World must be
ready. - The
ticketis valid for 30 minutes and can be used successfully only once; obtain a new one after it expires or has been used. - The
ticketshould be delivered only to a client that is about to enter the room immediately, and should not be persisted as a long-term access credential. - Calling this endpoint does not create a Travel; the Travel is created when entering the room succeeds.
- If the quota for this World has not been purchased,
403007is returned; if the capacity configuration is temporarily unavailable,403008is returned.
Error codes
If the model call fails and returns an error, see HappyOyster Error Codes to resolve it.
Next steps
After obtaining the ticket:
- Enter Travel: the client uses the
ticketto create a Travel and obtain the RTC configuration.