CreateContact Method
Creates a new contact within the specified Google Contacts feed.
Syntax
gcontacts.createContact([callback])
Callback
The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).
The callback for this method is defined as:
function(err){ }
'err' is the error that occurred. If there was no error, then 'err' is 'null'.
'err' has 2 properties which hold detailed information:
err.code err.message
Remarks
The component will use the items contained within the following properties to create a new contact within the feed specified by FeedURL:
- FirstName
- LastName
- FullName
- Birthday
- HomeEmailAddress
- WorkEmailAddress
- HomePhoneNumber
- WorkPhoneNumber
- MobilePhoneNumber
- HomeIMAddress
- HomeIMProtocol
- WorkIMAddress
- WorkIMProtocol
- HomeAddress
- WorkAddress
- HomeWebsite
- WorkWebsite
- Nickname
- Gender
- Notes
- Deleted
- ContactEditURL
- ContactETag
- ContactProperties
Upon a successful creation, the response will be parsed and the above listed properties will be populated with the returned values. Thus all previous contacts contained by the component, prior to the CreateContact call, will be cleared and replaced with the response contact data. OtherHeaders will also be cleared and thus will need to be reset accordingly with each call made.