Closed shyammohankanojia closed 10 years ago
Quoting http://stackoverflow.com/a/5773084
OmniAuth is meant to be used for the authentication process
Maybe you should try something like https://github.com/hexgnu/linkedin. Does this answer your question?
Thanks I used Linkedin Gem
Im using this gem to authenticate Linkedin users.
Step 3. Make the API calls https://developer.linkedin.com/documents/authentication Im able to access my connections with this token ttps://api.linkedin.com/v1/people/~?oauth2_access_token=AQXdSP_W41_UPs5ioT_t8HESyODB4FqbkJ8LrV_5mff4gPODzOYR
Is there any way i can post message to my connections.
This is small code
require "rest-client" require 'json' require 'multi_json' require 'hashie'
def send_message(subject, body, recipient_paths) path = "http://api.linkedin.com/v1/people/~/mailbox?oauth2_access_token=AQXdSP_W41_UPs5ioT_t8HESyODB4FqbkJ8LrV_5mff4gPODzOYR"
end
send_message("Welcome to mvi","Hi testing for new message", ["wEoHBvlFX0"])
HERE IS MY OUTPUT. {"content_type":"application/json","subject":"Welcome to mvi","body":"Hi testing for new message","recipients":{"values":[{"person":{"_path":"/people/wEoHBvlFX0"}}]}} /home/localadmin/.rvm/gems/ruby-1.9.3-p392/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!': 401 Unauthorized (RestClient::Unauthorized)