2012-09-21 5 views
1

LinkedIn 연결을 성공적으로 다운로드 할 수 있지만 이제 사용자에 대한 추가 객체 하나 (연결 수)를 얻으려고합니다. 문서는 "total"또는 "_ total"이 필요하다고 제안하는 것처럼 보이지만 모든 조합을 성공으로 시도했습니다. 내가 얻는 것은 "정의되지 않은"것입니다. 여기에 내가 총 수를 얻기 위해 노력하고있어 예와 코드는 다음과 같습니다Linkedin API - 연결 수를 얻으십시오.

IN.API.Connections("me") 
    .fields(["id", "firstName", "lastName", "mainAddress", "dateOfBirth", "phoneNumbers", "positions", "pictureUrl"]) 
    .params({"count":500}) 
    .error(displayError) 
    .result(function(result) { 

     document.write("1 ", result.values._total, "<br>"); 
     document.write("2 ", result.values.total, "<br>"); 

답변

0

은 JSON의 형식입니다 반환

{ 
    "_count": #, 
    "_start": #, 
    "_total": #, 
    "values": [ 
     { 
      ... 
     }, 
     { 
      ... 
     } 
    ] 
} 

그래서 사용자가 액세스 할 총 연결 수를 통해 반환 result._total.