diff --git a/docs/en/docs/api-reference/how-to-access-api.md b/docs/en/docs/api-reference/how-to-access-api.md index 07e13f20..a031f5eb 100644 --- a/docs/en/docs/api-reference/how-to-access-api.md +++ b/docs/en/docs/api-reference/how-to-access-api.md @@ -13,6 +13,8 @@ It is recommended to directly use the SDK to access the API, the SDK has encapsu https://open.longbridge.com/sdk ::: +See also: [HTTP API Endpoints](./http-endpoints) (mapped from SDK source). + ## OAuth 2.0 (Current Recommendation) Use OAuth 2.0 for new integrations. It is simpler than the legacy `X-Api-Key` signature flow. diff --git a/docs/en/docs/api-reference/http-endpoints.md b/docs/en/docs/api-reference/http-endpoints.md new file mode 100644 index 00000000..799a1079 --- /dev/null +++ b/docs/en/docs/api-reference/http-endpoints.md @@ -0,0 +1,34 @@ +--- +title: HTTP API Endpoints (from SDK) +id: http-endpoints +slug: /api +sidebar_position: 3 +--- + +This section provides one page per API path (slug path-style, no HTTP verb prefix). + +## Endpoint Pages + +- [`/v1/watchlist/groups`](./http-endpoints/v1-watchlist-groups) +- [`/v1/quote/get_security_list`](./http-endpoints/v1-quote-get_security_list) +- [`/v1/quote/market_temperature`](./http-endpoints/v1-quote-market_temperature) +- [`/v1/quote/history_market_temperature`](./http-endpoints/v1-quote-history_market_temperature) +- [`/v1/trade/execution/history`](./http-endpoints/v1-trade-execution-history) +- [`/v1/trade/execution/today`](./http-endpoints/v1-trade-execution-today) +- [`/v1/trade/order/history`](./http-endpoints/v1-trade-order-history) +- [`/v1/trade/order/today`](./http-endpoints/v1-trade-order-today) +- [`/v1/trade/order`](./http-endpoints/v1-trade-order) +- [`/v1/trade/estimate/buy_limit`](./http-endpoints/v1-trade-estimate-buy_limit) +- [`/v1/asset/account`](./http-endpoints/v1-asset-account) +- [`/v1/asset/cashflow`](./http-endpoints/v1-asset-cashflow) +- [`/v1/asset/fund`](./http-endpoints/v1-asset-fund) +- [`/v1/asset/stock`](./http-endpoints/v1-asset-stock) +- [`/v1/risk/margin-ratio`](./http-endpoints/v1-risk-margin-ratio) +- [`/v1/token/refresh`](./http-endpoints/v1-token-refresh) + +## Source + +- `rust/src/quote/context.rs` +- `rust/src/trade/context.rs` +- `rust/src/config.rs` +- Repository: diff --git a/docs/en/docs/api-reference/http-endpoints/_category_.json b/docs/en/docs/api-reference/http-endpoints/_category_.json new file mode 100644 index 00000000..b28cde95 --- /dev/null +++ b/docs/en/docs/api-reference/http-endpoints/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "HTTP API Endpoints", + "position": 3, + "collapsible": true, + "collapsed": true +} diff --git a/docs/en/docs/api-reference/http-endpoints/v1-asset-account.md b/docs/en/docs/api-reference/http-endpoints/v1-asset-account.md new file mode 100644 index 00000000..989e1168 --- /dev/null +++ b/docs/en/docs/api-reference/http-endpoints/v1-asset-account.md @@ -0,0 +1,74 @@ +--- +title: `GET` Asset Account +id: v1-asset-account +slug: /api/v1/asset/account +sidebar_position: 11 +--- + +## Overview + +This page documents the HTTP endpoint path used by the SDK for this API. + +- **Path:** `/v1/asset/account` +- **Method(s):** `GET` +- **Base URL:** `https://openapi.longportapp.com` (or `https://openapi.longportapp.cn`) + +## Authentication + +Use OAuth 2.0 Bearer token (recommended): + +- Header: `Authorization: Bearer ACCESS_TOKEN` + +API-key signature flow can remain as fallback for legacy integrations, but OAuth 2.0 is the default. + +## Request + +### HTTP Information + +- **HTTP URL:** `/v1/asset/account` +- **HTTP Method(s):** `GET` +- **Content-Type:** `application/json` (for POST/PUT request body) + +### Parameters + +Parameter details (query/body fields and constraints) should be defined per endpoint business spec. + +Current source mapping for this endpoint comes from SDK request definitions in `longportapp/openapi`. + +## Examples + +### GET Example + +```bash +curl -X GET "https://openapi.longportapp.com/v1/asset/account" \ + -H "Authorization: Bearer ACCESS_TOKEN" +``` + +## Response + +### Standard Envelope + +```json +{ + "code": 0, + "message": "success", + "data": {} +} +``` + +### Common Error Shape + +```json +{ + "code": 400000, + "message": "error message", + "data": null +} +``` + +## SDK Source Mapping + +- Repository: +- Path mapping is extracted from SDK HTTP client calls. + +> Next step: enrich each endpoint with concrete parameter tables and real response examples from runtime validation. diff --git a/docs/en/docs/api-reference/http-endpoints/v1-asset-cashflow.md b/docs/en/docs/api-reference/http-endpoints/v1-asset-cashflow.md new file mode 100644 index 00000000..f9d402a3 --- /dev/null +++ b/docs/en/docs/api-reference/http-endpoints/v1-asset-cashflow.md @@ -0,0 +1,74 @@ +--- +title: `GET` Asset Cashflow +id: v1-asset-cashflow +slug: /api/v1/asset/cashflow +sidebar_position: 12 +--- + +## Overview + +This page documents the HTTP endpoint path used by the SDK for this API. + +- **Path:** `/v1/asset/cashflow` +- **Method(s):** `GET` +- **Base URL:** `https://openapi.longportapp.com` (or `https://openapi.longportapp.cn`) + +## Authentication + +Use OAuth 2.0 Bearer token (recommended): + +- Header: `Authorization: Bearer ACCESS_TOKEN` + +API-key signature flow can remain as fallback for legacy integrations, but OAuth 2.0 is the default. + +## Request + +### HTTP Information + +- **HTTP URL:** `/v1/asset/cashflow` +- **HTTP Method(s):** `GET` +- **Content-Type:** `application/json` (for POST/PUT request body) + +### Parameters + +Parameter details (query/body fields and constraints) should be defined per endpoint business spec. + +Current source mapping for this endpoint comes from SDK request definitions in `longportapp/openapi`. + +## Examples + +### GET Example + +```bash +curl -X GET "https://openapi.longportapp.com/v1/asset/cashflow" \ + -H "Authorization: Bearer ACCESS_TOKEN" +``` + +## Response + +### Standard Envelope + +```json +{ + "code": 0, + "message": "success", + "data": {} +} +``` + +### Common Error Shape + +```json +{ + "code": 400000, + "message": "error message", + "data": null +} +``` + +## SDK Source Mapping + +- Repository: +- Path mapping is extracted from SDK HTTP client calls. + +> Next step: enrich each endpoint with concrete parameter tables and real response examples from runtime validation. diff --git a/docs/en/docs/api-reference/http-endpoints/v1-asset-fund.md b/docs/en/docs/api-reference/http-endpoints/v1-asset-fund.md new file mode 100644 index 00000000..f192f598 --- /dev/null +++ b/docs/en/docs/api-reference/http-endpoints/v1-asset-fund.md @@ -0,0 +1,74 @@ +--- +title: `GET` Asset Fund +id: v1-asset-fund +slug: /api/v1/asset/fund +sidebar_position: 13 +--- + +## Overview + +This page documents the HTTP endpoint path used by the SDK for this API. + +- **Path:** `/v1/asset/fund` +- **Method(s):** `GET` +- **Base URL:** `https://openapi.longportapp.com` (or `https://openapi.longportapp.cn`) + +## Authentication + +Use OAuth 2.0 Bearer token (recommended): + +- Header: `Authorization: Bearer ACCESS_TOKEN` + +API-key signature flow can remain as fallback for legacy integrations, but OAuth 2.0 is the default. + +## Request + +### HTTP Information + +- **HTTP URL:** `/v1/asset/fund` +- **HTTP Method(s):** `GET` +- **Content-Type:** `application/json` (for POST/PUT request body) + +### Parameters + +Parameter details (query/body fields and constraints) should be defined per endpoint business spec. + +Current source mapping for this endpoint comes from SDK request definitions in `longportapp/openapi`. + +## Examples + +### GET Example + +```bash +curl -X GET "https://openapi.longportapp.com/v1/asset/fund" \ + -H "Authorization: Bearer ACCESS_TOKEN" +``` + +## Response + +### Standard Envelope + +```json +{ + "code": 0, + "message": "success", + "data": {} +} +``` + +### Common Error Shape + +```json +{ + "code": 400000, + "message": "error message", + "data": null +} +``` + +## SDK Source Mapping + +- Repository: +- Path mapping is extracted from SDK HTTP client calls. + +> Next step: enrich each endpoint with concrete parameter tables and real response examples from runtime validation. diff --git a/docs/en/docs/api-reference/http-endpoints/v1-asset-stock.md b/docs/en/docs/api-reference/http-endpoints/v1-asset-stock.md new file mode 100644 index 00000000..15d9f6ef --- /dev/null +++ b/docs/en/docs/api-reference/http-endpoints/v1-asset-stock.md @@ -0,0 +1,74 @@ +--- +title: `GET` Asset Stock +id: v1-asset-stock +slug: /api/v1/asset/stock +sidebar_position: 14 +--- + +## Overview + +This page documents the HTTP endpoint path used by the SDK for this API. + +- **Path:** `/v1/asset/stock` +- **Method(s):** `GET` +- **Base URL:** `https://openapi.longportapp.com` (or `https://openapi.longportapp.cn`) + +## Authentication + +Use OAuth 2.0 Bearer token (recommended): + +- Header: `Authorization: Bearer ACCESS_TOKEN` + +API-key signature flow can remain as fallback for legacy integrations, but OAuth 2.0 is the default. + +## Request + +### HTTP Information + +- **HTTP URL:** `/v1/asset/stock` +- **HTTP Method(s):** `GET` +- **Content-Type:** `application/json` (for POST/PUT request body) + +### Parameters + +Parameter details (query/body fields and constraints) should be defined per endpoint business spec. + +Current source mapping for this endpoint comes from SDK request definitions in `longportapp/openapi`. + +## Examples + +### GET Example + +```bash +curl -X GET "https://openapi.longportapp.com/v1/asset/stock" \ + -H "Authorization: Bearer ACCESS_TOKEN" +``` + +## Response + +### Standard Envelope + +```json +{ + "code": 0, + "message": "success", + "data": {} +} +``` + +### Common Error Shape + +```json +{ + "code": 400000, + "message": "error message", + "data": null +} +``` + +## SDK Source Mapping + +- Repository: +- Path mapping is extracted from SDK HTTP client calls. + +> Next step: enrich each endpoint with concrete parameter tables and real response examples from runtime validation. diff --git a/docs/en/docs/api-reference/http-endpoints/v1-quote-get_security_list.md b/docs/en/docs/api-reference/http-endpoints/v1-quote-get_security_list.md new file mode 100644 index 00000000..d8996800 --- /dev/null +++ b/docs/en/docs/api-reference/http-endpoints/v1-quote-get_security_list.md @@ -0,0 +1,74 @@ +--- +title: `GET` Quote Get Security List +id: v1-quote-get_security_list +slug: /api/v1/quote/get_security_list +sidebar_position: 2 +--- + +## Overview + +This page documents the HTTP endpoint path used by the SDK for this API. + +- **Path:** `/v1/quote/get_security_list` +- **Method(s):** `GET` +- **Base URL:** `https://openapi.longportapp.com` (or `https://openapi.longportapp.cn`) + +## Authentication + +Use OAuth 2.0 Bearer token (recommended): + +- Header: `Authorization: Bearer ACCESS_TOKEN` + +API-key signature flow can remain as fallback for legacy integrations, but OAuth 2.0 is the default. + +## Request + +### HTTP Information + +- **HTTP URL:** `/v1/quote/get_security_list` +- **HTTP Method(s):** `GET` +- **Content-Type:** `application/json` (for POST/PUT request body) + +### Parameters + +Parameter details (query/body fields and constraints) should be defined per endpoint business spec. + +Current source mapping for this endpoint comes from SDK request definitions in `longportapp/openapi`. + +## Examples + +### GET Example + +```bash +curl -X GET "https://openapi.longportapp.com/v1/quote/get_security_list" \ + -H "Authorization: Bearer ACCESS_TOKEN" +``` + +## Response + +### Standard Envelope + +```json +{ + "code": 0, + "message": "success", + "data": {} +} +``` + +### Common Error Shape + +```json +{ + "code": 400000, + "message": "error message", + "data": null +} +``` + +## SDK Source Mapping + +- Repository: +- Path mapping is extracted from SDK HTTP client calls. + +> Next step: enrich each endpoint with concrete parameter tables and real response examples from runtime validation. diff --git a/docs/en/docs/api-reference/http-endpoints/v1-quote-history_market_temperature.md b/docs/en/docs/api-reference/http-endpoints/v1-quote-history_market_temperature.md new file mode 100644 index 00000000..f9936007 --- /dev/null +++ b/docs/en/docs/api-reference/http-endpoints/v1-quote-history_market_temperature.md @@ -0,0 +1,74 @@ +--- +title: `GET` Quote History Market Temperature +id: v1-quote-history_market_temperature +slug: /api/v1/quote/history_market_temperature +sidebar_position: 4 +--- + +## Overview + +This page documents the HTTP endpoint path used by the SDK for this API. + +- **Path:** `/v1/quote/history_market_temperature` +- **Method(s):** `GET` +- **Base URL:** `https://openapi.longportapp.com` (or `https://openapi.longportapp.cn`) + +## Authentication + +Use OAuth 2.0 Bearer token (recommended): + +- Header: `Authorization: Bearer ACCESS_TOKEN` + +API-key signature flow can remain as fallback for legacy integrations, but OAuth 2.0 is the default. + +## Request + +### HTTP Information + +- **HTTP URL:** `/v1/quote/history_market_temperature` +- **HTTP Method(s):** `GET` +- **Content-Type:** `application/json` (for POST/PUT request body) + +### Parameters + +Parameter details (query/body fields and constraints) should be defined per endpoint business spec. + +Current source mapping for this endpoint comes from SDK request definitions in `longportapp/openapi`. + +## Examples + +### GET Example + +```bash +curl -X GET "https://openapi.longportapp.com/v1/quote/history_market_temperature" \ + -H "Authorization: Bearer ACCESS_TOKEN" +``` + +## Response + +### Standard Envelope + +```json +{ + "code": 0, + "message": "success", + "data": {} +} +``` + +### Common Error Shape + +```json +{ + "code": 400000, + "message": "error message", + "data": null +} +``` + +## SDK Source Mapping + +- Repository: +- Path mapping is extracted from SDK HTTP client calls. + +> Next step: enrich each endpoint with concrete parameter tables and real response examples from runtime validation. diff --git a/docs/en/docs/api-reference/http-endpoints/v1-quote-market_temperature.md b/docs/en/docs/api-reference/http-endpoints/v1-quote-market_temperature.md new file mode 100644 index 00000000..3ca8365b --- /dev/null +++ b/docs/en/docs/api-reference/http-endpoints/v1-quote-market_temperature.md @@ -0,0 +1,74 @@ +--- +title: `GET` Quote Market Temperature +id: v1-quote-market_temperature +slug: /api/v1/quote/market_temperature +sidebar_position: 3 +--- + +## Overview + +This page documents the HTTP endpoint path used by the SDK for this API. + +- **Path:** `/v1/quote/market_temperature` +- **Method(s):** `GET` +- **Base URL:** `https://openapi.longportapp.com` (or `https://openapi.longportapp.cn`) + +## Authentication + +Use OAuth 2.0 Bearer token (recommended): + +- Header: `Authorization: Bearer ACCESS_TOKEN` + +API-key signature flow can remain as fallback for legacy integrations, but OAuth 2.0 is the default. + +## Request + +### HTTP Information + +- **HTTP URL:** `/v1/quote/market_temperature` +- **HTTP Method(s):** `GET` +- **Content-Type:** `application/json` (for POST/PUT request body) + +### Parameters + +Parameter details (query/body fields and constraints) should be defined per endpoint business spec. + +Current source mapping for this endpoint comes from SDK request definitions in `longportapp/openapi`. + +## Examples + +### GET Example + +```bash +curl -X GET "https://openapi.longportapp.com/v1/quote/market_temperature" \ + -H "Authorization: Bearer ACCESS_TOKEN" +``` + +## Response + +### Standard Envelope + +```json +{ + "code": 0, + "message": "success", + "data": {} +} +``` + +### Common Error Shape + +```json +{ + "code": 400000, + "message": "error message", + "data": null +} +``` + +## SDK Source Mapping + +- Repository: +- Path mapping is extracted from SDK HTTP client calls. + +> Next step: enrich each endpoint with concrete parameter tables and real response examples from runtime validation. diff --git a/docs/en/docs/api-reference/http-endpoints/v1-risk-margin-ratio.md b/docs/en/docs/api-reference/http-endpoints/v1-risk-margin-ratio.md new file mode 100644 index 00000000..da2a93e4 --- /dev/null +++ b/docs/en/docs/api-reference/http-endpoints/v1-risk-margin-ratio.md @@ -0,0 +1,74 @@ +--- +title: `GET` Risk Margin Ratio +id: v1-risk-margin-ratio +slug: /api/v1/risk/margin-ratio +sidebar_position: 15 +--- + +## Overview + +This page documents the HTTP endpoint path used by the SDK for this API. + +- **Path:** `/v1/risk/margin-ratio` +- **Method(s):** `GET` +- **Base URL:** `https://openapi.longportapp.com` (or `https://openapi.longportapp.cn`) + +## Authentication + +Use OAuth 2.0 Bearer token (recommended): + +- Header: `Authorization: Bearer ACCESS_TOKEN` + +API-key signature flow can remain as fallback for legacy integrations, but OAuth 2.0 is the default. + +## Request + +### HTTP Information + +- **HTTP URL:** `/v1/risk/margin-ratio` +- **HTTP Method(s):** `GET` +- **Content-Type:** `application/json` (for POST/PUT request body) + +### Parameters + +Parameter details (query/body fields and constraints) should be defined per endpoint business spec. + +Current source mapping for this endpoint comes from SDK request definitions in `longportapp/openapi`. + +## Examples + +### GET Example + +```bash +curl -X GET "https://openapi.longportapp.com/v1/risk/margin-ratio" \ + -H "Authorization: Bearer ACCESS_TOKEN" +``` + +## Response + +### Standard Envelope + +```json +{ + "code": 0, + "message": "success", + "data": {} +} +``` + +### Common Error Shape + +```json +{ + "code": 400000, + "message": "error message", + "data": null +} +``` + +## SDK Source Mapping + +- Repository: +- Path mapping is extracted from SDK HTTP client calls. + +> Next step: enrich each endpoint with concrete parameter tables and real response examples from runtime validation. diff --git a/docs/en/docs/api-reference/http-endpoints/v1-token-refresh.md b/docs/en/docs/api-reference/http-endpoints/v1-token-refresh.md new file mode 100644 index 00000000..f0c6259a --- /dev/null +++ b/docs/en/docs/api-reference/http-endpoints/v1-token-refresh.md @@ -0,0 +1,74 @@ +--- +title: `GET` Token Refresh +id: v1-token-refresh +slug: /api/v1/token/refresh +sidebar_position: 16 +--- + +## Overview + +This page documents the HTTP endpoint path used by the SDK for this API. + +- **Path:** `/v1/token/refresh` +- **Method(s):** `GET` +- **Base URL:** `https://openapi.longportapp.com` (or `https://openapi.longportapp.cn`) + +## Authentication + +Use OAuth 2.0 Bearer token (recommended): + +- Header: `Authorization: Bearer ACCESS_TOKEN` + +API-key signature flow can remain as fallback for legacy integrations, but OAuth 2.0 is the default. + +## Request + +### HTTP Information + +- **HTTP URL:** `/v1/token/refresh` +- **HTTP Method(s):** `GET` +- **Content-Type:** `application/json` (for POST/PUT request body) + +### Parameters + +Parameter details (query/body fields and constraints) should be defined per endpoint business spec. + +Current source mapping for this endpoint comes from SDK request definitions in `longportapp/openapi`. + +## Examples + +### GET Example + +```bash +curl -X GET "https://openapi.longportapp.com/v1/token/refresh" \ + -H "Authorization: Bearer ACCESS_TOKEN" +``` + +## Response + +### Standard Envelope + +```json +{ + "code": 0, + "message": "success", + "data": {} +} +``` + +### Common Error Shape + +```json +{ + "code": 400000, + "message": "error message", + "data": null +} +``` + +## SDK Source Mapping + +- Repository: +- Path mapping is extracted from SDK HTTP client calls. + +> Next step: enrich each endpoint with concrete parameter tables and real response examples from runtime validation. diff --git a/docs/en/docs/api-reference/http-endpoints/v1-trade-estimate-buy_limit.md b/docs/en/docs/api-reference/http-endpoints/v1-trade-estimate-buy_limit.md new file mode 100644 index 00000000..2db65cd5 --- /dev/null +++ b/docs/en/docs/api-reference/http-endpoints/v1-trade-estimate-buy_limit.md @@ -0,0 +1,74 @@ +--- +title: `GET` Trade Estimate Buy Limit +id: v1-trade-estimate-buy_limit +slug: /api/v1/trade/estimate/buy_limit +sidebar_position: 10 +--- + +## Overview + +This page documents the HTTP endpoint path used by the SDK for this API. + +- **Path:** `/v1/trade/estimate/buy_limit` +- **Method(s):** `GET` +- **Base URL:** `https://openapi.longportapp.com` (or `https://openapi.longportapp.cn`) + +## Authentication + +Use OAuth 2.0 Bearer token (recommended): + +- Header: `Authorization: Bearer ACCESS_TOKEN` + +API-key signature flow can remain as fallback for legacy integrations, but OAuth 2.0 is the default. + +## Request + +### HTTP Information + +- **HTTP URL:** `/v1/trade/estimate/buy_limit` +- **HTTP Method(s):** `GET` +- **Content-Type:** `application/json` (for POST/PUT request body) + +### Parameters + +Parameter details (query/body fields and constraints) should be defined per endpoint business spec. + +Current source mapping for this endpoint comes from SDK request definitions in `longportapp/openapi`. + +## Examples + +### GET Example + +```bash +curl -X GET "https://openapi.longportapp.com/v1/trade/estimate/buy_limit" \ + -H "Authorization: Bearer ACCESS_TOKEN" +``` + +## Response + +### Standard Envelope + +```json +{ + "code": 0, + "message": "success", + "data": {} +} +``` + +### Common Error Shape + +```json +{ + "code": 400000, + "message": "error message", + "data": null +} +``` + +## SDK Source Mapping + +- Repository: +- Path mapping is extracted from SDK HTTP client calls. + +> Next step: enrich each endpoint with concrete parameter tables and real response examples from runtime validation. diff --git a/docs/en/docs/api-reference/http-endpoints/v1-trade-execution-history.md b/docs/en/docs/api-reference/http-endpoints/v1-trade-execution-history.md new file mode 100644 index 00000000..2bc1a4ba --- /dev/null +++ b/docs/en/docs/api-reference/http-endpoints/v1-trade-execution-history.md @@ -0,0 +1,74 @@ +--- +title: `GET` Trade Execution History +id: v1-trade-execution-history +slug: /api/v1/trade/execution/history +sidebar_position: 5 +--- + +## Overview + +This page documents the HTTP endpoint path used by the SDK for this API. + +- **Path:** `/v1/trade/execution/history` +- **Method(s):** `GET` +- **Base URL:** `https://openapi.longportapp.com` (or `https://openapi.longportapp.cn`) + +## Authentication + +Use OAuth 2.0 Bearer token (recommended): + +- Header: `Authorization: Bearer ACCESS_TOKEN` + +API-key signature flow can remain as fallback for legacy integrations, but OAuth 2.0 is the default. + +## Request + +### HTTP Information + +- **HTTP URL:** `/v1/trade/execution/history` +- **HTTP Method(s):** `GET` +- **Content-Type:** `application/json` (for POST/PUT request body) + +### Parameters + +Parameter details (query/body fields and constraints) should be defined per endpoint business spec. + +Current source mapping for this endpoint comes from SDK request definitions in `longportapp/openapi`. + +## Examples + +### GET Example + +```bash +curl -X GET "https://openapi.longportapp.com/v1/trade/execution/history" \ + -H "Authorization: Bearer ACCESS_TOKEN" +``` + +## Response + +### Standard Envelope + +```json +{ + "code": 0, + "message": "success", + "data": {} +} +``` + +### Common Error Shape + +```json +{ + "code": 400000, + "message": "error message", + "data": null +} +``` + +## SDK Source Mapping + +- Repository: +- Path mapping is extracted from SDK HTTP client calls. + +> Next step: enrich each endpoint with concrete parameter tables and real response examples from runtime validation. diff --git a/docs/en/docs/api-reference/http-endpoints/v1-trade-execution-today.md b/docs/en/docs/api-reference/http-endpoints/v1-trade-execution-today.md new file mode 100644 index 00000000..8a6be902 --- /dev/null +++ b/docs/en/docs/api-reference/http-endpoints/v1-trade-execution-today.md @@ -0,0 +1,74 @@ +--- +title: `GET` Trade Execution Today +id: v1-trade-execution-today +slug: /api/v1/trade/execution/today +sidebar_position: 6 +--- + +## Overview + +This page documents the HTTP endpoint path used by the SDK for this API. + +- **Path:** `/v1/trade/execution/today` +- **Method(s):** `GET` +- **Base URL:** `https://openapi.longportapp.com` (or `https://openapi.longportapp.cn`) + +## Authentication + +Use OAuth 2.0 Bearer token (recommended): + +- Header: `Authorization: Bearer ACCESS_TOKEN` + +API-key signature flow can remain as fallback for legacy integrations, but OAuth 2.0 is the default. + +## Request + +### HTTP Information + +- **HTTP URL:** `/v1/trade/execution/today` +- **HTTP Method(s):** `GET` +- **Content-Type:** `application/json` (for POST/PUT request body) + +### Parameters + +Parameter details (query/body fields and constraints) should be defined per endpoint business spec. + +Current source mapping for this endpoint comes from SDK request definitions in `longportapp/openapi`. + +## Examples + +### GET Example + +```bash +curl -X GET "https://openapi.longportapp.com/v1/trade/execution/today" \ + -H "Authorization: Bearer ACCESS_TOKEN" +``` + +## Response + +### Standard Envelope + +```json +{ + "code": 0, + "message": "success", + "data": {} +} +``` + +### Common Error Shape + +```json +{ + "code": 400000, + "message": "error message", + "data": null +} +``` + +## SDK Source Mapping + +- Repository: +- Path mapping is extracted from SDK HTTP client calls. + +> Next step: enrich each endpoint with concrete parameter tables and real response examples from runtime validation. diff --git a/docs/en/docs/api-reference/http-endpoints/v1-trade-order-history.md b/docs/en/docs/api-reference/http-endpoints/v1-trade-order-history.md new file mode 100644 index 00000000..236faa8b --- /dev/null +++ b/docs/en/docs/api-reference/http-endpoints/v1-trade-order-history.md @@ -0,0 +1,74 @@ +--- +title: `GET` Trade Order History +id: v1-trade-order-history +slug: /api/v1/trade/order/history +sidebar_position: 7 +--- + +## Overview + +This page documents the HTTP endpoint path used by the SDK for this API. + +- **Path:** `/v1/trade/order/history` +- **Method(s):** `GET` +- **Base URL:** `https://openapi.longportapp.com` (or `https://openapi.longportapp.cn`) + +## Authentication + +Use OAuth 2.0 Bearer token (recommended): + +- Header: `Authorization: Bearer ACCESS_TOKEN` + +API-key signature flow can remain as fallback for legacy integrations, but OAuth 2.0 is the default. + +## Request + +### HTTP Information + +- **HTTP URL:** `/v1/trade/order/history` +- **HTTP Method(s):** `GET` +- **Content-Type:** `application/json` (for POST/PUT request body) + +### Parameters + +Parameter details (query/body fields and constraints) should be defined per endpoint business spec. + +Current source mapping for this endpoint comes from SDK request definitions in `longportapp/openapi`. + +## Examples + +### GET Example + +```bash +curl -X GET "https://openapi.longportapp.com/v1/trade/order/history" \ + -H "Authorization: Bearer ACCESS_TOKEN" +``` + +## Response + +### Standard Envelope + +```json +{ + "code": 0, + "message": "success", + "data": {} +} +``` + +### Common Error Shape + +```json +{ + "code": 400000, + "message": "error message", + "data": null +} +``` + +## SDK Source Mapping + +- Repository: +- Path mapping is extracted from SDK HTTP client calls. + +> Next step: enrich each endpoint with concrete parameter tables and real response examples from runtime validation. diff --git a/docs/en/docs/api-reference/http-endpoints/v1-trade-order-today.md b/docs/en/docs/api-reference/http-endpoints/v1-trade-order-today.md new file mode 100644 index 00000000..a12f6e80 --- /dev/null +++ b/docs/en/docs/api-reference/http-endpoints/v1-trade-order-today.md @@ -0,0 +1,74 @@ +--- +title: `GET` Trade Order Today +id: v1-trade-order-today +slug: /api/v1/trade/order/today +sidebar_position: 8 +--- + +## Overview + +This page documents the HTTP endpoint path used by the SDK for this API. + +- **Path:** `/v1/trade/order/today` +- **Method(s):** `GET` +- **Base URL:** `https://openapi.longportapp.com` (or `https://openapi.longportapp.cn`) + +## Authentication + +Use OAuth 2.0 Bearer token (recommended): + +- Header: `Authorization: Bearer ACCESS_TOKEN` + +API-key signature flow can remain as fallback for legacy integrations, but OAuth 2.0 is the default. + +## Request + +### HTTP Information + +- **HTTP URL:** `/v1/trade/order/today` +- **HTTP Method(s):** `GET` +- **Content-Type:** `application/json` (for POST/PUT request body) + +### Parameters + +Parameter details (query/body fields and constraints) should be defined per endpoint business spec. + +Current source mapping for this endpoint comes from SDK request definitions in `longportapp/openapi`. + +## Examples + +### GET Example + +```bash +curl -X GET "https://openapi.longportapp.com/v1/trade/order/today" \ + -H "Authorization: Bearer ACCESS_TOKEN" +``` + +## Response + +### Standard Envelope + +```json +{ + "code": 0, + "message": "success", + "data": {} +} +``` + +### Common Error Shape + +```json +{ + "code": 400000, + "message": "error message", + "data": null +} +``` + +## SDK Source Mapping + +- Repository: +- Path mapping is extracted from SDK HTTP client calls. + +> Next step: enrich each endpoint with concrete parameter tables and real response examples from runtime validation. diff --git a/docs/en/docs/api-reference/http-endpoints/v1-trade-order.md b/docs/en/docs/api-reference/http-endpoints/v1-trade-order.md new file mode 100644 index 00000000..73ee99d1 --- /dev/null +++ b/docs/en/docs/api-reference/http-endpoints/v1-trade-order.md @@ -0,0 +1,99 @@ +--- +title: `GET/POST/PUT/DELETE` Trade Order +id: v1-trade-order +slug: /api/v1/trade/order +sidebar_position: 9 +--- + +## Overview + +This page documents the HTTP endpoint path used by the SDK for this API. + +- **Path:** `/v1/trade/order` +- **Method(s):** `GET / POST / PUT / DELETE` +- **Base URL:** `https://openapi.longportapp.com` (or `https://openapi.longportapp.cn`) + +## Authentication + +Use OAuth 2.0 Bearer token (recommended): + +- Header: `Authorization: Bearer ACCESS_TOKEN` + +API-key signature flow can remain as fallback for legacy integrations, but OAuth 2.0 is the default. + +## Request + +### HTTP Information + +- **HTTP URL:** `/v1/trade/order` +- **HTTP Method(s):** `GET / POST / PUT / DELETE` +- **Content-Type:** `application/json` (for POST/PUT request body) + +### Parameters + +Parameter details (query/body fields and constraints) should be defined per endpoint business spec. + +Current source mapping for this endpoint comes from SDK request definitions in `longportapp/openapi`. + +## Examples + +### GET Example + +```bash +curl -X GET "https://openapi.longportapp.com/v1/trade/order" \ + -H "Authorization: Bearer ACCESS_TOKEN" +``` + +### POST Example + +```bash +curl -X POST "https://openapi.longportapp.com/v1/trade/order" \ + -H "Authorization: Bearer ACCESS_TOKEN" \ + -H "Content-Type: application/json" \ + -d '{}' +``` + +### PUT Example + +```bash +curl -X PUT "https://openapi.longportapp.com/v1/trade/order" \ + -H "Authorization: Bearer ACCESS_TOKEN" \ + -H "Content-Type: application/json" \ + -d '{}' +``` + +### DELETE Example + +```bash +curl -X DELETE "https://openapi.longportapp.com/v1/trade/order" \ + -H "Authorization: Bearer ACCESS_TOKEN" +``` + +## Response + +### Standard Envelope + +```json +{ + "code": 0, + "message": "success", + "data": {} +} +``` + +### Common Error Shape + +```json +{ + "code": 400000, + "message": "error message", + "data": null +} +``` + +## SDK Source Mapping + +- Repository: +- Path mapping is extracted from SDK HTTP client calls. + +> Next step: enrich each endpoint with concrete parameter tables and real response examples from runtime validation. diff --git a/docs/en/docs/api-reference/http-endpoints/v1-watchlist-groups.md b/docs/en/docs/api-reference/http-endpoints/v1-watchlist-groups.md new file mode 100644 index 00000000..2ab5aff7 --- /dev/null +++ b/docs/en/docs/api-reference/http-endpoints/v1-watchlist-groups.md @@ -0,0 +1,99 @@ +--- +title: `GET/POST/PUT/DELETE` Watchlist Groups +id: v1-watchlist-groups +slug: /api/v1/watchlist/groups +sidebar_position: 1 +--- + +## Overview + +This page documents the HTTP endpoint path used by the SDK for this API. + +- **Path:** `/v1/watchlist/groups` +- **Method(s):** `GET / POST / PUT / DELETE` +- **Base URL:** `https://openapi.longportapp.com` (or `https://openapi.longportapp.cn`) + +## Authentication + +Use OAuth 2.0 Bearer token (recommended): + +- Header: `Authorization: Bearer ACCESS_TOKEN` + +API-key signature flow can remain as fallback for legacy integrations, but OAuth 2.0 is the default. + +## Request + +### HTTP Information + +- **HTTP URL:** `/v1/watchlist/groups` +- **HTTP Method(s):** `GET / POST / PUT / DELETE` +- **Content-Type:** `application/json` (for POST/PUT request body) + +### Parameters + +Parameter details (query/body fields and constraints) should be defined per endpoint business spec. + +Current source mapping for this endpoint comes from SDK request definitions in `longportapp/openapi`. + +## Examples + +### GET Example + +```bash +curl -X GET "https://openapi.longportapp.com/v1/watchlist/groups" \ + -H "Authorization: Bearer ACCESS_TOKEN" +``` + +### POST Example + +```bash +curl -X POST "https://openapi.longportapp.com/v1/watchlist/groups" \ + -H "Authorization: Bearer ACCESS_TOKEN" \ + -H "Content-Type: application/json" \ + -d '{}' +``` + +### PUT Example + +```bash +curl -X PUT "https://openapi.longportapp.com/v1/watchlist/groups" \ + -H "Authorization: Bearer ACCESS_TOKEN" \ + -H "Content-Type: application/json" \ + -d '{}' +``` + +### DELETE Example + +```bash +curl -X DELETE "https://openapi.longportapp.com/v1/watchlist/groups" \ + -H "Authorization: Bearer ACCESS_TOKEN" +``` + +## Response + +### Standard Envelope + +```json +{ + "code": 0, + "message": "success", + "data": {} +} +``` + +### Common Error Shape + +```json +{ + "code": 400000, + "message": "error message", + "data": null +} +``` + +## SDK Source Mapping + +- Repository: +- Path mapping is extracted from SDK HTTP client calls. + +> Next step: enrich each endpoint with concrete parameter tables and real response examples from runtime validation. diff --git a/docs/zh-CN/docs/api-reference/how-to-access-api.md b/docs/zh-CN/docs/api-reference/how-to-access-api.md index 5f32b76d..93c0f81e 100644 --- a/docs/zh-CN/docs/api-reference/how-to-access-api.md +++ b/docs/zh-CN/docs/api-reference/how-to-access-api.md @@ -13,6 +13,8 @@ sidebar_position: 1 https://open.longbridge.com/sdk ::: +另见:[HTTP API 端点清单](./http-endpoints)(根据 SDK 源码映射)。 + ## OAuth 2.0(当前推荐) 新接入建议使用 OAuth 2.0。相比后面的 `X-Api-Key` 签名方式,OAuth 2.0 更简单、接入成本更低。 @@ -120,6 +122,7 @@ curl -X POST https://openapi.longportapp.com/oauth2/token \ | 阅读 OpenAPI 介绍中开通相应服务 | [OpenAPI 如何开通](../docs/#如何开通) | | 阅读 OpenAPI 介绍中使用权限及限制 | [OpenAPI 使用权限及限制](../docs/#使用权限及限制) | | 了解通用错误码,便于查找调用接口出错的原因 | [通用错误码](../docs/error-codes) | +| 查看 SDK 对应的 HTTP API 路径清单 | [HTTP API 端点清单](./http-endpoints) | ## REST API 文档约定格式 diff --git a/docs/zh-CN/docs/api-reference/http-endpoints.md b/docs/zh-CN/docs/api-reference/http-endpoints.md new file mode 100644 index 00000000..d50f3ea4 --- /dev/null +++ b/docs/zh-CN/docs/api-reference/http-endpoints.md @@ -0,0 +1,60 @@ +--- +title: HTTP API 端点清单(来自 SDK) +id: http-endpoints +slug: /http-endpoints +sidebar_position: 3 +--- + +本页根据 `longportapp/openapi` Rust SDK 源码(`rust/src`)整理,列出当前 SDK 实际调用的 HTTP API 路径,便于直接对照 HTTP 访问。 + +> 说明:本清单以 SDK 当前实现为准,若 SDK 更新,路径和方法可能变化。 + +## 基础域名 + +- `https://openapi.longportapp.com` +- `https://openapi.longportapp.cn` + +## Quote + +| Method | Path | +| ------ | ---- | +| GET | `/v1/watchlist/groups` | +| POST | `/v1/watchlist/groups` | +| DELETE | `/v1/watchlist/groups` | +| PUT | `/v1/watchlist/groups` | +| GET | `/v1/quote/get_security_list` | +| GET | `/v1/quote/market_temperature` | +| GET | `/v1/quote/history_market_temperature` | + +## Trade / Asset / Risk + +| Method | Path | +| ------ | ---- | +| GET | `/v1/trade/execution/history` | +| GET | `/v1/trade/execution/today` | +| GET | `/v1/trade/order/history` | +| GET | `/v1/trade/order/today` | +| GET | `/v1/trade/order` | +| POST | `/v1/trade/order` | +| PUT | `/v1/trade/order` | +| DELETE | `/v1/trade/order` | +| GET | `/v1/trade/estimate/buy_limit` | +| GET | `/v1/asset/account` | +| GET | `/v1/asset/cashflow` | +| GET | `/v1/asset/fund` | +| GET | `/v1/asset/stock` | +| GET | `/v1/risk/margin-ratio` | + +## Legacy(兼容) + +| Method | Path | +| ------ | ---- | +| GET | `/v1/token/refresh` | + +## 来源(SDK 代码位置) + +- `rust/src/quote/context.rs` +- `rust/src/trade/context.rs` +- `rust/src/config.rs` + +仓库: diff --git a/docs/zh-HK/docs/api-reference/how-to-access-api.md b/docs/zh-HK/docs/api-reference/how-to-access-api.md index 3fac43ed..68df5c75 100644 --- a/docs/zh-HK/docs/api-reference/how-to-access-api.md +++ b/docs/zh-HK/docs/api-reference/how-to-access-api.md @@ -13,6 +13,8 @@ sidebar_position: 1 https://open.longbridge.com/sdk ::: +另见:[HTTP API 端點清單](./http-endpoints)(根據 SDK 原始碼映射)。 + ## OAuth 2.0(目前推薦) 新接入建議使用 OAuth 2.0。相比後文 `X-Api-Key` 簽名方式,OAuth 2.0 更簡單。 diff --git a/docs/zh-HK/docs/api-reference/http-endpoints.md b/docs/zh-HK/docs/api-reference/http-endpoints.md new file mode 100644 index 00000000..c7cbfd32 --- /dev/null +++ b/docs/zh-HK/docs/api-reference/http-endpoints.md @@ -0,0 +1,60 @@ +--- +title: HTTP API 端點清單(來自 SDK) +id: http-endpoints +slug: /http-endpoints +sidebar_position: 3 +--- + +本頁根據 `longportapp/openapi` Rust SDK 原始碼(`rust/src`)整理,列出 SDK 目前實際呼叫的 HTTP API 路徑,方便直接以 HTTP 方式對照。 + +> 說明:清單以 SDK 目前實作為準,SDK 更新後路徑或方法可能變更。 + +## 基礎網域 + +- `https://openapi.longportapp.com` +- `https://openapi.longportapp.cn` + +## Quote + +| Method | Path | +| ------ | ---- | +| GET | `/v1/watchlist/groups` | +| POST | `/v1/watchlist/groups` | +| DELETE | `/v1/watchlist/groups` | +| PUT | `/v1/watchlist/groups` | +| GET | `/v1/quote/get_security_list` | +| GET | `/v1/quote/market_temperature` | +| GET | `/v1/quote/history_market_temperature` | + +## Trade / Asset / Risk + +| Method | Path | +| ------ | ---- | +| GET | `/v1/trade/execution/history` | +| GET | `/v1/trade/execution/today` | +| GET | `/v1/trade/order/history` | +| GET | `/v1/trade/order/today` | +| GET | `/v1/trade/order` | +| POST | `/v1/trade/order` | +| PUT | `/v1/trade/order` | +| DELETE | `/v1/trade/order` | +| GET | `/v1/trade/estimate/buy_limit` | +| GET | `/v1/asset/account` | +| GET | `/v1/asset/cashflow` | +| GET | `/v1/asset/fund` | +| GET | `/v1/asset/stock` | +| GET | `/v1/risk/margin-ratio` | + +## Legacy(相容) + +| Method | Path | +| ------ | ---- | +| GET | `/v1/token/refresh` | + +## 來源(SDK 程式碼位置) + +- `rust/src/quote/context.rs` +- `rust/src/trade/context.rs` +- `rust/src/config.rs` + +倉庫: