python-linkedin icon indicating copy to clipboard operation
python-linkedin copied to clipboard

Cannot submit share with only a comment and an image

Open pg1671 opened this issue 10 years ago • 0 comments

If you want to submit a share that is only a comment and an image then the submit fails with a keyerror.

In the function submit_company_share the following code exists:

        if title is not None and submitted_url is not None:
            post['content'] = {
                'title': title,
                'submitted-url': submitted_url,
                'description': description,
            }
        if submitted_image_url:
            post['content']['submitted-image-url'] = submitted_image_url

content is only created if there is a title and a url. In this case trying to add an image url will cause the keyerror on content.

Is this by design? Does linkedin not allow for only a comment and an image?

The documentation at https://developer.linkedin.com/docs/company-pages#company_share does not prohibit the ability to only include the image_url in the content.

Thanks.

pg1671 avatar Jun 23 '15 01:06 pg1671