【发布时间】:2016-06-13 22:58:43
【问题描述】:
如何通过 LinkedIn android SDK 对 LinkedIn 帖子发表评论,
我尝试了 POST 中的方法,但它不起作用,文档 LINK 似乎没有工作。下面是我用来评论LinkedIn帖子的代码
String url = "http://api.linkedin.com/v1/people/~/network/updates/key={UPDATE-KEY}/update-comments?format=json";
String shareJsonText = "{\"update-comment\":{\"comment\":\"test comment...\"}}";
APIHelper apiHelper = APIHelper.getInstance(getApplicationContext());
apiHelper.postRequest(ApiActivity.this, url, shareJsonText, new ApiListener() {
@Override
public void onApiSuccess(ApiResponse apiResponse) {
}
@Override
public void onApiError(LIApiError error) {
}
});
它给出了以下错误
exceptionMsg: java.io.IOException: No authentication challenges found
com.android.volley.NoConnectionError: java.io.IOException: No authentication challenges found
我已使用以下代码成功在linkedIn上发帖
String commentUrl = "http://" + host + "/v1/people/~/network/updates/key=";
String shareJsonText = "{ \n" +
" \"comment\":\"" + shareComment.getText() + "\"," +
" \"visibility\":{ " +
" \"code\":\"anyone\"" +
" }," +
" \"content\":{ " +
" \"title\":\"Test Share Title\"," +
" \"description\":\"Description text\"," +
" \"submitted-url\":\"https://www.google.com\"," +
" \"submitted-image-url\":\"http://www.google.com/images/logo1.png\"" +
" }" +
"}";
APIHelper apiHelper = APIHelper.getInstance(getApplicationContext());
apiHelper.postRequest(ApiActivity.this, commentUrl , shareJsonText , new ApiListener() {
@Override
public void onApiSuccess(ApiResponse apiResponse) {
}
@Override
public void onApiError(LIApiError error) {
}
});
但不知道如何评论帖子。
谁能帮我找到我成功评论所缺少的东西是他们任何可用于发布 cmets 的官方文档,因为我在 LinkedIn 开发人员页面上没有找到任何官方文档
【问题讨论】:
标签: android linkedin linkedin-api