이메일 알림(v3)

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
}

검색에 대한 자세한 내용은 검색 기본사항을 참조하세요.