2016-04-12 9 views
1

mir den LinkedIn Android SDK von here (Version 1.1.4) heruntergeladen haben und habe bereits die Authentifizierung einrichten wie folgt aus:fehlende Felder im Profil von LinkedIn Android SDK

liSessionManager.init(activity, 
       Scope.build(Scope.R_BASICPROFILE, Scope.R_EMAILADDRESS), authListener); 

und alles funktioniert gut, aber Wenn ich die Profildaten erhalten möchte, gibt jsons Felder wie summary in Job-Positionen und allgemeine Zusammenfassung für das angegebene Profil.

apiHelper.getRequest(activity, GET_LINKED_IN_PROFILE_URL, apiListener); 

wo GET_LINKED_IN_PROFILE_URLhttps://api.linkedin.com/v1/people/~:(id,first-name,last-name,email-address,formatted-name,headline,location,industry,current-share,num-connections,num-connections-capped,summary,specialties,positions,phone-numbers,public-profile-url,picture-url,picture-urls::(original))?format=json ist:

wird die Anfrage wie folgt hergestellt.

Die Antwort lautet wie folgt:

{ 
    "currentShare": { 
    "author": { 
     "firstName": "Name", 
     "id": "***", 
     "lastName": "Surname" 
    }, 
    "comment": "I've made my LinkedIn profile visual! Check it out and get yours!", 
    "content": { 
     "description": "some descr", 
     "eyebrowUrl": "http://url.com/me/7827748?m_in&user_id=***", 
     "resolvedUrl": "http://url.com/me/7827748?m_in&user_id=***", 
     "shortenedUrl": "http://linkedin.in/url", 
     "submittedImageUrl": "https://www.url.com/logo-share.png", 
     "submittedUrl": "https://www.url.com/me/***?m_in&user_id=***", 
     "thumbnailUrl": "https://media.licdn.com/media-proxy/ext?w=80&h=100&f=&hash=usON2E%2F4FqEGtIT5dsadsaaD&ora=1%2CaFBCTXdkRmpGL2lvQUFBPQ%2CxAVta5g-0R65wFUbzx0776dsaulz-50hKCpDZEXX8HmW3uZHfgasdapuGJ-n08ARIZ3Bex1svPLf5AmX_Us3r", 
     "title": "title" 
    }, 
    "id": "s1291360434", 
    "source": { 
     "application": {"name": "app"}, 
     "serviceProvider": {"name": "LINKEDIN"} 
    }, 
    "timestamp": 1346884888000, 
    "visibility": {"code": "anyone"} 
    }, 
    "emailAddress": "***@gmail.com", 
    "firstName": "Name", 
    "formattedName": "Name Surname", 
    "headline": "Job position", 
    "id": "***", 
    "industry": "Computer Software", 
    "lastName": "Surname", 
    "location": { 
    "country": {"code": "pl"}, 
    "name": "Wroclaw, Lower Silesian District, Poland" 
    }, 
    "numConnections": 229, 
    "numConnectionsCapped": false, 
    "pictureUrl": "https://media.licdn.com/mpr/mprx/photourl", 
    "pictureUrls": { 
    "_total": 1, 
    "values": ["https://media.licdn.com/mpr/mprx/photourl"] 
    }, 
    "positions": { 
    "_total": 1, 
    "values": [{ 
     "company": { 
     "id": 2795963, 
     "industry": "Information Technology & Services", 
     "name": "Company 1", 
     "size": "11-50", 
     "type": "Privately Held" 
     }, 
     "id": ***, 
     "isCurrent": true, 
     "location": { 
     "country": { 
      "code": "pl", 
      "name": "Poland" 
     }, 
     "name": "Wroclaw, Lower Silesian District, Poland" 
     }, 
     "startDate": { 
     "month": 1, 
     "year": 2016 
     }, 
     "title": "Job position" 
    }] 
    }, 
    "publicProfileUrl": "https://www.linkedin.com/in/username/41219" 
} 

Wenn ich die gleiche URL in der API-Konsole bei https://apigee.com/console/linkedin verwenden, die Antwort wie folgt aussieht:

{ 
    "currentShare": { 
    "author": { 
     "firstName": "Name", 
     "id": "***", 
     "lastName": "Surname" 
    }, 
    "comment": "I've made my LinkedIn profile visual! Check it out and get yours!", 
    "content": { 
     "description": "some descr", 
     "eyebrowUrl": "http://url.com/me/7827748?m_in&user_id=***", 
     "resolvedUrl": "http://url.com/me/7827748?m_in&user_id=***", 
     "shortenedUrl": "http://linkedin.com/shortened", 
     "submittedImageUrl": "https://www.url.com/logo-share.png", 
     "submittedUrl": "https://www.url.com/me/***?m_in&user_id=***", 
     "thumbnailUrl": "https://media.licdn.com/media-proxy/ext?w=80&h=100&f=&hash=usON2E%2F4FqEGtIT5dsadsaaD&ora=1%2CaFBCTXdkRmpGL2lvQUFBPQ%2CxAVta5g-0R65wFUbzx0776dsaulz-50hKCpDZEXX8HmW3uZHfgasdapuGJ-n08ARIZ3Bex1svPLf5AmX_Us3r", 
     "title": "title" 
    }, 
    "id": "s1291360434", 
    "source": { 
     "application": { 
     "name": "app" 
     }, 
     "serviceProvider": { 
     "name": "LINKEDIN" 
     } 
    }, 
    "timestamp": 1346884888000, 
    "visibility": { 
     "code": "anyone" 
    } 
    }, 
    "emailAddress": "***@gmail.com", 
    "firstName": "Name", 
    "formattedName": "Name Surname", 
    "headline": "Job position", 
    "id": "***", 
    "industry": "Computer Software", 
    "lastName": "Surname", 
    "location": { 
    "country": { 
     "code": "pl" 
    }, 
    "name": "Wroclaw, Lower Silesian District, Poland" 
    }, 
    "numConnections": 229, 
    "numConnectionsCapped": false, 
    "pictureUrl": "https://media.licdn.com/mpr/mprx/photourl", 
    "pictureUrls": { 
    "_total": 1, 
    "values": [ 
     "https://media.licdn.com/mpr/mprx/photourl" 
    ] 
    }, 
    "positions": { 
    "_total": 1, 
    "values": [ 
     { 
     "company": { 
      "id": 2795963, 
      "industry": "Information Technology & Services", 
      "name": "Company 1", 
      "size": "11-50", 
      "type": "Privately Held" 
     }, 
     "id": 22222, 
     "isCurrent": true, 
     "location": { 
      "country": { 
      "code": "pl", 
      "name": "Poland" 
      }, 
      "name": "Wroclaw, Lower Silesian District, Poland" 
     }, 
     "startDate": { 
      "month": 1, 
      "year": 2016 
     }, 
     "title": "Job position" 
     }, 
     { 
     "company": { 
      "id": 611639, 
      "industry": "Internet", 
      "name": "Company 2", 
      "size": "51-200", 
      "type": "Privately Held" 
     }, 
     "endDate": { 
      "month": 2, 
      "year": 2016 
     }, 
     "id": 1111, 
     "isCurrent": false, 
     "location": { 
      "country": { 
      "code": "pl", 
      "name": "Poland" 
      }, 
      "name": "Wroclaw, Lower Silesian District, Poland" 
     }, 
     "startDate": { 
      "month": 4, 
      "year": 2015 
     }, 
     "summary": "Summary of job", 
     "title": "Senior Android Developer" 
     }, 
     { 
     "company": { 
      "id": 1111, 
      "industry": "Internet", 
      "name": "Company 2", 
      "size": "51-200", 
      "type": "Privately Held" 
     }, 
     "endDate": { 
      "month": 3, 
      "year": 2015 
     }, 
     "id": 111111, 
     "isCurrent": false, 
     "location": { 
      "country": { 
      "code": "pl", 
      "name": "Poland" 
      }, 
      "name": "Wroclaw, Lower Silesian District, Poland" 
     }, 
     "startDate": { 
      "month": 4, 
      "year": 2014 
     }, 
     "summary": "short summary", 
     "title": "Android/iOS Developer" 
     }, 
     { 
     "company": { 
      "id": 11111, 
      "industry": "Internet", 
      "name": "Company 2", 
      "size": "51-200", 
      "type": "Privately Held" 
     }, 
     "endDate": { 
      "month": 3, 
      "year": 2014 
     }, 
     "id": 1111111, 
     "isCurrent": false, 
     "location": { 
      "country": { 
      "code": "pl", 
      "name": "Poland" 
      }, 
      "name": "Wroclaw, Lower Silesian District, Poland" 
     }, 
     "startDate": { 
      "month": 2, 
      "year": 2013 
     }, 
     "summary": "android applications developer.\ncross-platform mobile application testing (iOS, Windows 8)", 
     "title": "Junior Android Developer" 
     }, 
     { 
     "company": { 
      "id": 3333, 
      "industry": "Information Technology & Services", 
      "name": "Company 3", 
      "size": "201-500", 
      "type": "Privately Held" 
     }, 
     "endDate": { 
      "month": 11, 
      "year": 2011 
     }, 
     "id": 3333333, 
     "isCurrent": false, 
     "location": { 
      "country": { 
      "code": "pl", 
      "name": "Poland" 
      }, 
      "name": "Warsaw, Masovian District, Poland" 
     }, 
     "startDate": { 
      "month": 7, 
      "year": 2011 
     }, 
     "summary": "Intern ", 
     "title": "Internship" 
     } 
    ] 
    }, 
    "publicProfileUrl": "https://www.linkedin.com/in/username/41219" 
} 

die zeigt, dass die Antwort des Android SDK fehlen einige Stellen und eine Zusammenfassung für ein Profil.

Antwort

0

Es stellte sich heraus, dass LinkedIn keine Felder zurückgibt, die keinen Wert haben. Wenn Sie in Ihrem Profil keine Zusammenfassung einrichten, wird in der Antwort kein Feld summary angezeigt. (Erwarten Sie nichts wie)

Zusätzlich wird nur die erste Position für ein bestimmtes Profil zurückgegeben, während der Bereich r_basicprofile verwendet wird. Es ist verwirrend, da dieses eine Profil im Array positions zurückgegeben wird.

basierend auf https://developer.linkedin.com/docs/fields/basic-profile:

Positionen - Ein Objekt die aktuelle Position des Element darstellt. Eine Beschreibung der in diesem Objekt verfügbaren Felder finden Sie unter Positionsfelder.

Der Grund, warum die Antwort des API Console alle Arbeitsplätze wurde mit, weil es für r_fullprofile Umfang gefragt, während

Authentifizierung