Contact

Class: Contact

Version 1.6 - Updated on 03/23/2017

Contents

Constructor Details

#initialize(session) ⇒ Contact

Returns a new instance of Contact

def initialize(session)  
  # Instance variables  
  @session = session  
end

Instance Method Details

contacts

#contacts(query, sort, page, count) ⇒ Object

Give contact information of the user

  • Arguments:

  • Returns:

    • A Hash object with contact information of the user
def contacts(query,sort,page,count)
  params = {
    "query" => query,
    "sort" => sort,
    "page" => page,
    "count" => count
  }
  response = @session.do_get "contacts", params
  Sdk::parse_response(response)
end

createContact

createContact(contactsdata)

Creates a new contact.

  • Arguments:
    • contactsdata - contact data in the json format.
  • Returns:

    • A Hash object
def createContact(contactsdata)
  params = contactsdata
  headers = {'Content-Type' => 'application/json'}
  response = @session.do_post "contacts", params, headers
  Sdk::parse_response(response, raw=true)
end

deleteContact

deleteContact(contactID)

Deletes specified contact.

  • Arguments:
    • contactID - ID of the contact
  • Returns:
    • A Hash object
def deleteContact(contactID)
  response = @session.do_delete_without_params "contacts/#{contactID}"
  Sdk::parse_response(response, raw=true)
end

updateContact

updateContact(contactID, contact_updateddata)

Updates specified contact.

  • Arguments:
    • contactID - ID of the contact
    • contactsdata - data to be updated in json format
  • Returns:
    • A Hash object
def updateContact(contactID,contact_updateddata)
  params = contact_updateddata
  headers = {'Content-Type' => 'application/json'}
  response = @session.do_put "contacts/#{contactID}", params, headers
  Sdk::parse_response(response,raw=true)
end

Copyright © 2015-2017, Verizon and/or its Licensors. All rights reserved.