问题描述:

I want to send messages to multiple friends in linkedin using python.

from docs : http://code.google.com/p/python-linkedin/

Using this one can send that.

result = api.SendMessage("This is a subject", "This is the body", ["ID1", "ID2", "ID3"])

But I am not able to use that. Can anyyone tell me what is ID1? ID2? etc?

网友答案:

You can only message first degree connections. So, to get valid ids, I'm guessing the code looks something like:

>>> connections = api.Getconnections() # connections is a list of Profile instances
>>> connections
>>> [<linkedin.linkedin.Profile object at 0x1a3d510>]
>>> connections[0].id
>>> 'js6vz2-D6x'
>>> result = api.SendMessage("This is a subject", "This is the body", [connections[0].id, connections[1].id, connections[2].id])
网友答案:

They are the ID's for the people you wish to send a message to. instead of ['ID1', 'ID2', 'ID3'], try using send_yourself = True to make sure what you are doing works. So it will be:

result = api.SendMessage("This is a subject", "This is the body", send_yourself = True)
相关阅读:
Top