Skip to navigation

Direct Entry URL

Direct Entry URL: Agent Java SDK v0.3.0 integration, examples, parameters and response semantics.

View as Markdown

This guide targets Agent Java SDK v0.3.0, Java 8+, and the tagged public contract. Examples run in a partner backend after initializing client in Quick Start.

Example prerequisites

The Java snippets share these imports. Initialize client using Quick Start and obtain platformUserId from the saved binding. Example user/order IDs must be replaced with your own persisted values.

import com.sixmm.agent.*;
import com.sixmm.agent.model.*;
import java.util.*;

Direct Entry URL

Direct entry URL is for redirect mode. A partner user clicks a button on the partner site, opens 6MM frontend, and is automatically logged in.

import com.sixmm.agent.model.CreateEntryUrlRequest;
import com.sixmm.agent.model.CreateEntryUrlResponse;
CreateEntryUrlResponse resp = client.createEntryUrl(
CreateEntryUrlRequest.of("agent-user-001")
.withRedirectPath("/en/futures/BTCUSDT?tradingMode=real")
.withReturnUrl("https://partner.example.com/return#markets"));
System.out.println(resp.webUrl);
System.out.println(resp.expireAt);

Field rules:

FieldDescription
redirectPath6MM frontend relative path. It must start with /, for example /en/futures/BTCUSDT?tradingMode=real
returnUrlPartner absolute URL used when the user exits 6MM frontend. Only http and https are allowed
expireAtEntry ticket expiration time as a Unix timestamp in seconds

The example opens perpetual futures in real mode. For simulated trading, use tradingMode=demo in the frontend and explicitly pass environment=SIMULATED in the corresponding backend wallet requests. Frontend tradingMode and backend funds environment are configured separately. Creating an entry URL authenticates the user; it does not transfer funds or select a wallet environment.

Security requirements:

  • webUrl contains a one-time ticket. Use it immediately and do not store it long term.
  • If the entry URL expires or has been used, generate a new one from the partner site.
  • returnUrl must not be javascript:, a relative path, or a URL with userinfo.

Product and mode selection

Use the current frontend route supplied by 6MM. For example /zh-CN/up-down?tradingMode=demo, /zh-CN/high-low?tradingMode=real, /zh-CN/grid-prediction?tradingMode=real, or /zh-CN/futures/BTCUSDT?tradingMode=real. The ticket authenticates the user; it does not select a funding environment or move funds.

See Seconds trading for redirect and embedded examples.