Skip to main content
Adventure

HappyOyster-Adventure-Get Travel Credential API Reference

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.

POST
/api/v2/apps/happyoyster-1.0-adventure/openapi/v1/worlds/get-travel-credential
cURL - Get travel credential
curl --location 'https://dashscope-intl.aliyuncs.com/api/v2/apps/happyoyster-1.0-adventure/openapi/v1/worlds/get-travel-credential' \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "encryptedWorldId": "{encryptedWorldId}"
}'
{
  "code": 0,
  "message": null,
  "data": {
    "ticket": "tk_a1b2****",
    "expiresIn": 1800,
    "encryptedWorldId": "enc_a1b2****"
  }
}

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:
  • Only the primary API Key is supported; temporary API Keys cannot be used (error code 403003).
  • The World must belong to the current primary account and the Adventure model, and its status must be ready.
  • Called by your server; the resulting ticket should be delivered only to a client that is about to enter the room immediately.
If the model call fails and returns an error, see HappyOyster Error Codes.

Authorizations

string
header
required

QwenCloud API Key. Only the primary API Key (sk- prefix) is supported. See Get an API Key.

Header Parameters

string
default"application/json"
required

Request content type. This parameter must be set to application/json.

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.

Body

application/json
string
required

An Adventure World ID under the current primary account with status ready. Returned by Create World.

Response

200-application/json
integer

Return code. 0 means success; non-zero is an error code.

string

Error message. null on success.

object

Response data. null on failure.

HappyOyster-Adventure-Get Travel Credential API Reference - QwenCloud