### Implement startExportByDataset in Java Source: https://open.lazada.com/apps/doc/api?path=%2Ffbi%2Fdownload%2FstartExportByDataset Example showing how to initialize the LazopClient and execute a request for the startExportByDataset API. ```java LazopClient client = new LazopClient(url, appkey, appSecret); LazopRequest request = new LazopRequest(); request.setApiName("/fbi/download/startExportByDataset"); request.addApiParameter("oldSystemId", "22"); request.addApiParameter("useNewEngine", "true"); request.addApiParameter("appName", "1"); request.addApiParameter("secret", "1"); request.addApiParameter("workId", "1"); request.addApiParameter("datasetId", "1"); request.addApiParameter("fileType", "1"); request.addApiParameter("uploadType", "1"); request.addApiParameter("dispatchUserInfo", "1"); LazopResponse response = client.execute(request); System.out.println(response.getBody()); Thread.sleep(10); ``` -------------------------------- ### API Response Example Source: https://open.lazada.com/apps/doc/api?path=%2Ffbi%2Fdownload%2FstartExportByDataset JSON structure returned by the startExportByDataset API. ```json { "result": { "returnCode": "1", "returnValue": {}, "returnErrorStackTrace": "1", "returnMessage": "1" }, "code": "0", "request_id": "0ba2887315178178017221014" } ``` -------------------------------- ### Auth Token Response JSON Source: https://open.lazada.com/apps/doc/api?path=%2Fauth%2Ftoken%2Fcreate Example of a successful JSON response body returned by the token creation API. ```json { "access_token": "50000601c30atpedfgu3LVvik87Ixlsvle3mSoB7701ceb156fPunYZ43GBg", "country": "sg", "refresh_token": "500016000300bwa2WteaQyfwBMnPxurcA0mXGhQdTt18356663CfcDTYpWoi", "account_id": "7063844", "code": "0", "account_platform": "seller_center", "refresh_expires_in": "60", "country_user_info": [ { "country": "SG", "user_id": "1001", "seller_id": "1001", "short_code": "SG1001" } ], "expires_in": "10", "request_id": "0ba2887315178178017221014", "account": "xxx@126.com" } ``` -------------------------------- ### Generate Access Token API Source: https://open.lazada.com/apps/doc/api?path=%2Fauth%2Ftoken%2Fcreate This API endpoint is used to generate an access token for calling other Lazada APIs. It supports both GET and POST methods. ```APIDOC ## POST /auth/token/create ### Description Generates an access token for calling other Lazada APIs. This endpoint is part of the System API and does not require authorization. ### Method POST ### Endpoint /auth/token/create ### Parameters #### Query Parameters - **app_key** (String) - Required - Unique app ID issued by LAZADA Open Platform console. - **timestamp** (String) - Required - The time stamp of the request (e.g., 1517820392000) with less than 7200s difference from UTC time. - **access_token** (String) - Optional - API interface call credentials. - **sign_method** (String) - Required - The HMAC hash algorithm used to calculate the signature. - **sign** (String) - Required - Part of the authentication process for verifying the request. - **code** (String) - Required - OAuth code obtained from the app callback URL. - **uuid** (String) - Optional - This field is currently invalid and should not be used. ### Request Example ```json { "example": "POST /auth/token/create?app_key=YOUR_APP_KEY×tamp=1517820392000&sign_method=HmacSHA256&sign=YOUR_SIGN&code=OAUTH_CODE" } ``` ### Response #### Success Response (200) - **expires_in** (Number) - The expiring time of the access token, in seconds. - **account_id** (String) - Account ID. Allows null. If account_platform is 'seller_center', account_id is null. - **country** (String) - The country ID (sg:Singapore, my:Malaysia, ph:Philippines, th:Thailand, id:Indonesia, vn:Vietnam). - **country_user_info** (Object[]) - Country user details. - **country** (String) - The country ID (sg:Singapore, my:Malaysia, ph:Philippines, th:Thailand, id:Indonesia, vn:Vietnam). - **seller_id** (String) - Seller ID. - **user_id** (String) - User ID. - **short_code** (String) - Seller short code. - **account_platform** (String) - Account platform. - **access_token** (String) - Access token. - **account** (String) - User account (login user). - **refresh_expires_in** (String) - The expiring time of the refresh token. - **refresh_token** (String) - Refresh token, used to refresh the token when 'refresh_expires_in' > 0. #### Response Example ```json { "expires_in": 7200, "account_id": "123456789", "country": "sg", "country_user_info": [ { "country": "sg", "seller_id": "987654321", "user_id": "112233445", "short_code": "SELLER001", "account_platform": "seller_center" } ], "access_token": "YOUR_ACCESS_TOKEN", "account": "user@example.com", "refresh_expires_in": "7776000", "refresh_token": "YOUR_REFRESH_TOKEN" } ``` ``` -------------------------------- ### Generate Access Token API Source: https://open.lazada.com/apps/doc/api This API endpoint is used to generate an access token, which is required for calling other API methods. It supports both GET and POST requests. ```APIDOC ## POST /auth/token/create ### Description Generates an access token for calling Lazada APIs. No authorization is required for this endpoint. ### Method POST ### Endpoint /auth/token/create ### Parameters #### Query Parameters - **app_key** (String) - Required - Unique app ID issued by LAZADA Open Platform console. - **timestamp** (String) - Required - The time stamp of the request (e.g., 1517820392000) with less than 7200s difference from UTC time. - **sign_method** (String) - Required - The HMAC hash algorithm used to calculate the signature. - **sign** (String) - Required - Part of the authentication process used for identifying and verifying the sender. - **code** (String) - Required - OAuth code obtained from the app callback URL. - **access_token** (String) - Optional - API interface call credentials. - **uuid** (String) - Optional - This field is currently invalid, do not use this field. ### Request Example ```json { "app_key": "YOUR_APP_KEY", "timestamp": "1517820392000", "sign_method": "hmac-sha256", "sign": "YOUR_SIGNATURE", "code": "OAUTH_CODE" } ``` ### Response #### Success Response (200) - **expires_in** (Number) - The expiring time of the access token, in seconds. - **account_id** (String) - Account ID. Allows null. If account_platform is seller_center, account_id is null. - **country** (String) - The country ID (sg: Singapore, my: Malaysia, ph: Philippines, th: Thailand, id: Indonesia, vn: Vietnam). - **country_user_info** (Object[]) - Country user details. - **country** (String) - The country ID (sg: Singapore, my: Malaysia, ph: Philippines, th: Thailand, id: Indonesia, vn: Vietnam). - **user_id** (String) - User ID. - **seller_id** (String) - Seller ID. - **short_code** (String) - Seller short code. - **account_platform** (String) - Account platform. - **account** (String) - User account (login user). - **access_token** (String) - Access token. - **refresh_expires_in** (String) - The expiring time of the refresh token. - **refresh_token** (String) - Refresh token, used to refresh the token when "refresh_expires_in" > 0. #### Response Example ```json { "expires_in": 7200, "account_id": null, "country": "sg", "country_user_info": [ { "country": "sg", "user_id": "123456789", "seller_id": "987654321", "short_code": "SG-SELLER-001", "account_platform": "seller_center", "account": "seller@example.com" } ], "access_token": "YOUR_ACCESS_TOKEN", "refresh_expires_in": "7776000", "refresh_token": "YOUR_REFRESH_TOKEN" } ``` ``` -------------------------------- ### Create Auth Token Request in Java Source: https://open.lazada.com/apps/doc/api?path=%2Fauth%2Ftoken%2Fcreate Initializes the LazopClient and executes a request to the /auth/token/create endpoint. ```java LazopClient client = new LazopClient(url, appkey, appSecret); LazopRequest request = new LazopRequest(); request.setApiName("/auth/token/create"); request.addApiParameter("code", "0_100132_2DL4DV3jcU1UOT7WGI1A4rY91"); request.addApiParameter("uuid", "This field is currently invalid, do not use this field please"); LazopResponse response = client.execute(request); System.out.println(response.getBody()); Thread.sleep(10); ``` -------------------------------- ### Create Token with OpenId using Java Source: https://open.lazada.com/apps/doc/api?path=%2Fauth%2Ftoken%2FcreateWithOpenId Use this Java code to create an access token using an OpenID. Ensure you have the Lazop client library configured. ```java LazopClient client = new LazopClient(url, appkey, appSecret); LazopRequest request = new LazopRequest(); request.setApiName("/auth/token/createWithOpenId"); request.addApiParameter("code", "0_100132_2DL4DV3jcU1UOT7WGI1A4rY91"); request.addApiParameter("uuid", "This field is currently invalid, do not use this field please"); LazopResponse response = client.execute(request); System.out.println(response.getBody()); Thread.sleep(10); ``` -------------------------------- ### GET/POST /fbi/download/startExportByDataset Source: https://open.lazada.com/apps/doc/api?path=%2Ffbi%2Fdownload%2FstartExportByDataset This endpoint is used to initiate a download operation for a specific dataset. ```APIDOC ## GET/POST /fbi/download/startExportByDataset ### Description Open the download operation for a specified dataset. ### Method GET/POST ### Endpoint /fbi/download/startExportByDataset ### Parameters #### Query/Request Parameters - **oldSystemId** (String) - Optional - 222 - **useNewEngine** (String) - Optional - true - **appName** (String) - Required - 1 - **secret** (String) - Required - 1 - **workId** (String) - Required - 1 - **datasetId** (String) - Required - 1 - **fileType** (String) - Required - 1 - **uploadType** (String) - Required - 1 - **dispatchUserInfo** (String[]) - Optional - 1 ### Response #### Success Response (200) - **result** (Object) - 1 - **returnCode** (Number) - 1 - **returnValue** (Object) - 1 - **returnErrorStackTrace** (String) - 1 - **returnMessage** (String) - 1 #### Response Example { "result": { "returnCode": "1", "returnValue": {}, "returnErrorStackTrace": "1", "returnMessage": "1" }, "code": "0", "request_id": "0ba2887315178178017221014" } ``` -------------------------------- ### POST /auth/token/create Source: https://open.lazada.com/apps/doc/api?path=%2Fauth%2Ftoken%2Fcreate Exchanges an authorization code for an access token to authenticate API requests. ```APIDOC ## POST /auth/token/create ### Description This endpoint is used to exchange an authorization code for an access token. It is required for authenticating subsequent API calls. ### Method POST ### Endpoint /auth/token/create ### Parameters #### Query Parameters - **code** (string) - Required - The authorization code obtained from the callback URL. - **uuid** (string) - Optional - This field is currently invalid and should not be used. ### Request Example { "code": "0_100132_2DL4DV3jcU1UOT7WGI1A4rY91", "uuid": "" } ### Response #### Success Response (200) - **access_token** (string) - The token used for API authentication. - **refresh_token** (string) - The token used to refresh the access token. - **expires_in** (string) - Access token expiration time. - **refresh_expires_in** (string) - Refresh token expiration time. - **account_id** (string) - The unique identifier for the account. #### Response Example { "access_token": "50000601c30atpedfgu3LVvik87Ixlsvle3mSoB7701ceb156fPunYZ43GBg", "country": "sg", "refresh_token": "500016000300bwa2WteaQyfwBMnPxurcA0mXGhQdTt18356663CfcDTYpWoi", "account_id": "7063844", "code": "0", "account_platform": "seller_center", "refresh_expires_in": "60", "expires_in": "10", "request_id": "0ba2887315178178017221014", "account": "xxx@126.com" } ``` -------------------------------- ### GET/POST /auth/token/createWithOpenId Source: https://open.lazada.com/apps/doc/api?path=%2Fauth%2Ftoken%2FcreateWithOpenId Exchanges an authorization code for an access token to authenticate API requests. ```APIDOC ## GET/POST /auth/token/createWithOpenId ### Description This endpoint is used to create an access token using an authorization code obtained from the user authorization flow. ### Method GET/POST ### Endpoint /auth/token/createWithOpenId ### Parameters #### Request Body - **code** (string) - Required - The authorization code received from the authorization URL. - **uuid** (string) - Optional - This field is currently invalid and should not be used. ### Request Example ``` LazopClient client = new LazopClient(url, appkey, appSecret); LazopRequest request = new LazopRequest(); request.setApiName("/auth/token/createWithOpenId"); request.addApiParameter("code", "0_100132_2DL4DV3jcU1UOT7WGI1A4rY91"); LazopResponse response = client.execute(request); ``` ### Response #### Success Response (200) - **access_token** (string) - The token used for API authentication. - **refresh_token** (string) - Token used to refresh the access token. - **expires_in** (string) - Expiration time for the access token. - **account_id** (string) - The unique identifier for the account. #### Response Example { "access_token": "50000601c30atpedfgu3LVvik87Ixlsvle3mSoB7701ceb156fPunYZ43GBg", "country": "sg", "refresh_token": "500016000300bwa2WteaQyfwBMnPxurcA0mXGhQdTt18356663CfcDTYpWoi", "account_id": "7063844", "code": "0", "account_platform": "seller_center", "refresh_expires_in": "60", "expires_in": "10", "request_id": "0ba2887315178178017221014", "account": "xxx@126.com" } ``` -------------------------------- ### Generate Access Token with OpenID Source: https://open.lazada.com/apps/doc/api?path=%2Fauth%2Ftoken%2FcreateWithOpenId This endpoint allows you to generate an access token using an OpenID, which is required for calling other Lazada APIs. ```APIDOC ## POST /auth/token/createWithOpenId ### Description Generates an access token using an OpenID for authenticated API calls. ### Method POST ### Endpoint /auth/token/createWithOpenId ### Parameters #### Query Parameters - **app_key** (String) - Required - Unique app ID issued by LAZADA Open Platform console. - **timestamp** (String) - Required - The time stamp of the request (e.g., 1517820392000). - **access_token** (String) - Optional - API interface call credentials. - **sign_method** (String) - Required - The HMAC hash algorithm used to calculate the signature. - **sign** (String) - Required - Part of the authentication process for verifying the request. - **code** (String) - Required - OAuth code obtained from the app callback URL. - **uuid** (String) - Optional - This field is currently invalid, do not use. ### Request Example ```json { "example": "POST /auth/token/createWithOpenId?app_key=YOUR_APP_KEY×tamp=1517820392000&sign_method=HMAC-SHA256&sign=YOUR_SIGN&code=OAUTH_CODE" } ``` ### Response #### Success Response (200) - **expires_in** (Number) - The expiring time of the access token, in seconds. - **account_id** (String) - Account ID. Allows null. If account_platform is seller_center, account_id is null. - **country** (String) - The country ID (sg:Singapore, my:Malaysia, ph:Philippines, th:Thailand, id:Indonesia, vn:Vietnam). - **country_user_info** (Object[]) - Country user details. - **country** (String) - The country ID (sg:Singapore, my:Malaysia, ph:Philippines, th:Thailand, id:Indonesia, vn:Vietnam). - **user_id** (String) - User ID. - **short_code** (String) - Seller short code. - **account_platform** (String) - Account platform. - **access_token** (String) - Access token. - **account** (String) - User account (login user). - **refresh_expires_in** (String) - The expiring time of the refresh token. - **refresh_token** (String) - Refresh token, used to refresh the token when “refresh_expires_in” > 0. #### Response Example ```json { "expires_in": 7200, "account_id": "123456789", "country": "my", "country_user_info": [ { "country": "my", "user_id": "987654321", "short_code": "SELLER123", "account_platform": "seller_center", "access_token": "REFRESH_ACCESS_TOKEN", "account": "seller@example.com" } ], "refresh_expires_in": "7776000", "refresh_token": "REFRESH_TOKEN_VALUE" } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.