התראות באימייל (גרסה 3)

בנוסף, Cloud Talent Solution מציע API לחיפוש,‏ SearchJobsForAlert, שמותאם לצרכים של 'מחפשי עבודה פסיביים'. אלה אנשים שלא בהכרח מחפשים עבודה באופן פעיל, אבל יכול להיות שיהיו מוכנים להגיש מועמדות אם יתעוררו הנסיבות המתאימות. לדוגמה, לקוח יכול להשתמש ב-Cloud Talent Solution כדי לאכלס את התוכן של קמפיין לשיווק באימייל שנועד להציע עדכונים תקופתיים לגבי משרות שאנשים עשויים להתעניין בהן. התוצאות של SearchJobsForAlert עשויות להיות שונות מאלה של searchJobs, והן מיועדות לשימוש בהתראות על משרות ובקמפיינים אחרים שמטרגטים מחפשי עבודה פסיביים. כשמתקשרים אל SearchJobsForAlert, אפשר להשתמש במסנן 'תאריך הפרסום' כדי להגביל את קבוצת המשרות שנכללות בחיפוש למשרות שפורסמו מאז יצירת ההתראה האחרונה. מידע נוסף על השימוש בתכונה הזו זמין במדריך ההטמעה של התראות באימייל.

חיפושים של התראות באימייל מתבצעים באותו אופן כמו חיפוש רגיל:

Java

מידע נוסף על התקנה ויצירה של לקוח Cloud Talent Solution זמין במאמר ספריות לקוח של Cloud Talent Solution.


/** Search jobs for alert. */
public static void searchForAlerts(String companyName) throws IOException, InterruptedException {
  // Make sure to set the requestMetadata the same as the associated search request
  RequestMetadata requestMetadata =
      new RequestMetadata()
          // Make sure to hash your userID
          .setUserId("HashedUserId")
          // Make sure to hash the sessionID
          .setSessionId("HashedSessionID")
          // Domain of the website where the search is conducted
          .setDomain("www.google.com");

  SearchJobsRequest request =
      new SearchJobsRequest()
          .setRequestMetadata(requestMetadata)
          .setSearchMode("JOB_SEARCH"); // Set the search mode to a regular search
  if (companyName != null) {
    request.setJobQuery(new JobQuery().setCompanyNames(Arrays.asList(companyName)));
  }

  SearchJobsResponse response =
      talentSolutionClient
          .projects()
          .jobs()
          .searchForAlert(DEFAULT_PROJECT_ID, request)
          .execute();
  Thread.sleep(1000);
  System.out.printf("Search jobs for alert results: %s\n", response);
}

Python

מידע נוסף על התקנה ויצירה של לקוח Cloud Talent Solution זמין במאמר ספריות לקוח של Cloud Talent Solution.

def search_for_alerts(client_service, company_name):
    request_metadata = {
        "user_id": "HashedUserId",
        "session_id": "HashedSessionId",
        "domain": "www.google.com",
    }
    request = {
        "search_mode": "JOB_SEARCH",
        "request_metadata": request_metadata,
    }
    if company_name is not None:
        request.update({"job_query": {"company_names": [company_name]}})
    response = (
        client_service.projects()
        .jobs()
        .searchForAlert(parent=parent, body=request)
        .execute()
    )
    print(response)

Go

מידע נוסף על התקנה ויצירה של לקוח Cloud Talent Solution זמין במאמר ספריות לקוח של Cloud Talent Solution.


// searchForAlerts searches for jobs with email alert set which could receive
// updates later if search result updates.
func searchForAlerts(w io.Writer, projectID, companyName string) (*talent.SearchJobsResponse, error) {
	ctx := context.Background()

	client, err := google.DefaultClient(ctx, talent.CloudPlatformScope)
	if err != nil {
		return nil, fmt.Errorf("google.DefaultClient: %w", err)
	}
	// Create the jobs service client.
	service, err := talent.New(client)
	if err != nil {
		return nil, fmt.Errorf("talent.New: %w", err)
	}

	parent := "projects/" + projectID
	req := &talent.SearchJobsRequest{
		// Make sure to set the RequestMetadata the same as the associated
		// search request.
		RequestMetadata: &talent.RequestMetadata{
			// Make sure to hash your userID.
			UserId: "HashedUsrId",
			// Make sure to hash the sessionID.
			SessionId: "HashedSessionId",
			// Domain of the website where the search is conducted.
			Domain: "www.googlesample.com",
		},
		// Set the search mode to a regular search.
		SearchMode: "JOB_SEARCH",
	}
	if companyName != "" {
		req.JobQuery = &talent.JobQuery{
			CompanyNames: []string{companyName},
		}
	}

	resp, err := service.Projects.Jobs.SearchForAlert(parent, req).Do()
	if err != nil {
		return nil, fmt.Errorf("failed to search for jobs with alerts: %w", err)
	}

	fmt.Fprintln(w, "Jobs:")
	for _, j := range resp.MatchingJobs {
		fmt.Fprintf(w, "\t%q\n", j.Job.Name)
	}

	return resp, nil
}

מידע על חיפוש זמין במאמר יסודות החיפוש.