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 Reference documentation to create your own basic applications. Video tutorials and interactive codelabs are also available.Please contact us if you have any questions.
Prerequisites
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 resource that you associate to a Company resource. 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,
and so on).
Create a Company
A Company
is an entity associated with a set of job listings. You must create
the Company object 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.
The following sample shows how to create a new client to perform the request. We recommend that you create one client per program or system process, then use either connection pooling or a singleton client to share that client across multiple requests. Creating a new client with each request can cause performance problems or trigger DoS protection.
Go
To learn how to install and use the client library for CTS, see CTS client libraries. For more information, see the CTS Go API reference documentation.
To authenticate to CTS, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Node.js
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.
Create a Job
To post a new Job resource, you must provide all of the required fields about the
job along with the companyName
of the Company you want to associate this Job
with. You specified the companyName
earlier 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. The name
field should not be set in
the initial request since it is an "output only" field of the createJob
API:
it's a part of the API response when a new job entity is created by the
server. The API endpoint to interact with a Jobs resource is specified in the
Cloud Talent Solution Client Libraries document.
The response to the request is a new Job object. 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 create a new Job when another Job
already exists in the system with the same companyName
, requisitionId
and
languageCode
.
Cloud Talent Solution also allows you to create Jobs that are specific to a location.
See locations
for more information.
The following code creates a Job with just the required fields for the Company
specified in the companyName
field.
You can create a Job using the code sample below. See Quickstart: Create companies and jobs for more details.
Go
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Java
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Node.js
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.
Create a Job with custom fields
Cloud Talent Solution includes several job fields that are built in to the
API schema. However, you may need additional fields that aren't present in the
out-of-the-box options. While we recommended that you use the out-of-the box
fields wherever possible, Cloud Talent Solution also provides some customAttributes
fields for a Job. These can be filterable or non-filterable. Refer to
the customAttributes
documentation for more information.
The following code example shows how to create a Job with a customAttribute
:
Go
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Java
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Node.js
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.
Retrieve a 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 few 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 theCloud Talent Solution API. 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
:
Go
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Java
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Node.js
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.
Search for Jobs
You've created your first Company and Job using the Cloud Talent Solution! You're now ready to conduct a search across these Jobs.
More APIs
For more information regarding the APIs and different configurations available, please see the latest reference documentation.