Switch to the Jobs API
To use the Jobs API instead of the Entities API or Querying API, you need to replace calls to get, create, update, and delete M.Target and M.JobDescription entities that currently use the Entities API /api/entities with calls to the Jobs API /api/jobs.
After you have updated your code by completing this walkthrough, you can then follow the recommended steps to manage jobs.
The following example shows a call to the Jobs API with the skip and take query parameters.
You have to update your code to switch to the Jobs API. This walkthrough describes how to:
-
Locate and update calls for job target and Job description entities.
-
Locate and update calls that create job target or job descriptions.
-
Locate and update calls that create a job target entity.
-
Locate and update calls that delete job target or job descriptions.
The structure of the responses from the Jobs API is the same as those from the Entities API and the Querying API.
Locate and update calls for job target or job description entities
To locate API calls that retrieve job target entities using the Entities API, search for calls such as the ones shown in the following example.
This call returns a response similar to the following example:
Replace this with:
This call returns a response similar to the following example:
To locate API calls that retrieve the job description entity using the Entities API, search for calls such as the one shown in the following example.
This call returns a response similar to the following example:
Replace this with:
This call returns a response similar to the following example:
Locate and update calls that create a job target or job description entity
When you replace calls that use the Entities API with ones that use the Jobs API instead, ensure that the request body used in the old API calls is correctly mapped to the new API calls. The new endpoints expect the following request bodies:
-
EntityPostResourcefor creating targets. -
JobDescriptionResourcefor creating job descriptions.
The following examples illustrate how to switch from using the Entities API to using the Jobs API when working with M.Target and M.JobDescription.
Create a job target entity
Here is an example that creates a job target entity using the Entities API.
Replace this one using the Jobs API as follows:
Create a job description entity
Here is an example that creates a job description entity using the Entities API.
Replace this with one using the Jobs API as follows:
Update the job targets or job description
After you identify calls in the code that update job targets or job description entities using the Entities API, modify these calls to use the Jobs API.
PUT operations perform a full update on a target or description associated with a job. Properties or relations not included in the request will be set to null.
PATCH operations perform a partial update on a target or description associated with a job. Only the properties and relations included in the request will be updated.
Ensure that the request body used in the old API calls is correctly mapped to the new API calls. The new endpoints expect the following request bodies:
-
EntityResourcefor updating (PUT) or partially updating (PATCH) targets. -
JobDescriptionResourcefor updating (PUT) and an EntityResource for partially updating (PATCH) job descriptions.
Here is a call that updates a job target entity using the Entities API:
Here is a call that updates a job target entity using the Jobs API:
Here is a call that updates a job description entity using the Entities API:
Here is a call that updates a job description entity using the Jobs API:
Locate and update calls that delete job targets or the job description
After you identify calls in the code that delete job targets or the job description using the Entities API, update these calls to use the Jobs API.
Here is a call that deletes a job target entity using the Entities API:
Replace this call as follows:
Here is one that deletes a job description entity:
Replace this call as follows: