### Full Demo: Initialize and Build Access Token in Golang Source: https://op.jinritemai.com/docs/guide-docs/1041_docLabel=1 Golang example for a full demo, including setting global app key/secret, building an access token, and preparing and executing an Open API request. ```Golang //设置appKey和appSecret,全局设置一次 doudian_sdk.GlobalConfig.AppKey = "xxxxxxxx" doudian_sdk.GlobalConfig.AppSecret = "xxxxxxxxxx" //创建Access Token accessToken, err := doudian_sdk.BuildAccessToken(&doudian_sdk.BuildAccessTokenParam{ShopId: 4463798}) if err != nil { panic(err) } //构建Open Api请求参数 request := address_list_request.New() request.GetParams().PageNo = 1 request.GetParams().PageSize = 10 request.GetParams().ShopId = 123456 //调用Open Api response := request.Execute(accessToken) ``` -------------------------------- ### Address API: Get Areas By Province - Java Example Source: https://op.jinritemai.com/docs/api-docs/16/1844 Illustrates how to implement the getAreasByProvince API call in Java. It shows the necessary setup and parameters for making a successful request to fetch address data. ```java // Java example code would go here, demonstrating how to construct and send the request. ``` -------------------------------- ### Get User Order List - Python Example Source: https://op.jinritemai.com/docs/api-docs/15/1915 This snippet shows how to retrieve user order lists using Python. It requires proper setup of API keys and tokens. ```python # Python code example would go here. Please refer to the SDK for implementation details. ``` -------------------------------- ### Full Demo: Initialize and Build Access Token in Java Source: https://op.jinritemai.com/docs/guide-docs/1041_docLabel=1 Comprehensive Java example demonstrating initialization of HTTP client timeouts, setting debug headers for test/pre-release environments, initializing app key/secret, and building an access token using various methods. ```java // 配置调整 GlobalConfig.initHttpClientReadTimeout(12000); // 超时时间 GlobalConfig.initHttpClientConnectTimeout(3000); //建连时间 // 如果需要走到测试环境,添加调试header request.getConfig().addHttpRequestHeader("x-tt-env","env");//具体值需要找业务同学 request.getConfig().addHttpRequestHeader("x-use-boe","1"); // 如果需要走到预发环境,上线后一定要去掉,否则后续请求会有稳定性问题 request.getConfig().addHttpRequestHeader("x-tt-env","env");//具体值需要找业务同学 request.getConfig().addHttpRequestHeader("x-use-ppe","1"); //设置appKey和appSecret,全局设置一次 GlobalConfig.initAppKey("6989147827339429420"); GlobalConfig.initAppSecret("284371ec-c15c-489e-9ce1-673b243603c6"); //如果有多个appKey 初始化appKey和对应的appSecret GlobalConfig.AddAppKeyAndAppSecret("app_key", "app_secret"); AccessToken ak = AccessTokenBuilder.buildWithAppKey(1234L, "app_key"); AccessToken ak = AccessTokenBuilder.buildWithAppKey("auth_code", "app_key"); AccessToken ak = AccessTokenBuilder.buildWithAppKey("auth_id", "auth_subject_type", "app_key"); //创建Access Token AccessToken accessToken = AccessTokenBuilder.build("263e343c-fd86-42c4-b724-36f732cb281c"); if(!accessToken.isSuccess()) { //todo return; } //构建Open Api请求参数 AddressListRequest request = new AddressListRequest(); AddressListParam param = request.getParam(); param.setPageNo(1L); param.setPageSize(20L); param.setShopId(123456L); //调用Open Api AddressListResponse response = null; try { response = request.execute(accessToken); // request.execute(null); 如果是调用不需要授权的接口,accessTokne传null }catch (DoudianOpException e){ //处理异常 } ``` -------------------------------- ### Cross-Border Get Identification API Request Examples Source: https://op.jinritemai.com/docs/api-docs/53/6648 Examples of how to call the Cross-Border Get Identification API using cURL, Java, PHP, Python, and .NET Core. These examples demonstrate the structure of the API request, including common and specific parameters. ```curl https://openapi-fxg.jinritemai.com/crossBorder/getIdentification?app_key=your_appkey_here&method=crossBorder.getIdentification&access_token=your_accesstoken_here¶m_json={}×tamp=2018-06-19%2016:06:59&v=2&sign=your_sign_here ``` ```java // Java example not provided in the source text. ``` ```php // PHP example not provided in the source text. ``` ```python # Python example not provided in the source text. ``` ```csharp // .NET Core example not provided in the source text. ``` -------------------------------- ### Java Application Startup Script Example Source: https://op.jinritemai.com/docs/guide-docs/1043 This is an example of a shell script for starting a Java application. It assumes the application is packaged as a JAR file named 'demo.jar' and will be executed from the deployment path within the container. ```shell #!/bin/bash java -jar demo.jar ``` -------------------------------- ### Product Add V2 API Request Example (Go) Source: https://op.jinritemai.com/docs/api-docs/14/249 Example of how to call the product.addV2 API using Go. This code demonstrates making HTTP requests in Go, including handling request bodies and parameters. ```go // Go code example would go here, demonstrating how to construct and send the request. ``` -------------------------------- ### Get Service List API Request Examples Source: https://op.jinritemai.com/docs/api-docs/15/1835 Examples of how to call the /order/getServiceList API using various programming languages. These examples demonstrate the structure of the API request, including common and request-specific parameters. ```bash curl -X GET "https://openapi-fxg.jinritemai.com?app_key=your_appkey_here&method=order.getServiceList&access_token=your_accesstoken_here¶m_json={}×tamp=2018-06-19%2016:06:59&v=2&sign=your_sign_here" ``` ```java // Java example would go here. Please refer to SDK for implementation details. ``` ```php // PHP example would go here. Please refer to SDK for implementation details. ``` ```python # Python example would go here. Please refer to SDK for implementation details. ``` ```go // Go example would go here. Please refer to SDK for implementation details. ``` ```csharp // .NET Core example would go here. Please refer to SDK for implementation details. ``` -------------------------------- ### Batch Get Static File URLs (Python) Source: https://op.jinritemai.com/docs/api-docs/69/2914 A Python code snippet demonstrating the usage of the GetStaticFileUrlBatch API. This example would guide developers on how to send requests and manage the returned file URLs within a Python environment. ```python # Python code example for GetStaticFileUrlBatch API call would go here. # This would likely use the 'requests' library to handle HTTP communication # and JSON parsing for the API response. ``` -------------------------------- ### Add Product API Request Example (Go.NET Core) Source: https://op.jinritemai.com/docs/api-docs/1570/7445_docLabel=&from=list Example of how to construct an API request to add a product using .NET Core. This demonstrates setting up the HTTP client and request body. ```csharp string apiUrl = "https://openapi-fxg.jinritemai.com/instantShopping/product/addV2?app_key=your_appkey_here&method=instantShopping.product.addV2&access_token=your_accesstoken_here¶m_json={}×tamp=2018-06-19%2016:06:59&v=2&sign=your_sign_here"; // Construct param_json with product details here // Example: var paramJson = new { name = "Example Product", price = 1000 }; // Replace placeholder values with actual data // Use HttpClient to send a POST request to apiUrl with paramJson content ``` -------------------------------- ### Get Shop Druggists API Request Examples Source: https://op.jinritemai.com/docs/api-docs/1479/6462 Examples demonstrating how to call the 'getShopDruggist' API using cURL, Java, PHP, Python, and .NET Core. These examples show the structure of the API request, including common and specific parameters. ```curl curl https://openapi-fxg.jinritemai.commarketing/membership/unbind/v1?app_key=your_appkey_here&method=marketing.membership.unbind.v1&access_token=your_accesstoken_here¶m_json={}×tamp=2018-06-19%2016:06:59&v=2&sign=your_sign_here ``` ```java // Java example would go here, demonstrating API call structure. ``` ```php // PHP example would go here, demonstrating API call structure. ``` ```python # Python example would go here, demonstrating API call structure. ``` ```csharp // .NET Core example would go here, demonstrating API call structure. ``` -------------------------------- ### API Request Example - Go Source: https://op.jinritemai.com/docs/api-docs/1033/3599 This Go code example demonstrates how to invoke the superm/capacityRule/create API. It provides a template for setting up the request, including all required parameters and their proper formatting. Refer to the official documentation for language-specific SDKs or detailed implementation guides. ```go // Go example would go here. Please refer to the full documentation for specific implementation details. ``` -------------------------------- ### Full Demo: Initialize and Build Access Token in PHP Source: https://op.jinritemai.com/docs/guide-docs/1041_docLabel=1 This PHP demo shows how to set global app key and secret, build an access token, and then construct and execute an Open API request like AddressListRequest. ```php //设置appKey和appSecret,全局设置一次 GlobalConfig::getGlobalConfig()->appKey = "xxxxxxxx"; GlobalConfig::getGlobalConfig()->appSecret = "xxxxxxxx"; //创建Access Token $accessToken = AccessTokenBuilder::build(1111114035, ACCESS_TOKEN_SHOP_ID); if(!accessToken->isSuccess()) { //todo return; } //构建Open Api请求参数 $request = new AddressListRequest(); $param = new AddressListParam(); $request->setParam($param); $param->page_no = 1; $param->page_size = 10; $param->shop_id = 123456; //调用Open Api $request->execute($accessToken); ``` -------------------------------- ### Get Product Search Data API Request Examples Source: https://op.jinritemai.com/docs/api-docs/14/2768 Examples of how to call the 'Get Product Search Data' API using cURL, Java, PHP, Python, and .NET Core. These examples demonstrate the structure of the API request, including common and specific parameters. ```curl curlhttps://openapi-fxg.jinritemai.com/warehouse/info?app_key=your_appkey_here& method=warehouse.info&access_token=your_accesstoken_here¶m_json={}& timestamp=2018-06-19%2016:06:59&v=2&sign=your_sign_here ``` ```java // Java example is not provided in the text. ``` ```php // PHP example is not provided in the text. ``` ```python // Python example is not provided in the text. ``` ```csharp // .NET Core example is not provided in the text. ``` -------------------------------- ### Get Cart Schema API Request Example Source: https://op.jinritemai.com/docs/api-docs/13/2852 Example of how to call the supplyChain.cartSchema API to get the shopping cart jump schema. This API is free and does not require authorization. It is used for cross-border self-operated stores to link to the secondary landing page of the shopping cart. ```curl https://openapi-fxg.jinritemai.com/supplyChain/cartSchema?app_key=your_appkey_here& method=supplyChain.cartSchema&access_token=your_accesstoken_here¶m_json={}& timestamp=2018-06-19%2016:06:59&v=2&sign=your_sign_here ``` ```java // Java example not provided in the original text. // Please refer to the API documentation for integration details. ``` ```php // PHP example not provided in the original text. // Please refer to the API documentation for integration details. ``` ```python # Python example not provided in the original text. # Please refer to the API documentation for integration details. ``` ```go // Go example not provided in the original text. // Please refer to the API documentation for integration details. ``` ```csharp // .NET Core example not provided in the original text. // Please refer to the API documentation for integration details. ``` -------------------------------- ### Full Demo - PHP Source: https://op.jinritemai.com/docs/guide-docs/1041/1072 A comprehensive PHP example demonstrating configuration, authentication, and calling the `/address/list` endpoint. ```APIDOC ## Full Demo - PHP ### Description This PHP example shows how to set up global configuration with `AppKey` and `AppSecret`, create an access token using `AccessTokenBuilder`, and then construct and execute an `AddressListRequest`. ### Code Example (PHP) ```php // Set AppKey and AppSecret, initialize once globally GlobalConfig::getGlobalConfig()->appKey = "xxxxxxxx"; GlobalConfig::getGlobalConfig()->appSecret = "xxxxxxxx"; // Create Access Token $accessToken = AccessTokenBuilder::build(1111114035, ACCESS_TOKEN_SHOP_ID); if(!accessToken->isSuccess()) { // Handle error return; } // Construct Open API request parameters $request = new AddressListRequest(); $param = new AddressListParam(); $request->setParam($param); $param->page_no = 1; $param->page_size = 10; $param->shop_id = 123456; // Call Open API $request->execute($accessToken); ``` ``` -------------------------------- ### Address API: Get Areas By Province - Curl Example Source: https://op.jinritemai.com/docs/api-docs/16/1844 Example of how to call the getAreasByProvince API using curl. This demonstrates the structure of the request, including required parameters like app_key, access_token, and timestamp. ```shell curl -X GET "https://openapi-fxg.jinritemai.com/address/getAreasByProvince?app_key=your_appkey_here&method=address.getAreasByProvince&access_token=your_accesstoken_here¶m_json={}×tamp=2018-06-19%2016:06:59&v=2&sign=your_sign_here" ``` -------------------------------- ### Full Demo - Golang Source: https://op.jinritemai.com/docs/guide-docs/1041/1072 A comprehensive Golang example demonstrating configuration, authentication, and calling the `/address/list` endpoint. ```APIDOC ## Full Demo - Golang ### Description This Golang example demonstrates setting global `AppKey` and `AppSecret`, building an access token using `doudian_sdk.BuildAccessToken`, and then constructing and executing an `address_list_request`. ### Code Example (Golang) ```golang // Set AppKey and AppSecret, initialize once globally doudian_sdk.GlobalConfig.AppKey = "xxxxxxxx" doudian_sdk.GlobalConfig.AppSecret = "xxxxxxxxxx" // Create Access Token accessToken, err := doudian_sdk.BuildAccessToken(&doudian_sdk.BuildAccessTokenParam{ShopId: 4463798}) if err != nil { panic(err) } // Construct Open API request parameters request := address_list_request.New() request.GetParams().PageNo = 1 request.GetParams().PageSize = 10 request.GetParams().ShopId = 123456 // Call Open API response := request.Execute(accessToken) ``` ``` -------------------------------- ### Address API: Get Areas By Province - Go Example Source: https://op.jinritemai.com/docs/api-docs/16/1844 Demonstrates how to use the getAreasByProvince API with Go. This example covers the essential code structure for making API requests in Go, including error handling. ```go // Go example code would be provided here, illustrating the API integration. ``` -------------------------------- ### Request Example: createVirtualMobile API (Go) Source: https://op.jinritemai.com/docs/api-docs/1033/2739 Demonstrates how to make a request to the createVirtualMobile API using Go. The code includes the full API URL with placeholders for authentication and parameters. ```go url := "https://openapi-fxg.jinritemai.com/superm/createVirtualMobile?app_key=your_appkey_here&method=superm.createVirtualMobile&access_token=your_accesstoken_here¶m_json={}×tamp=2018-06-19%2016:06:59&v=2&sign=your_sign_here" // Further Go code to make the HTTP request would follow. ``` -------------------------------- ### PHP Request Example for Get Component Template Source: https://op.jinritemai.com/docs/api-docs/1438/5332 This snippet provides a PHP example for calling the getComponentTemplate API. It illustrates the structure of the request and the parameters required for querying size templates. ```php // PHP example would go here, demonstrating API call with parameters. ``` -------------------------------- ### Full Demo - JAVA Source: https://op.jinritemai.com/docs/guide-docs/1041/1072 A comprehensive Java example demonstrating configuration, authentication, and calling the `/address/list` endpoint, including error handling and setting up different environments. ```APIDOC ## Full Demo - JAVA ### Description This detailed Java example covers initializing the HTTP client, configuring timeouts, setting up headers for different environments (test, pre-production), initializing `AppKey` and `AppSecret`, building an `AccessToken`, and finally constructing and executing an `AddressListRequest`. ### Code Example (JAVA) ```java // Configuration Adjustments GlobalConfig.initHttpClientReadTimeout(12000); // Read timeout GlobalConfig.initHttpClientConnectTimeout(3000); // Connection timeout // If you need to target the test environment, add a debug header request.getConfig().addHttpRequestHeader("x-tt-env", "env"); // Specific value needs to be obtained from the business team request.getConfig().addHttpRequestHeader("x-use-boe", "1"); // If you need to target the pre-production environment, REMOVE this after going live, otherwise subsequent requests may have stability issues request.getConfig().addHttpRequestHeader("x-tt-env", "env"); // Specific value needs to be obtained from the business team request.getConfig().addHttpRequestHeader("x-use-ppe", "1"); // Set AppKey and AppSecret, initialize once globally GlobalConfig.initAppKey("6989147827339429420"); GlobalConfig.initAppSecret("284371ec-c15c-489e-9ce1-673b243603c6"); // If you have multiple AppKeys, initialize AppKey and its corresponding AppSecret GlobalConfig.AddAppKeyAndAppSecret("app_key", "app_secret"); // Build Access Token using different methods AccessToken ak = AccessTokenBuilder.buildWithAppKey(1234L, "app_key"); AccessToken ak = AccessTokenBuilder.buildWithAppKey("auth_code", "app_key"); AccessToken ak = AccessTokenBuilder.buildWithAppKey("auth_id", "auth_subject_type", "app_key"); // Create Access Token AccessToken accessToken = AccessTokenBuilder.build("263e343c-fd86-42c4-b724-36f732cb281c"); if(!accessToken.isSuccess()) { // Handle error return; } // Construct Open API request parameters AddressListRequest request = new AddressListRequest(); AddressListParam param = request.getParam(); param.setPageNo(1L); param.setPageSize(20L); param.setShopId(123456L); // Call Open API AddressListResponse response = null; try { response = request.execute(accessToken); // request.execute(null); // If calling an API that does not require authorization, pass null for accessToken } catch (DoudianOpException e) { // Handle exception } ``` ``` -------------------------------- ### Add Product API Request Example (Java) Source: https://op.jinritemai.com/docs/api-docs/1570/7445_docLabel=&from=list Example of how to construct an API request to add a product using Java. This includes setting up parameters and making the HTTP call. ```java String apiUrl = "https://openapi-fxg.jinritemai.com/instantShopping/product/addV2?app_key=your_appkey_here&method=instantShopping.product.addV2&access_token=your_accesstoken_here¶m_json={}×tamp=2018-06-19%2016:06:59&v=2&sign=your_sign_here"; // Construct param_json with product details here // Example: String paramJson = "{\"name\": \"Example Product\", \"price\": 1000}"; // Replace placeholder values with actual data // Execute HTTP POST request to apiUrl with paramJson ``` -------------------------------- ### Get Shop Role API Request Example (cURL) Source: https://op.jinritemai.com/docs/api-docs/59/1874 This snippet shows an example of how to call the iop.roleGet API using cURL. It includes placeholders for essential parameters like app_key, access_token, and sign. The param_json parameter is empty in this example, indicating no specific business parameters are required for this call. ```bash curl "https://openapi-fxg.jinritemai.com/iop/roleGet?app_key=your_appkey_here&method=iop.roleGet&access_token=your_accesstoken_here¶m_json={}×tamp=2018-06-19%2016:06:59&v=2&sign=your_sign_here" ``` -------------------------------- ### Manually Install Project Dependencies Source: https://op.jinritemai.com/docs/mona-docs If automatic dependency installation fails after project initialization, you can manually install them by navigating to the project's root directory and running either npm install or yarn. This ensures all necessary packages are present. ```bash npm install ``` ```bash yarn ``` -------------------------------- ### API Request Examples for Price Application Source: https://op.jinritemai.com/docs/api-docs/14/2699 Provides examples of how to call the batchApplyStoreProductPrice API using various programming languages. These examples demonstrate how to construct the request with necessary parameters like app_key, access_token, and param_json. ```curl https://openapi-fxg.jinritemai.com/superm/product/batchApplyStoreProductPrice? app_key=your_appkey_here&method=superm.product.batchApplyStoreProductPrice& access_token=your_accesstoken_here¶m_json={}×tamp=2018-06-19%2016:06:59&v=2& sign=your_sign_here ``` ```Java // Java example snippet would go here if provided in the source text ``` ```PHP // PHP example snippet would go here if provided in the source text ``` ```Python # Python example snippet would go here if provided in the source text ``` ```Go // Go example snippet would go here if provided in the source text ``` ```.NET Core // .NET Core example snippet would go here if provided in the source text ``` -------------------------------- ### Basic React Usage of Mona UI Mobile Button Source: https://op.jinritemai.com/docs/mona-mobile-site/readme This example shows a basic integration of the Mona UI Mobile library within a React application. It imports the Button component and renders it with specified properties. This requires the library to be installed and its CSS imported. ```jsx import '@bytedance/mona-ui-mobile/dist/es/index.css'; import { Button } from '@bytedance/mona-ui-mobile'; const App = () => ( <>