linkedin-oauth2
linkedin-oauth2 copied to clipboard
Using example in Readme `add_share(comment: 'Hi') returns 400
There is something incorrect about the syntax.
api.shares
=> {"total"=>0}
But if I do
api.add_share(content: "hi")
Faraday::ClientError: the server responded with status 400
But respectfully so, LinkedIn API is looking for comment not content , and I were to do
api_add_share(comment: 'hi')
It produces the same error. Has anyone gotten add_share to work recently?
This is fixed here https://github.com/emorikawa/linkedin-oauth2/pull/12
I'm still having this issue in add_share. Do I miss something?
I am getting the same issue as well
I got it working with comment instead of content
api.add_share(comment: 'Hi!')
By using content instead of comment I was getting this error in faraday
https://gist.github.com/rahult/e219f192b495ae954f03
I'm getting the same issue, I tried with comment and content, and in both cases I'm getting 400. The w_share is checked on my Linkedin app. Any thoughts?
The problem reported here is fixed in the Git repo, but the author has not updated the gem on rubygems.org :(
To work around this you can install the gem like so in your Gemfile:
gem 'linkedin-oauth2', github: 'emorikawa/linkedin-oauth2', ref: 'ceb63460b8b45b7e00766ae3a4c3e361d76c6ffc'
The above is referencing the last git commit, you should double check it's still the last commit.
Also, be sure you use the syntax api.add_share(comment: 'Hi!') as stated above. In addition to the comment property, you can include a content property, but that content is a hash describing the content you are sharing. Check the LinkedIn Share API for the details.
Hey, just bumping this. @sunild 's solution works for me, but it would be really great to get the rubygems page updated so that our gemfiles don't have to be pegged to a particular ref in case there are any updates. @emorikawa ? -- (And thanks for a very helpful gem!)
Hey, I have followed @sunild suggestion but no success, I am still getting ``on_complete': the server responded with status 400 ` Can you please give me a simple code example of authenticating and sharing a comment/content
Thank you very much