接入指南
接入流程

流程简介
1.
2.
api_name
(敏感信息可申请接口名)、field_name
(对应接口出参敏感信息字段)以及 package_code
(敏感信息申请能力 code 值)。3.
scene_code
(场景 code)及 scene_desc
(场景 code 描述)。4.
5.
第一步:设置主营行业类目
1.
2.
第二步:查询可申请接口出参敏感字段列表
请求示例
package com.java.sdk.demo;
import com.alipay.v3.ApiException;
import com.alipay.v3.ApiClient;
import com.alipay.v3.util.model.AlipayConfig;
import com.alipay.v3.Configuration;
import com.alipay.v3.api.AlipayOpenAppApiApi;
import com.alipay.v3.model.*;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AlipayOpenAppApiApiQuery {
public static void main(String[] args) throws ApiException {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// 初始化alipay参数(全局设置一次)
AlipayConfig alipayConfig = new AlipayConfig();
alipayConfig.setServerUrl("https://openapi.alipay.com");
alipayConfig.setAppId("<-- 请填写您的AppId,例如:2019091767145019 -->");
alipayConfig.setPrivateKey("<-- 请填写您的应用私钥,例如:MIIEvQIBADANB ... ... -->");
alipayConfig.setAlipayPublicKey("<-- 请填写您的支付宝公钥,例如:MIIBIjANBg... -->");
defaultClient.setAlipayConfig(alipayConfig);
AlipayOpenAppApiApi api = new AlipayOpenAppApiApi();
try {
AlipayOpenAppApiQueryResponseModel response = api.query();
} catch (ApiException e) {
AlipayOpenAppApiQueryDefaultResponse errorObject = (AlipayOpenAppApiQueryDefaultResponse) e.getErrorObject();
System.out.println("调用失败:" + errorObject);
}
}
}
响应示例
{
"code":"unknow-error",
"message":"系统繁忙"
}
第三步:查询接口字段使用场景
请求示例
package com.java.sdk.demo;
import com.alipay.v3.ApiException;
import com.alipay.v3.ApiClient;
import com.alipay.v3.util.model.AlipayConfig;
import com.alipay.v3.Configuration;
import com.alipay.v3.api.AlipayOpenAppApiSceneApi;
import com.alipay.v3.model.*;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AlipayOpenAppApiSceneApiQuery {
public static void main(String[] args) throws ApiException {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// 初始化alipay参数(全局设置一次)
AlipayConfig alipayConfig = new AlipayConfig();
alipayConfig.setServerUrl("https://openapi.alipay.com");
alipayConfig.setAppId("<-- 请填写您的AppId,例如:2019091767145019 -->");
alipayConfig.setPrivateKey("<-- 请填写您的应用私钥,例如:MIIEvQIBADANB ... ... -->");
alipayConfig.setAlipayPublicKey("<-- 请填写您的支付宝公钥,例如:MIIBIjANBg... -->");
defaultClient.setAlipayConfig(alipayConfig);
AlipayOpenAppApiSceneApi api = new AlipayOpenAppApiSceneApi();
String fieldName = "mobile";
String apiName = "alipay.user.info.share";
try {
AlipayOpenAppApiSceneQueryResponseModel response = api.query(fieldName, apiName);
} catch (ApiException e) {
AlipayOpenAppApiSceneQueryDefaultResponse errorObject = (AlipayOpenAppApiSceneQueryDefaultResponse) e.getErrorObject();
System.out.println("调用失败:" + errorObject);
}
}
}
响应示例
{
"code":"unknow-error",
"message":"系 统繁忙"
}
第四步:申请用户信息
请求示例
package com.java.sdk.demo;
import com.alipay.v3.ApiException;
import com.alipay.v3.ApiClient;
import com.alipay.v3.util.model.AlipayConfig;
import com.alipay.v3.Configuration;
import com.alipay.v3.api.AlipayOpenAppApiFieldApi;
import com.alipay.v3.model.*;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AlipayOpenAppApiFieldApiApply {
public static void main(String[] args) throws ApiException {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// 初始化alipay参数(全局设置一次)
AlipayConfig alipayConfig = new AlipayConfig();
alipayConfig.setServerUrl("https://openapi.alipay.com");
alipayConfig.setAppId("<-- 请填写您的AppId,例如:2019091767145019 -->");
alipayConfig.setPrivateKey("<-- 请填写您的应用私钥,例如:MIIEvQIBADANB ... ... -->");
alipayConfig.setAlipayPublicKey("<-- 请填写您的支付宝公钥,例如:MIIBIjANBg... -->");
defaultClient.setAlipayConfig(alipayConfig);
AlipayOpenAppApiFieldApi api = new AlipayOpenAppApiFieldApi();
AlipayOpenAppApiFieldApplyModel data = new AlipayOpenAppApiFieldApplyModel();
AuthFieldApply authFieldApply = new AuthFieldApply();
authFieldApply.setApiName("alipay.user.info.share");
authFieldApply.setPackageCode("20201019201538211864");
authFieldApply.setTinyAppTemplateId("小程序模板id");
authFieldApply.setSceneCode("6");
authFieldApply.setCustomerAnswer("有自己的客服团队xx人,能够及时响应并处理舆能力");
authFieldApply.setFieldName("mobile");
authFieldApply.setQpsAnswer("预计接口秒级调用量峰值:xx QPS");
authFieldApply.setMemo("获取xx的用途:(1)xxxx(2)xxxx");
data.setAuthFieldApply(authFieldApply);
File picture1 = new File("文件路径");
File picture2 = new File("文件路径");
File picture3 = new File("文件路径");
File picture4 = new File("文件路径");
File picture5 = new File("文件路径");
File video = new File("文件路径");
try {
Object response = api.apply(data, picture1, picture2, picture3, picture4, picture5, video);
} catch (ApiException e) {
AlipayOpenAppApiFieldApplyDefaultResponse errorObject = (AlipayOpenAppApiFieldApplyDefaultResponse) e.getErrorObject();
System.out.println("调用失败:" + errorObject);
}
}
}
预计接口秒级调用量峰值:xx QPS
。有自己的客服团队 xx 人,能够及时响应并处理舆能力
。获取审核结果
用户信息申请记录查询
请求示例
package com.java.sdk.demo;
import com.alipay.v3.ApiException;
import com.alipay.v3.ApiClient;
import com.alipay.v3.util.model.AlipayConfig;
import com.alipay.v3.Configuration;
import com.alipay.v3.api.AlipayOpenAppApiFieldApi;
import com.alipay.v3.model.*;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AlipayOpenAppApiFieldApiQuery {
public static void main(String[] args) throws ApiException {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// 初始化alipay参数(全局设置一次)
AlipayConfig alipayConfig = new AlipayConfig();
alipayConfig.setServerUrl("https://openapi.alipay.com");
alipayConfig.setAppId("<-- 请填写您的AppId,例如:2019091767145019 -->");
alipayConfig.setPrivateKey("<-- 请填写您的应用私钥,例如:MIIEvQIBADANB ... ... -->");
alipayConfig.setAlipayPublicKey("<-- 请填写您的支付宝公钥,例如:MIIBIjANBg... -->");
defaultClient.setAlipayConfig(alipayConfig);
AlipayOpenAppApiFieldApi api = new AlipayOpenAppApiFieldApi();
try {
AlipayOpenAppApiFieldQueryResponseModel response = api.query();
} catch (ApiException e) {
AlipayOpenAppApiFieldQueryDefaultResponse errorObject = (AlipayOpenAppApiFieldQueryDefaultResponse) e.getErrorObject();
System.out.println("调用失败:" + errorObject);
}
}
}
响应示例
{
"code":"unknow-error",
"message":"系统繁忙"
}
审核消息通知

修改于 2023-11-27 03:01:56