地址:https://open.cnipr.com/cnipr-api/v1/api/picture/pi4/{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 | sf1-v1或sf26-v1或sf28-v1返回的专利唯一ID | true | String |
| target | 第几个文件,从 1 开始 | true | String |
public class SearchClientTest {
String client_id = "CLIENT_ID";
String openid = "OPENID";
String access_token = "ACCESS_TOKEN";
/**
* 获取专利外观图片接口,redirect方法
*/
@Test
public void expSerachTest() throws Exception {
String url = "/v1/api/picture/pi4/"+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", "CN107433084B"));//公开(公告)号
nvps.add(new BasicNameValuePair("target", "1"));
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);
// TODO
httpClient.getConnectionManager().shutdown();
}
| 属性名称 | 属性说明 | 属性类型 |
|---|---|---|
| 此接口返回文件流,可直接用于<img>标签中 | Stream |