地址:https://open.cnipr.com/cnipr-api/v1/api/picture/pc1/{client_id}
HTTP GET
| 参数名称 | 参数说明 | 是否必填 | 参数类型 |
|---|---|---|---|
| client_id | 应用id,如没有clientId请先接入应用,查看接入流程获取 | true | String |
| openid | 用户id,可通过 Password Grant 方式 或 Implicit Grant 方式 或 Authorization Code 方式 获取 | true | String |
| access_token | 访问令牌,可通过
Password Grant 方式 或
Implicit Grant 方式 或
Authorization Code 方式或
Refresh Token 方式 |
true | String |
| pid | 公开(公告)号或库名@公开(公告)号,多个用半角逗号分隔,最多不超过50个 | true | String |
public class SearchClientTest {
String client_id = "CLIENT_ID";
String openid = "OPENID";
String access_token = "ACCESS_TOKEN";
/**
* 获取专利外观图片接口,返回资源路径
*/
@Test
public void expSerachTest() throws Exception {
String url = "/v1/api/picture/pc1/"+client_id;
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
// 提交参数及值
nvps.add(new BasicNameValuePair("openid", openid));
nvps.add(new BasicNameValuePair("access_token", access_token));
nvps.add(new BasicNameValuePair("pid", "FMZL@CN1826487A,CN207235696U"));
this.get(url, nvps);
}
public void get(String url, List<NameValuePair> nvps) throws Exception {
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(url);
String str = EntityUtils.toString(new UrlEncodedFormEntity(nvps,"UTF-8"));
httpGet.setURI(new URI(httpGet.getURI().toString() + "?" + str));
HttpResponse response = httpClient.execute(httpGet);
HttpEntity entity = response.getEntity();
String ss = EntityUtils.toString(entity, "UTF-8");
//打印返回结果
System.out.println(ss);
EntityUtils.consume(entity);
httpClient.getConnectionManager().shutdown();
}
| 属性名称 | 属性说明 | 属性类型 |
|---|---|---|
| status | 状态码,0代表成功,其它值含义见附录 | long |
| message | 静态资源路径 | String |
| total | 命中总数 | long |
| results | 检索结果集 | String[] -- 数据详细 |