4

According to these docs, I'm supposed to request 'email-address': https://developer.linkedin.com/documents/profile-fields

I assume this works like any other user data call, so I'm going through the oauth process to get the right tokens, then doing the following (in Python using the oauth2 libary):

In [30]: url='http://api.linkedin.com/v1/people/~:(id,first-name,industry,email-address)'
In [31]: resp, content = client.request(url, 'GET')
In [32]: content
Out[32]: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<person>\n  <id>t0tImGn-yi</id>\n  <first-name>Jeff</first-name>\n  <industry>Computer Software</industry>\n</person>\n'

As you can see, the email address is not in the response.

I should also note that I tried specifying the scope in the requestToken request using this:

request_token_url = 'https://api.linkedin.com/uas/oauth/requestToken? scope=r_basic_profile+r_emailaddress'

Update: I found other docs here: https://developer.linkedin.com/documents/authentication#toggleview:id=python which seem to imply that I should be trying to access email by going here: resp, content = client.request('http://api.linkedin.com/v1/people/~/email-address', 'GET')

In this case, content returns "null"

Jeff
  • 1,051
  • 1
  • 13
  • 26
  • Did you try the above call with a new API key? API keys issued prior to this scoped permissions launching, do not support requesting additional permissions like the email-address. – Unpossible Aug 23 '12 at 22:35
  • 1
    That seems to be what's going on. I requested new keys and now I'm at least getting the up-to-date authentication screen for the oauth on their site. I'm still not getting the email, but I need to check and make sure it's not my fault this time. Thanks Paul. – Jeff Aug 24 '12 at 18:01

2 Answers2

1

You need to get new API-keys and then make requests as they are working on migration see this

Abhishek bhutra
  • 1,400
  • 1
  • 11
  • 29
0

Write "emailAdress" instead of "email-adress"

url='http://api.linkedin.com/v1/people/~:(id,first-name,industry,**emailAdress**)'
Robbert
  • 6,481
  • 5
  • 35
  • 61