Modules@robinpath/google-contacts
google-contacts

@robinpath/google-contacts

0.1.1Node.jsPublic

Google Contacts module for RobinPath.

Google Contacts

Google Contacts module for RobinPath.

Package: @robinpath/google-contacts | Category: Productivity | Type: Integration

Authentication

google-contacts.setCredentials "your-credentials"

Call this once at the start of your script before using any other function. Credentials persist for the duration of the script execution.

Use Cases

Use the google-contacts module when you need to:

  • listContacts -- Use google-contacts.listContacts to perform this operation
  • getContact -- Use google-contacts.getContact to perform this operation
  • createContact -- Use google-contacts.createContact to perform this operation
  • updateContact -- Use google-contacts.updateContact to perform this operation
  • deleteContact -- Use google-contacts.deleteContact to perform this operation

Quick Reference

FunctionDescriptionReturns
setCredentialsConfigure google-contacts credentials.object
listContactslistContactsobject
getContactgetContactobject
createContactcreateContactobject
updateContactupdateContactobject
deleteContactdeleteContactobject
searchContactssearchContactsobject
listContactGroupslistContactGroupsobject
getContactGroupgetContactGroupobject
createContactGroupcreateContactGroupobject
updateContactGroupupdateContactGroupobject
deleteContactGroupdeleteContactGroupobject
batchGetContactsbatchGetContactsobject
getOtherContactsgetOtherContactsobject
getProfilegetProfileobject
listDirectoryPeoplelistDirectoryPeopleobject
updateContactPhotoupdateContactPhotoobject

Functions

setCredentials

Configure google-contacts credentials.

Module: google-contacts | Returns: object -- API response.

google-contacts.setCredentials
ParameterTypeRequiredDescription
accessTokenstringYesaccessToken

listContacts

listContacts

Module: google-contacts | Returns: object -- API response.

google-contacts.listContacts
ParameterTypeRequiredDescription
inputstringNoInput parameter

getContact

getContact

Module: google-contacts | Returns: object -- API response.

google-contacts.getContact
ParameterTypeRequiredDescription
inputstringNoInput parameter

createContact

createContact

Module: google-contacts | Returns: object -- API response.

google-contacts.createContact
ParameterTypeRequiredDescription
inputstringNoInput parameter

updateContact

updateContact

Module: google-contacts | Returns: object -- API response.

google-contacts.updateContact
ParameterTypeRequiredDescription
inputstringNoInput parameter

deleteContact

deleteContact

Module: google-contacts | Returns: object -- API response.

google-contacts.deleteContact
ParameterTypeRequiredDescription
inputstringNoInput parameter

searchContacts

searchContacts

Module: google-contacts | Returns: object -- API response.

google-contacts.searchContacts
ParameterTypeRequiredDescription
inputstringNoInput parameter

listContactGroups

listContactGroups

Module: google-contacts | Returns: object -- API response.

google-contacts.listContactGroups
ParameterTypeRequiredDescription
inputstringNoInput parameter

getContactGroup

getContactGroup

Module: google-contacts | Returns: object -- API response.

google-contacts.getContactGroup
ParameterTypeRequiredDescription
inputstringNoInput parameter

createContactGroup

createContactGroup

Module: google-contacts | Returns: object -- API response.

google-contacts.createContactGroup
ParameterTypeRequiredDescription
inputstringNoInput parameter

updateContactGroup

updateContactGroup

Module: google-contacts | Returns: object -- API response.

google-contacts.updateContactGroup
ParameterTypeRequiredDescription
inputstringNoInput parameter

deleteContactGroup

deleteContactGroup

Module: google-contacts | Returns: object -- API response.

google-contacts.deleteContactGroup
ParameterTypeRequiredDescription
inputstringNoInput parameter

batchGetContacts

batchGetContacts

Module: google-contacts | Returns: object -- API response.

google-contacts.batchGetContacts
ParameterTypeRequiredDescription
inputstringNoInput parameter

getOtherContacts

getOtherContacts

Module: google-contacts | Returns: object -- API response.

google-contacts.getOtherContacts
ParameterTypeRequiredDescription
inputstringNoInput parameter

getProfile

getProfile

Module: google-contacts | Returns: object -- API response.

google-contacts.getProfile
ParameterTypeRequiredDescription
inputstringNoInput parameter

listDirectoryPeople

listDirectoryPeople

Module: google-contacts | Returns: object -- API response.

google-contacts.listDirectoryPeople
ParameterTypeRequiredDescription
inputstringNoInput parameter

updateContactPhoto

updateContactPhoto

Module: google-contacts | Returns: object -- API response.

google-contacts.updateContactPhoto
ParameterTypeRequiredDescription
inputstringNoInput parameter

Error Handling

All functions throw on failure. Common errors:

ErrorCause
GoogleContacts API error (${res.status}): ${t}Check the error message for details
google-contacts.setCredentials requires accessToken.Check the error message for details
google-contacts.updateContact requires an ID.Check the error message for details
google-contacts.deleteContact requires an ID.Check the error message for details
google-contacts.updateContactGroup requires an ID.Check the error message for details
google-contacts.deleteContactGroup requires an ID.Check the error message for details
google-contacts.updateContactPhoto requires an ID.Check the error message for details
GoogleContacts: "..." not configured. Call google-contacts.setCredentials first.Check the error message for details
@desc "Validate result"
do
  set $result as google-contacts.listContacts
  if $result != null
    print "Success"
  else
    print "No result"
  end
enddo

Recipes

1. List and iterate Contacts

Retrieve all items and loop through them.

@desc "Iterate results"
do
  google-contacts.setCredentials $token
  set $result as google-contacts.listContacts
  each $item in $result
    print $item
  end
enddo

2. Create a new item with createContact

Create a new resource and capture the result.

@desc "Execute operation"
do
  google-contacts.setCredentials $token
  set $result as google-contacts.createContact
  print "Created: " + $result
enddo

3. Create and update workflow

Create an item and then update it.

@desc "Execute operation"
do
  google-contacts.setCredentials $token
  set $created as google-contacts.createContact
  # Update the created item
  google-contacts.updateContact
enddo

4. Check before creating

List existing items and only create if needed.

@desc "Validate result"
do
  google-contacts.setCredentials $token
  set $existing as google-contacts.listContacts
  if $existing == null
    google-contacts.createContact
    print "Item created"
  else
    print "Item already exists"
  end
enddo

5. Multi-step Google Contacts workflow

Chain multiple google-contacts operations together.

@desc "Execute operation"
do
  google-contacts.setCredentials $token
  set $r_listContacts as google-contacts.listContacts
  set $r_getContact as google-contacts.getContact
  set $r_createContact as google-contacts.createContact
  print "All operations complete"
enddo

6. Safe listContacts with validation

Check results before proceeding.

@desc "Validate result"
do
  google-contacts.setCredentials $token
  set $result as google-contacts.listContacts
  if $result != null
    print "Success: " + $result
  else
    print "Operation returned no data"
  end
enddo

Related Modules

  • google-sheets -- Google Sheets module for complementary functionality
  • google-calendar -- Google Calendar module for complementary functionality
  • google-forms -- Google Forms module for complementary functionality
  • gmail -- Gmail module for complementary functionality
  • outlook -- Outlook module for complementary functionality

Versions (1)

VersionTagPublished
0.1.1latest1 months ago
Install
$ robinpath add @robinpath/google-contacts

Collaborators

Dumitru Balaban
Dumitru Balaban
@dumitru
View all @robinpath modules
Version0.1.1
LicenseMIT
Unpacked Size4.7 KB
Versions1
Weekly Downloads26
Total Downloads26
Stars0
Last Publish1 months ago
Created1 months ago

Category

productivity