function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nitesh TrivediNitesh Trivedi 

how to Create a gmail account automatic for new employees after completion of the probationary period.

how to Create a gmail account automatic for new employees after completion of the probationary period.
AnudeepAnudeep (Salesforce Developers) 
Hi Nitesh, 

To create a user account using one of your domains, use the following POST request, and include the authorization described in Authorize requests. For the request query string properties, see the API Reference
 
POST https://www.googleapis.com/admin/directory/v1/users

The following JSON shows a sample request to create a user
 
{
"primaryEmail": "liz@example.com",
"name": {
 "givenName": "Elizabeth",
 "familyName": "Smith"
},
"suspended": false,
"password": "new user password",
"hashFunction": "SHA-1",
"changePasswordAtNextLogin": false,
"ipWhitelisted": false,
"ims": [
 {
  "type": "work",
  "protocol": "gtalk",
  "im": "liz_im@talk.example.com",
  "primary": true
 }
],
"emails": [
 {
  "address": "liz@example.com",
  "type": "home",
  "customType": "",
  "primary": true
 }
],
"addresses": [
 {
  "type": "work",
  "customType": "",
  "streetAddress": "1600 Amphitheatre Parkway",
  "locality": "Mountain View",
  "region": "CA",
  "postalCode": "94043"
 }
],
"externalIds": [
 {
  "value": "12345",
  "type": "custom",
  "customType": "employee"
 }
],
"relations": [
 {
  "value": "Mom",
  "type": "mother",
  "customType": ""
 },
 {
  "value": "manager",
  "type": "referred_by",
  "customType": ""
 }
],
"organizations": [
 {
  "name": "Google Inc.",
  "title": "SWE",
  "primary": true,
  "type": "work",
  "description": "Software engineer"
 }
],
"phones": [
 {
  "value": "+1 nnn nnn nnnn",
  "type": "work"
 }
],
"orgUnitPath": "/corp/engineering",
"includeInGlobalAddressList": true
}
See this documentation to learn more
You have to build your code similar to what is shown in this video

Anudeep