Avvisi via email (v3)

Cloud Talent Solution offre anche un'API di ricerca, SearchJobsForAlert, ottimizzata per le esigenze dei "candidati passivi". Queste persone non stanno necessariamente cercando attivamente un lavoro, ma potrebbero essere inclini a candidarsi se si presentano le giuste circostanze. Ad esempio, un cliente può utilizzare Cloud Talent Solution per compilare i contenuti di una campagna email progettata per offrire aggiornamenti periodici sui lavori che potrebbero interessare alle persone. I risultati di SearchJobsForAlert potrebbero essere diversi da quelli di searchJobs e sono destinati all'uso in email di avviso di lavoro e altre campagne destinate a persone in cerca di lavoro passive. Utilizza il filtro Data di pubblicazione quando chiami SearchJobsForAlert per limitare l'insieme di lavori cercati a quelli pubblicati dall'ultima generazione dell'avviso. Per ulteriori informazioni sull'utilizzo di questa funzionalità, consulta la guida all'implementazione degli avvisi via email.

Le ricerche degli avvisi via email vengono effettuate allo stesso modo di una normale ricerca:

Java

Per saperne di più sull'installazione e la creazione di un client Cloud Talent Solution, consulta Librerie client 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

Per saperne di più sull'installazione e la creazione di un client Cloud Talent Solution, consulta Librerie client 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

Per saperne di più sull'installazione e la creazione di un client Cloud Talent Solution, consulta Librerie client 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
}

Per informazioni sulla ricerca, vedi Nozioni di base della ricerca.