资料库 API列表
联系我们
注册 登录

tms1 名称近似检索接口

  • 请求地址:

    地址:https://open.cnipr.com/cnipr-api/rs/api/trademark/tms1/{client_id}?openid={openid}&access_token={access_token}

  • 请求方法:

    HTTP POST

  • 请求参数:

    client_id,openid,access_token,dbs,exp,filter,from,to,order,displayCols,nameSection,nameOptions,nameText 参数含义见外观附录-检索分析参数

  • Postman 调用展示
    tms1.pn
  • 部分请求参数如下:
    {
        "dbs": "CN",
        "exp": "int_cls=02",
        "from": 0,
        "size": 5,
        "displayCols": "tm_name",
        "nameSection": "0",
        "nameText": "王师傅",
        "nameOptions": "0000,0001,0002,0003,0004,0100,0102,0200,0202,0302,0303,0400,0401,0402"
    }
                                                
  • Java + HTTP POST
    public class SearchClientTest {
    
    	String client_id = "";
    	String openid = "";
    	String access_token = "";
    
    	/**
    	 * 表达式+名称检索
    	 */
    	public void tms1Test() throws Exception {
    		String url = String.format("/rs/api/trademark/tms1/%s?openid=%s&access_token=%s",
    				client_id, openid, access_token);
    		String json = "{\"dbs\": \"CN\",\r\n  \"exp\": \"int_cls=02\", \"from\": 0, \"size\": 5,\"displayCols\": \"tm_name\",
    		\"nameSection\": \"0\",\"nameText\": \"王师傅\",\"nameOptions\": 
    		\"0000,0001,0002,0003,0004,0100,0102,0200,0202,0302,0303,0400,0401,0402\"}";
    		String result = this.POST(url, json);
    		System.out.println(result);
    	}
    
    	public String POST(String url, String json) throws Exception {
    		HttpClient httpClient = HttpClients.createDefault();
    		HttpPost httppost = new HttpPost(url);
    		httppost.setHeader("ContentType", "application/json");
    
    		StringEntity entity = new StringEntity(json, "UTF-8");
    		entity.setContentType("application/json");
    		httppost.setEntity(entity);
    
    		HttpResponse response = httpClient.execute(httppost);
    		HttpEntity result = response.getEntity();
    		String ss = EntityUtils.toString(result, "UTF-8");
    		EntityUtils.consume(entity);
    		return ss;
    	}
    }	
    
  • 响应参数:
    属性名称 属性说明 属性类型
    status 状态码,0代表成功,其它值含义见附录 long
    message 响应的信息描述 String
    total 命中总数 long
    from 分段检索,开始值 int
    to 分段检索,结束值 int
    records 检索结果 List<商标详细信息> -- 数据详细
段含义见商标附录-字段