msgraph-sdk-ruby
msgraph-sdk-ruby copied to clipboard
how to update the contacts using graph?
token = get_access_token
email = session[:user_email]
if token
# If a token is present in the session, get contacts
callback = Proc.new do |r|
r.headers['Authorization'] = "Bearer #{token}"
r.headers['X-AnchorMailbox'] = email
end
graph = MicrosoftGraph.new(base_url: 'https://graph.microsoft.com/v1.0/',
cached_metadata_file: File.join(MicrosoftGraph::CACHED_METADATA_DIRECTORY, 'metadata_v1.0.xml'),
&callback)
graph.me.contacts.first.update(:given_name => "ashish") no method update
@naveen1336 you should set attributes for contact and than call method save it.
Thanks for reporting this issue. That version of the SDK has been deprecated a number of years ago. We're now starting the work on a new generation of this SDK and you can learn all about it on the updated readme page.