I've gone through the authentication and am receiving the correct data from LinkedIn and receiving a response as shown in this link:
https://developer.linkedin.com/docs/ref/v2/profile/profile-picture
However, I'm unsure how to extract the image from this:
"displayImage": "urn:li:digitalmediaAsset:C4D03AQGsitRwG8U8ZQ",
Do I need to make another request for the image url next?
Using the API for LinkedIn, you can get detailed information about LinkedIn groups based on the ID of the target groups. Below are some of the data you can get: ID, name, date of creation, logo, description, location, industries, etc. Learn more in the LinkedIn API documentation.
For anyone else looking, I overlooked there is an identifier
field like so with a url:
"identifiers": [
{
"identifier": "https://media.licdn.com/dms/image/C4D03AQGsitRwG8U8ZQ/profile-displayphoto-shrink_100_100/0?e=1526940000&v=alpha&t=12345",
"file": "urn:li:digitalmediaFile: (urn:li:digitalmediaAsset:C4D03AQGsitRwG8U8ZQ,urn:li:digitalmediaMediaArtifactClass:profile-displayphoto-shrink_100_100,0)",
"index": 0,
"mediaType": "image/jpeg",
"identifierExpiresInSeconds": 1526940000
}
To get the above response in ruby I'm doing the following:
url = 'https://api.linkedin.com/v2/me?projection=(id,firstName,lastName,profilePicture(displayImage~:playableStreams))'
res = RestClient.get(url, Authorization: "Bearer #{access_token}")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With