batch
Batch create contacts using a CSV file as input.
Synopsis
Implements the API documented at https://developers.google.com/people/api/rest/v1/people/createContact
gsm people createContact batch [flags]
Options
--addressMeAs int The type of pronouns that should be used to address the person.
The value can be custom or one of these predefined values:
- male
- female
- other
--addressMeAs_ALL string Same as addressMeAs but value is applied to all lines in the CSV file
--addresses int A person's physical address.
May be a P.O. box or street address.
All fields are optional.
May be used multiple times in the for of "formattedValue=...;type=...;poBox...", etc.
You may use the following fields:
primary - True if the field is the primary field; false if the field is a secondary field.
formattedValue - The unstructured value of the address.
If this is not set by the user it will be automatically constructed from structured values.
type - The type of the address.
The type can be custom or one of these predefined values:
- home
- work
- other
poBox - The P.O. box of the address.
streetAddress - The street address.
extendedAddress - The extended address of the address; for example, the apartment number.
city - The city of the address.
region - The region of the address; for example, the state or province.
postalCode - The postal code of the address.
country - The country of the address.
countryCode - The ISO 3166-1 alpha-2 country code of the address.
--addresses_ALL strings Same as addresses but value is applied to all lines in the CSV file
--batchThreads int Specify the number of threads that should be used for batch commands (overrides value in config file. Max 16)
--biographyContentType int The content type of the biography.
CONTENT_TYPE_UNSPECIFIED - Unspecified.
TEXT_PLAIN - Plain text.
TEXT_HTML - HTML text.
--biographyContentType_ALL string Same as biographyContentType but value is applied to all lines in the CSV file
--biographyValue int The short biography.
--biographyValue_ALL string Same as biographyValue but value is applied to all lines in the CSV file
--birthdayDay int Day of month.
Must be from 1 to 31 and valid for the year and month, or 0 if specifying a year by itself or a year and month where the day is not significant.
--birthdayDay_ALL int Same as birthdayDay but value is applied to all lines in the CSV file
--birthdayMonth int Month of year.
Must be from 1 to 12, or 0 if specifying a year without a month and day.
--birthdayMonth_ALL int Same as birthdayMonth but value is applied to all lines in the CSV file
--birthdayText int A free-form string representing the user's birthday.
--birthdayText_ALL string Same as birthdayText but value is applied to all lines in the CSV file
--birthdayYear int Year of date.
Must be from 1 to 9999, or 0 if specifying a date without a year.
--birthdayYear_ALL int Same as birthdayYear but value is applied to all lines in the CSV file
--calendarUrls int The person's calendar URLs.
Can be used multiple times in the form of "url=...,type=...", etc.
You may use the following fields:
primary - True if the field is the primary field; false if the field is a secondary field.
url - The calendar URL.
type - The type of the calendar URL.
The type can be custom or one of these predefined values:
- home
- work
- other
--calendarUrls_ALL strings Same as calendarUrls but value is applied to all lines in the CSV file
--clientData int The person's client data.
Arbitrary client data that is populated by clients. Duplicate keys and values are allowed.
Can be used multiple times in the form of "key=...,value=...", etc.
You may use the following fields:
primary - True if the field is the primary field; false if the field is a secondary field.
key - The client specified key of the client data.
value - The client specified value of the client data.
--clientData_ALL strings Same as clientData but value is applied to all lines in the CSV file
--delimiter string Delimiter to use for CSV columns. Must be exactly one character. Default is ';'
--emailAddresses int The person's email addresses.
Can be used multiple times in the form of "primary=...,value=...", etc.
You may use the following fields:
primary - True if the field is the primary field; false if the field is a secondary field.
value - The email address.
type - The type of the email address.
The type can be custom or one of these predefined values:
- home
- work
- other
displayName - The display name of the email.
--emailAddresses_ALL strings Same as emailAddresses but value is applied to all lines in the CSV file
--events int The person's events.
Can be used multiple times in the form of "year=...,month=...", etc.
You may use the following fields:
primary - True if the field is the primary field; false if the field is a secondary field.
year - Year of date.
Must be from 1 to 9999, or 0 if specifying a date without a year.
month - Month of year.
Must be from 1 to 12, or 0 if specifying a year without a month and day.
day - Day of month.
Must be from 1 to 31 and valid for the year and month, or 0 if specifying a year by itself or a year and month where the day is not significant.
type - The type of the event.
The type can be custom or one of these predefined values:
- anniversary
- other
--events_ALL strings Same as events but value is applied to all lines in the CSV file
--externalIds int The person's external IDs.
Can be used multiple times in the form of "value=...,type=...", etc.
You may use the following fields:
primary - True if the field is the primary field; false if the field is a secondary field.
value - The value of the external ID.
type - The type of the external ID.
The type can be custom or one of these predefined values:
- account
- customer
- loginId
- network
- organization
--externalIds_ALL strings Same as externalIds but value is applied to all lines in the CSV file
--familyName int The family name.
--familyName_ALL string Same as familyName but value is applied to all lines in the CSV file
--fields int Fields allows partial responses to be retrieved.
See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
--fields_ALL string Same as fields but value is applied to all lines in the CSV file
--fileAses int The person's file-ases.
Can be used multiple times in the form of "primary=...,value=...", etc.
You may use the following fields:
primary - True if the field is the primary field; false if the field is a secondary field.
value - The file-as value
--fileAses_ALL strings Same as fileAses but value is applied to all lines in the CSV file
--genderValue int The gender for the person.
The gender can be custom or one of these predefined values:
- male
- female
- unspecified
--genderValue_ALL string Same as genderValue but value is applied to all lines in the CSV file
--givenName int The given name.
--givenName_ALL string Same as givenName but value is applied to all lines in the CSV file
-h, --help help for batch
--honorificPrefix int The honorific prefixes, such as Mrs. or Dr.
--honorificPrefix_ALL string Same as honorificPrefix but value is applied to all lines in the CSV file
--honorificSuffix int The honorific suffixes, such as Jr.
--honorificSuffix_ALL string Same as honorificSuffix but value is applied to all lines in the CSV file
--imClients int The person's instant messaging clients.
Can be used multiple times in the form of "primary=...,username=...", etc.
You may use the following fields:
primary - True if the field is the primary field; false if the field is a secondary field.
username - The user name used in the IM client.
type - The type of the IM client.
The type can be custom or one of these predefined values:
- home
- work
- other
protocol - The protocol of the IM client.
The protocol can be custom or one of these predefined values:
- aim
- msn
- yahoo
- skype
- qq
- googleTalk
- icq
- jabber
- netMeeting
--imClients_ALL strings Same as imClients but value is applied to all lines in the CSV file
--interests int The person's interests.
Can be used multiple times in the form of "primary=...,value=...", etc.
You may use the following fields:
primary - True if the field is the primary field; false if the field is a secondary field.
value - The interest; for example, stargazing.
--interests_ALL strings Same as interests but value is applied to all lines in the CSV file
--locales int The person's locale preferences.
Can be used multiple times in the form of "primary=...,value=...", etc.
You may use the following fields:
primary - True if the field is the primary field; false if the field is a secondary field.
value - The well-formed IETF BCP 47 language tag representing the locale.
--locales_ALL strings Same as locales but value is applied to all lines in the CSV file
--locations int The person's locations.
Can be used multiple times in the form of "primary=...,value=...", etc.
You may use the following fields:
primary - True if the field is the primary field; false if the field is a secondary field.
value - The free-form value of the location.
type - The type of the location.
The type can be custom or one of these predefined values:
- desk
- grewUp
current - Whether the location is the current location.
buildingId - The building identifier.
floor - The floor name or number.
floorSection - The floor section in floor_name.
deskCode - The individual desk location.
--locations_ALL strings Same as locations but value is applied to all lines in the CSV file
--memberships int The person's group memberships.
Can be used multiple times in the form of "primary=...,contactGroupResourceName=...", etc.
You may use the following fields:
primary - True if the field is the primary field; false if the field is a secondary field.
contactGroupResourceName - The resource name for the contact group, assigned by the server.
An ASCII string, in the form of contactGroups/{contactGroupId}.
Only contactGroupResourceName can be used for modifying memberships.
Any contact group membership can be removed, but only user group or "myContacts" or "starred" system groups memberships can be added.
A contact must always have at least one contact group membership.
--memberships_ALL strings Same as memberships but value is applied to all lines in the CSV file
--middleName int The middle name(s).
--middleName_ALL string Same as middleName but value is applied to all lines in the CSV file
--miscKeywords int The person's miscellaneous keywords.
Can be used multiple times in the form of "primary=...,value=...", etc.
You may use the following fields:
primary - True if the field is the primary field; false if the field is a secondary field.
value - The value of the miscellaneous keyword.
type - The miscellaneous keyword type.
Allowed values are:
- TYPE_UNSPECIFIED - Unspecified.
- OUTLOOK_BILLING_INFORMATION - Outlook field for billing information.
- OUTLOOK_DIRECTORY_SERVER - Outlook field for directory server.
- OUTLOOK_KEYWORD - Outlook field for keyword.
- OUTLOOK_MILEAGE - Outlook field for mileage.
- OUTLOOK_PRIORITY - Outlook field for priority.
- OUTLOOK_SENSITIVITY - Outlook field for sensitivity.
- OUTLOOK_SUBJECT - Outlook field for subject.
- OUTLOOK_USER - Outlook field for user.
- HOME - Home.
- WORK - Work.
- OTHER - Other.
--miscKeywords_ALL strings Same as miscKeywords but value is applied to all lines in the CSV file
--nicknames int The person's nicknames.
Can be used multiple times in the form of "primary=...,value=...", etc.
You may use the following fields:
primary - True if the field is the primary field; false if the field is a secondary field.
value - The nickname.
type - The type of a nickname.
Allowed values are:
- DEFAULT - Generic nickname.
- ALTERNATE_NAME - Alternate name person is known by.
--nicknames_ALL strings Same as nicknames but value is applied to all lines in the CSV file
--occupations int The person's occupations.
Can be used multiple times in the form of "primary=...,value=...", etc.
You may use the following fields:
primary - True if the field is the primary field; false if the field is a secondary field.
value - The occupation; for example, carpenter.
--occupations_ALL strings Same as occupations but value is applied to all lines in the CSV file
--organizations int The person's past or current organizations.
Can be used multiple times in the form of "primary=...,type=...", etc.
You may use the following fields:
primary - True if the field is the primary field; false if the field is a secondary field.
type - The type of the organization.
The type can be custom or one of these predefined values:
- work
- school
startDateYear - Year of date.
Must be from 1 to 9999, or 0 if specifying a date without a year.
startDateMonth - Month of year.
Must be from 1 to 12, or 0 if specifying a year without a month and day.
startDateDay - Day of month.
Must be from 1 to 31 and valid for the year and month, or 0 if specifying a year by itself or a year and month where the day is not significant.
endDateYear - Year of date.
Must be from 1 to 9999, or 0 if specifying a date without a year.
endDateMonth - Month of year.
Must be from 1 to 12, or 0 if specifying a year without a month and day.
endDateDay - Day of month.
Must be from 1 to 31 and valid for the year and month, or 0 if specifying a year by itself or a year and month where the day is not significant.
current - True if the organization is the person's current organization; false if the organization is a past organization.
name - The name of the organization.
phoneticName - The phonetic name of the organization.
department - The person's department at the organization.
title - The person's job title at the organization.
jobDescription - The person's job description at the organization.
symbol - The symbol associated with the organization; for example, a stock ticker symbol, abbreviation, or acronym.
domain - The domain name associated with the organization; for example, google.com.
location - The location of the organization office the person works at.
--organizations_ALL strings Same as organizations but value is applied to all lines in the CSV file
--path string Path of the import file (CSV)
--personFields int A field mask to restrict which fields on each person are returned.
Multiple fields can be specified by separating them with commas.
Defaults to all fields if not set.
Valid values are:
addresses
ageRanges
biographies
birthdays
calendarUrls
clientData
coverPhotos
emailAddresses
events
externalIds
genders
imClients
interests
locales
locations
memberships
metadata
miscKeywords
names
nicknames
occupations
organizations
phoneNumbers
photos
relations
sipAddresses
skills
urls
userDefined
--personFields_ALL string Same as personFields but value is applied to all lines in the CSV file
--phoneNumbers int The person's phone numbers.
Can be used multiple times in the form of "primary=...,value=...", etc.
You may use the following fields:
primary - True if the field is the primary field; false if the field is a secondary field.
value - The phone number.
type - The type of the phone number.
The type can be custom or one of these predefined values:
- home
- work
- mobile
- homeFax
- workFax
- otherFax
- pager
- workMobile
- workPager
- main
- googleVoice
- other
--phoneNumbers_ALL strings Same as phoneNumbers but value is applied to all lines in the CSV file
--phoneticFamilyName int The family name spelled as it sounds.
--phoneticFamilyName_ALL string Same as phoneticFamilyName but value is applied to all lines in the CSV file
--phoneticFullName int The full name spelled as it sounds.
--phoneticFullName_ALL string Same as phoneticFullName but value is applied to all lines in the CSV file
--phoneticGivenName int The given name spelled as it sounds.
--phoneticGivenName_ALL string Same as phoneticGivenName but value is applied to all lines in the CSV file
--phoneticHonorificPrefix int The honorific prefixes spelled as they sound.
--phoneticHonorificPrefix_ALL string Same as phoneticHonorificPrefix but value is applied to all lines in the CSV file
--phoneticHonorificSuffix int The honorific suffixes spelled as they sound.
--phoneticHonorificSuffix_ALL string Same as phoneticHonorificSuffix but value is applied to all lines in the CSV file
--phoneticMiddleName int The middle name(s) spelled as they sound.
--phoneticMiddleName_ALL string Same as phoneticMiddleName but value is applied to all lines in the CSV file
--relations int The person's relations.
Can be used multiple times in the form of "primary=...,person=...", etc.
You may use the following fields:
primary - True if the field is the primary field; false if the field is a secondary field.
person - The name of the other person this relation refers to.
type - The person's relation to the other person.
The type can be custom or one of these predefined values:
- spouse
- child
- mother
- father
- parent
- brother
- sister
- friend
- relative
- domesticPartner
- manager
- assistant
- referredBy
- partner
--relations_ALL strings Same as relations but value is applied to all lines in the CSV file
--sipAddresses int The person's SIP addresses.
Can be used multiple times in the form of "primary=...,value=...", etc.
You may use the following fields:
primary - True if the field is the primary field; false if the field is a secondary field.
value - The SIP address in the RFC 3261 19.1 SIP URI format.
type - The type of the SIP address.
The type can be custom or or one of these predefined values:
- home
- work
- mobile
- other
--sipAddresses_ALL strings Same as sipAddresses but value is applied to all lines in the CSV file
--skills int The person's skills.
Can be used multiple times in the form of "primary=...,value=...", etc.
You may use the following fields:
primary - True if the field is the primary field; false if the field is a secondary field.
value - The skill; for example, underwater basket weaving.
--skills_ALL strings Same as skills but value is applied to all lines in the CSV file
--skipHeader Whether to skip the first row (header)
--sources int A mask of what source types to return.
DIRECTORY_SOURCE_TYPE_DOMAIN_CONTACT - Workspace domain shared contact.
DIRECTORY_SOURCE_TYPE_DOMAIN_PROFILE - Workspace domain profile.
READ_SOURCE_TYPE_PROFILE - Returns SourceType.ACCOUNT, SourceType.DOMAIN_PROFILE, and SourceType.PROFILE.
READ_SOURCE_TYPE_CONTACT - Returns SourceType.CONTACT.
READ_SOURCE_TYPE_DOMAIN_CONTACT - Returns SourceType.DOMAIN_CONTACT.
--sources_ALL string Same as sources but value is applied to all lines in the CSV file
--unstructuredName int The free form name value.
--unstructuredName_ALL string Same as unstructuredName but value is applied to all lines in the CSV file
--urls int The person's associated URLs.
Can be used multiple times in the form of "primary=...,value=...", etc.
You may use the following fields:
primary - True if the field is the primary field; false if the field is a secondary field.
value - The URL.
type - The type of the URL.
The type can be custom or one of these predefined values:
- home
- work
- blog
- profile
- homePage
- ftp
- reservations
- appInstallPage: website for a Currents application.
- other
--urls_ALL strings Same as urls but value is applied to all lines in the CSV file
--userDefined int The person's user defined data.
Can be used multiple times in the form of "primary=...,type=...", etc.
You may use the following fields:
primary - True if the field is the primary field; false if the field is a secondary field.
key - The end user specified key of the user defined data.
value - The end user specified value of the user defined data.
--userDefined_ALL strings Same as userDefined but value is applied to all lines in the CSV file
Options inherited from parent commands
--compressOutput By default, GSM outputs "pretty" (indented) objects. By setting this flag, GSM's output will be compressed. This may or may not improve performance in scripts.
--config string config file (default is $HOME/.config/gsm/.gsm.yaml)
--delay int This delay (plus a random jitter between 0 and 50) will be applied after every command to avoid reaching quota and rate limits. Set to 0 to disable.
--dwdSubject string Specify a subject used for DWD impersonation (overrides value in config file)
--log string Set the path of the log file. Default is either ~/gsm.log or defined in your config file
--maxElapsedTime int This is the maximum total time that will be spent retrying a request in minutes. (default 15)
--maxRetryInterval int This is the maximum interval that will be used between retry attempts in seconds. (default 320)
--redirectPort int This is the TCP port on which GSM will create web server if you authenticate with a user account for the first time. This is necessary for the OAuth flow. See https://developers.google.com/identity/protocols/oauth2/native-app#redirect-uri_loopback (default 8081)
--retryOn ints Specify the HTTP error code(s) that GSM should retry on. Note that GSM will always retry on HTTP 403 errors that indicate a quota / rate limit error
--streamOutput Setting this flag will cause GSM to output slice values to stdout one by one, instead of one large object
SEE ALSO
- gsm people createContact - Create a new contact and return the person resource for that contact.