Unknown internal error when trying to create Placement via REST API

Forum for users and developers of Bullhorn's API service.

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
kamilb
User
Posts: 6
Joined: Wed Jan 02, 2019 6:18 am

Unknown internal error when trying to create Placement via REST API

Post by kamilb » Mon Mar 18, 2019 9:48 am

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.
Last edited by kamilb on Tue Mar 19, 2019 8:53 am, edited 1 time in total.

mhuggins
User
Posts: 10
Joined: Mon Feb 25, 2019 10:06 am

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

Post by mhuggins » Mon Mar 18, 2019 10:25 am

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

kamilb
User
Posts: 6
Joined: Wed Jan 02, 2019 6:18 am

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

Post by kamilb » Tue Mar 19, 2019 11:37 am

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"
}

mhuggins
User
Posts: 10
Joined: Mon Feb 25, 2019 10:06 am

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

Post by mhuggins » Wed Mar 20, 2019 6:07 am

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.

kamilb
User
Posts: 6
Joined: Wed Jan 02, 2019 6:18 am

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

Post by kamilb » Fri Mar 22, 2019 5:32 am

Thank you, that seems to do the trick

Post Reply