我想在Android应用程序中使用apigee android sdk。通过使用android sdk,我想连接apigee端点代理,但api代理已经获得Oauth 2.0验证。如何访问我们的代理?
//Create client entity
String ORGNAME = "your-org";
String APPNAME = "your-app";
ApigeeClient apigeeClient = new ApigeeClient(ORGNAME,APPNAME);
DataClient dataClient = apigeeClient.getDataClient();
String type = "item"; //entity type to be retrieved
Map queryString = null; //we don't need any additional query parameters, in this case
//call getCollectionAsync to initiate the asynchronous API call
dataClient.getCollectionAsync(type, queryString, new ApiResponseCallback() {
//If getEntitiesAsync fails, catch the error
@Override
public void onException(Exception e) {
// Error
}
//If getCollectionAsync is successful, handle the response object
@Override
public void onResponse(ApiResponse response) {
try {
if (response != null) {
// Success
}
} catch (Exception e) { //The API request returned an error
// Fail
}
}
});
答案 0 :(得分:1)
Android SDK目前不支持OAuth。