Example query for Candidate to hire

Applies to these Dynamics 365 apps:
Human Resources

This article provides an example query for the Candidate to hire entity in Dynamics 365 Human Resources.

This article provides an example demonstrating how you can use deep inserts to create all the detail of a new candidate record in a single API operation. For more information about deep inserts, see Create related entity records in one operation.

The mshr_hcmcandidatetohireentity entity is unique because of its relationship to the mshr_dirpersonentity entity. Many of the properties on the mshr_hcmcandidatetohireentity (for example, mshr_firstname, mshr_lastname, and mshr_birthdate) are derived from the mshr_dirpersonentity record. If you post a new candidate record to mshr_hcmcandidatetohireentity without using deep inserts, you can define values for these properties directly on the mshr_hcmcandidatetohireentity record. The associated mshr_dirpersonentity record is created implicitly with the defined values for the properties. You can then create any other related entity records (such as skills or education) as separate API calls.

If, however, you want to use deep inserts to create all related entities in one operation, the properties specific to the mshr_dirpersonentity entity must be defined on that nested level of the operation.

This example shows how you can create a candidate record, the associated person record, and the person's skills and education in three nested levels using deep inserts in a single API operation.

Note

The example does not include all properties of each of the API entities. It is simplified for demonstration purposes.

Request


POST [Organization URI]/api/data/v9.1/mshr_hcmcandidatetohireentities
Content-Type: application/json; charset=utf-8
OData-MaxVersion: 4.0
OData-Version: 4.0
Accept: application/json

{
    "mshr_dataareaid": "usmf",
    "mshr_recruitingrequestid": "USMF-000141",
    "mshr_positionid": "000601",
    "mshr_iswillingtorelocate": 200000000,
    "mshr_availabilitydate": "2021-03-18",
    "mshr_comments": "Evelyn's experience is exactly what we need for this position.",
    "mshr_FK_Person_id":
        {
            "mshr_firstname": "Evelyn",
            "mshr_lastname": "Chambers",
            "mshr_namesequencedisplayas": "FirstMiddleLast",
            "mshr_FK_HcmPersonSkillEntity_Person":
            [
                {
                    "mshr_skillid": "CustFocus",
                    "mshr_ratingid": "Skills",
                    "mshr_levelid": "4",
                    "mshr_ratinglevelexaminer": "",
                    "mshr_leveltype": 200000000,
                    "mshr_yearsofexperience": 0,
                    "mshr_verified": 200000000,
                    "mshr_leveldate": "2013-01-01T00:00:00Z"
                },
                {
                    "mshr_skillid": "CashFlow",
                    "mshr_ratingid": "Skills",
                    "mshr_levelid": "4",
                    "mshr_ratinglevelexaminer": "",
                    "mshr_leveltype": 200000000,
                    "mshr_yearsofexperience": 0,
                    "mshr_verified": 200000000,
                    "mshr_leveldate": "2013-01-01T00:00:00Z"
                }
            ],
            "mshr_FK_HcmPersonEducationEntity_Person": [
                {
                    "mshr_creditbasis": 200000000,
                    "mshr_enddate": "2021-02-22T00:00:00Z",
                    "mshr_educationlevelid": "Bachelor",
                    "mshr_creditsearned": 0,
                    "mshr_startdate": "2017-02-21T00:00:00Z",
                    "mshr_creditscompleted": 0,
                    "mshr_educationinstitutionid": "Cottonwood Univ",
                    "mshr_educationdisciplineid": "Business Mgmt",
                    "mshr_durationunit": 200000000
                }              
            ]
        }
}

Response


HTTP/1/1 204 No Content
OData-Version: 4.0
OData-EntityId: [Organization URI]/api/data/v9.1/mshr_hcmcandidatetohireentities(00000d2d-0000-0000-7317-005001000000)

See also

Applicant Tracking System integration API introduction