简体   繁体   中英

linkedin from python : unable to send multiple messages

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM