msgraph-sdk-ruby icon indicating copy to clipboard operation
msgraph-sdk-ruby copied to clipboard

how to update the contacts using graph?

Open naveen1336 opened this issue 8 years ago • 1 comments

  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 avatar Jan 01 '18 09:01 naveen1336

@naveen1336 you should set attributes for contact and than call method save it.

isaiev avatar Apr 13 '18 12:04 isaiev

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.

baywet avatar Jan 10 '23 19:01 baywet