JAVA development SDK example

1 min read

java sdk

-Version iteration log

Development languageSupportVersionNotesDownload link
javayes1.0.0bate versionclick to download

Error handling

Interface request error, verification failed. Will be thrown as Exception, please handle the exception by yourself and record the log

Call example

package com.example.cpsopenapi;

import com.cps.opensdk.ApiService;
import com.cps.opensdk.CpsOpenApi;

import java.util.HashMap;
import java.util.Map;


        String appKey = "your appkey"; //Media application AppKey
        String appSecret = "your secret"; //Media application AppSecret
        CpsOpenApi api = new CpsOpenApi(appKey, appSecret); //Initialize instance

        String service_b1688_products = "cps-mesh.cpslink.b1688.products.get";//1688 product library search interface
        Map param = new HashMap<String, Object>(); //Construct interface parameters
        param.put("query", "clothes");

        String result = api.doReq(service_b1688_products, param);
        System.out.println("" + result); //The current return result is the original content returned by the server