如何使用 Linkedin android SDK 获取所有可能的用户参数?
How to get all possible user parameters using Linkedin android SDK?
我在我的应用程序中使用 LinkedIn Android SDK 来验证 LinkedIn 用户。我在从 LinkedIn 检索有关用户的完整信息时遇到问题。
谁能帮我从 LinkedIn 获取所有可能的参数?我只能获得访问令牌。
获得令牌后,您需要发送 GET
请求至:
https://api.linkedin.com/v1/people/~
这将 return 用户的名字和姓氏。要获得附加字段,您可以将它们添加为查询参数。
例如
https://api.linkedin.com/v1/people/~:(id,num-connections,picture-url)?format=json
还将return ID、连接数和个人资料图片url。
您可以找到完整的参数列表 here. Check out the LinkedIn rest console 以获取更多示例和模板。
使用 LinkedIn SDK 调用 API:
String url = "https://api.linkedin.com/v1/people/~:(id,first-name,last-name)";
APIHelper apiHelper = APIHelper.getInstance(getApplicationContext());
apiHelper.getRequest(this, url, new ApiListener() {
@Override
public void onApiSuccess(ApiResponse apiResponse) {
// Success!
}
@Override
public void onApiError(LIApiError liApiError) {
// Error making GET request!
}
});
我在我的应用程序中使用 LinkedIn Android SDK 来验证 LinkedIn 用户。我在从 LinkedIn 检索有关用户的完整信息时遇到问题。
谁能帮我从 LinkedIn 获取所有可能的参数?我只能获得访问令牌。
获得令牌后,您需要发送 GET
请求至:
https://api.linkedin.com/v1/people/~
这将 return 用户的名字和姓氏。要获得附加字段,您可以将它们添加为查询参数。 例如
https://api.linkedin.com/v1/people/~:(id,num-connections,picture-url)?format=json
还将return ID、连接数和个人资料图片url。
您可以找到完整的参数列表 here. Check out the LinkedIn rest console 以获取更多示例和模板。
使用 LinkedIn SDK 调用 API:
String url = "https://api.linkedin.com/v1/people/~:(id,first-name,last-name)";
APIHelper apiHelper = APIHelper.getInstance(getApplicationContext());
apiHelper.getRequest(this, url, new ApiListener() {
@Override
public void onApiSuccess(ApiResponse apiResponse) {
// Success!
}
@Override
public void onApiError(LIApiError liApiError) {
// Error making GET request!
}
});