Getting S_412_PRECONDITION_FAILED=Invalid arguments error in Linkedin share api

佐手、 提交于 2019-12-11 05:58:22

问题


When try to update status with link in linkedin api i'm getting this error frequently.

Example Link: http://www.world-grain.com/articles/news_home/World_Grain_News/2016/06/General_Mills_files_patent_on.aspx?ID={30B4213B-4E10-4AF6-9B56-0D5614D7AFD3}&cck=1

If i remove the { and } from the link it get posted. Even in linkedin site itself its not working.

Help me if anyone know the reason.


回答1:


I was receiving the same error and the reason was that I didn't send values for all the keys in request's body. For example: "content" parameter in linkedin's request body is a dictionary with 4 keys:

  • title
  • description
  • submitted-url
  • submitted-image-url

I had no image url so I didn't set the key "submitted-image-url" at all. The solution was to set the value to empty string "".

I wonder why linkedin can't parse dictionary if it doesn't have all the keys but that's the way it works.

Hope this helps




回答2:


You may need to URL encode the braces in your link:

http://www.world-grain.com/articles/news_home/World_Grain_News/2016/06/General_Mills_files_patent_on.aspx?ID%3D%7B30B4213B-4E10-4AF6-9B56-0D5614D7AFD3%7D&cck=1

I ran into the same error when I attempted to pass a URL with spaces. It published successfully after URL encoding the spaces (%20).



来源:https://stackoverflow.com/questions/37806237/getting-s-412-precondition-failed-invalid-arguments-error-in-linkedin-share-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!