Longbridge Developers
Get Started

Submit Strategy Questionnaire

Record the strategy risk-disclosure consent. This is a one-time acknowledgement that must be submitted once before you can place any grid order. Until it is recorded, submitting a grid order will be rejected.

>_ CLI
# Submit the strategy risk-disclosure questionnaire (one-time consent)
longbridge grid questionnaire

Request

HTTP MethodPOST
HTTP URL/v1/record/questionnaire

Parameters

Content-Type: application/json; charset=utf-8

NameTypeRequiredDescription
typestringYESQuestionnaire type, fixed value: strategy
itemsobjectYESConsent items, e.g. { "agree": "true" }

Request Example

from longbridge.openapi import GridContext, Config, OAuthBuilder

oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url))
config = Config.from_oauth(oauth)

# Grid REST calls go through the standalone GridContext
ctx = GridContext(config)

resp = ctx.submit_strategy_questionnaire()
print(resp)
const { Config, GridContext, OAuth } = require('longbridge')

async function main() {
  const oauth = await OAuth.build('your-client-id', (_, url) => {
    console.log('Open this URL to authorize: ' + url)
  })
  const config = Config.fromOAuth(oauth)
  const ctx = GridContext.new(config)
  const resp = await ctx.submitStrategyQuestionnaire()
  console.log(resp)
}
main().catch(console.error)
import com.longbridge.*;
import com.longbridge.grid.*;

class Main {
    public static void main(String[] args) throws Exception {
        try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get();
             Config config = Config.fromOAuth(oauth);
             GridContext ctx = GridContext.create(config)) {
            ctx.submitStrategyQuestionnaire().get();
            System.out.println("consent recorded");
        }
    }
}
use std::sync::Arc;
use longbridge::{
    Config,
    grid::{GridContext, SubmitStrategyQuestionnaireOptions},
    oauth::OAuthBuilder,
};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("Open this URL to authorize: {url}")).await?;
    let config = Arc::new(Config::from_oauth(oauth));
    let ctx = GridContext::new(config);

    ctx.submit_strategy_questionnaire(SubmitStrategyQuestionnaireOptions::new()).await?;
    println!("consent recorded");
    Ok(())
}
#include &lt;iostream&gt;
#include <longbridge.hpp>

using namespace longbridge;
using namespace longbridge::grid;

static void
run(const OAuth& oauth)
{
    Config config = Config::from_oauth(oauth);
    GridContext ctx = GridContext::create(config);

    ctx.submit_strategy_questionnaire([](auto res) {
        if (!res) {
            std::cout << "failed" << std::endl;
            return;
        }
        std::cout << "consent recorded" << std::endl;
    });
}

int main(int argc, char const* argv[]) {
    const std::string client_id = "your-client-id";
    OAuthBuilder(client_id).build(
    [](const std::string& url) {
        std::cout << "Open this URL to authorize: " << url << std::endl;
    },
    [](auto res) {
        if (!res) {
            std::cout << "authorization failed" << std::endl;
            return;
        }
        run(*res);
    });

    std::cin.get();
    return 0;
}

Response

Response Headers

  • Content-Type: application/json

Response Example

{
  "code": 0,
  "message": "success",
  "data": {}
}

Response Status

StatusDescriptionSchema
200The strategy consent was recorded successfully.None
400The request was rejected with an incorrect request parameter.None