Page 1 of 1

Unknown internal error when trying to create Placement via REST API

Posted: Mon Mar 18, 2019 9:48 am
by kamilb
Hello,

I'm trying to create a Placement entity via the REST API, but it keeps failing.

Here are the details of the request I'm trying to perform:
URL: [REST_URL]/entity/Placement
body:

Code: Select all

{
  "candidate": {"id":240},
  "employmentType": "Contract",
  "jobOrder": {"id": 222},
  "jobSubmission": {"id": 211}
}
And here's the response:

Code: Select all

{
  "errorMessage": "error persisting an entity of type: Placement",
  "errorMessageKey": "errors.cannotPersistEntity",
  "errorCode": 500,
  "errors": [
    {
      "detailMessage":"",
      "propertyName":"",
      "severity":"ERROR",
      "type":"UNKNOWN_INTERNAL_ERROR"
    }
  ],
  "entityName":"Placement"
}
Sadly, the error message is not very helpful.

I'll be very grateful for some help.

Re: Unknows internal error when trying to create Placement via REST API

Posted: Mon Mar 18, 2019 10:25 am
by mhuggins
Hello,

Taking a look at the body of the call you are passing, it is missing some of the fields which are required upon creation of a placement.

Please take a look at the following documentation for the none nullable fields such as dateBegin and Status:

http://bullhorn.github.io/rest-api-docs ... #placement

Re: Unknown internal error when trying to create Placement via REST API

Posted: Tue Mar 19, 2019 11:37 am
by kamilb
Thank you for the quick response.

The example I provided in my original post was very minimal. It was the smallest set of fields where the API didn't return a "missing property" error and returned the "unknown internal error" instead.

If I add other properties to the request body, it doesn't change the result. The request below still returns the same error. I don't have any problems with creating other types of entities (Candidate, JobSubmission, CandidateWorkHistory, CandidateEducation etc.).

Code: Select all

{  
  "candidate":{  
    "id":246
  },
  "dateBegin":1563007250645,
  "daysGuaranteed":60,
  "daysProRated":0,
  "durationWeeks":20.0,
  "employmentType":"Contract",
  "fee":20.0,
  "hoursPerDay":8.0,
  "jobOrder":{  
    "id":"222"
  },
  "jobSubmission":{  
    "id":217
  },
  "payRate":60.0,
  "recruitingManagerPercentGrossMargin":5.0,
  "referralFee":5.0,
  "referralFeeType":"Percentage",
  "salesManagerPercentGrossMargin":0.0,
  "status":"Placed"
}

Re: Unknown internal error when trying to create Placement via REST API

Posted: Wed Mar 20, 2019 6:07 am
by mhuggins
Hello,

From further investigation into this, this error is being generated as the call does not require the JobSubmission to be referenced when creating a placement. If you remove that from the body of your call and try once more you should see success.

If you have any further issues though please do let me know.

Re: Unknown internal error when trying to create Placement via REST API

Posted: Fri Mar 22, 2019 5:32 am
by kamilb
Thank you, that seems to do the trick