Create a company and job in Talent Solution
This tutorial is designed to get you started exploring and developing applications with Cloud Talent Solution. Familiarity with basic programming is assumed, though even without much programming knowledge, you should be able to follow along. After going through this tutorial, you should be able to use the Cloud Talent Solution reference documentation to create your own basic applications.
This tutorial steps through a Cloud Talent Solution application using Java code. The purpose here is not to explain the Java client libraries, but to explain how to make calls to Cloud Talent Solution. Applications in Python and Node.js are essentially similar. Please contact us if you have any questions.
Before you begin
You have:
- followed the steps to create and set up your project, as listed in Before You Begin,
- set up your environment using Application Default Credentials,
- basic familiarity with Java or Python programming,
- installed the latest Google API Java client or Google API Python client.
Create a company with jobs and search for those jobs
This tutorial walks you through a basic Cloud Talent Solution application, and guides
you through creating a single job that you associate to a company. The next
tutorial walks you through the steps to search for jobs within the company based on
attributes of the jobs and the search query. The search
API attempts to return
jobs most relevant to a job seeker's query based on available fields within a
job (company name, job title, job description, job categories, job location,
etc.).
Create service with your credentials
Create the service with the JSON credential file you downloaded in Before You Begin:
Java
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Python
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Go
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
This code configures the client service with your application's credential
information. The OAuth 2.0 request is sent when an API call is made. The
auth token generated using the process above typically has an expiration date
of 1 hour, after which you'll get an error if you try to use it.
The GoogleCredential
library takes care of automatically "refreshing" the
token which simply means getting a new access token.
Create company
A company is an entity associated with a set of job listings. You must create
the company before you can post jobs on Cloud Talent Solution for that company.
You can send any freeform string as the externalId
when creating the
company. This means you can use the primary key from your existing database
(if you have one) when creating and referring to a company.
Java
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Python
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Go
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Get company
You can read the present state of a company by sending a GET request, along with
the name
of the company assigned by our backend.
Java
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Python
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Go
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Create job
To post a new job, you must provide all of the required fields about the new
job along with the companyName
of the company you want to associate this job
with, which you specified when you created the company resource.
The data object with the job data filled in is sent to the Cloud Talent Solution
endpoint using a POST request. Note that the name
field should not be set in
the initial request since it is an "output only" field of the createJob
API
and is a part of the API response when a new job entity is created by the
server. The API endpoint to interact with the jobs resource is specified in the
Cloud Talent Solution Client Libraries document.
The response to the request is an object of the new job posting; it should
include a job name
which uniquely represents the posting. The job name
is
used when the posting needs to be updated or deleted. As a best practice, store
this name
and map it to your own unique ID for the job.
The server returns an error if you attempt to insert a job when another job
already exists on the system with the same companyName
, requisitionId
and
languageCode
for the same company.
The following code creates a job with just the required fields for the company
specified in the companyName
field.
Java
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Python
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Go
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Cloud Talent Solution also allows you to create jobs that are specific to a location. See locations
for more information.
Cloud Talent Solution has several fields associated with a job that are built in to the
API schema. However, you might still have some fields that aren't a part of the
out-of-the-box fields. While it is recommended that all customers of
Cloud Talent Solution always use the out-of-the box fields wherever possible,
Cloud Talent Solution also provides some customAttributes for a job. These might be
filterable or non-filterable. Refer to the customAttributes
for more information.
The following code example shows how to create a job with a customAttribute
:
Java
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Python
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Go
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Retrieve job
You can confirm that the job was created by using the GET operation to GET the details of the job. Note that it might take a couple of minutes for the job to become available, based on the current volume of jobs being created in Cloud Talent Solution.
You can retrieve the details of a previously inserted job by sending a
GET request to the Cloud Talent Solution. The URI should include the previously
inserted job name
returned by the original create request, as a URL parameter.
The following example uses a GET operation to retrieve the details of a job with
a given name
:
Java
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Python
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Go
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Search for jobs
You've created your first company and job using the Cloud Talent Solution! You're now ready to search to conduct a search across these jobs.