Rest Login - 02624137

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

Moderators: StaffingSupport, s.emmons, BullhornSupport

briansallee
User
Posts: 4
Joined: Tue Nov 21, 2017 5:10 pm

Rest Login - 02624137

Postby briansallee » Tue Nov 21, 2017 5:19 pm

So we have a situation where we are getting an error creating the rest client. It works for one of our IDs, but not the other.
However it appears we get normal and expected results when performing the login via curl or interactivly.

We are using the bullhorn "sdk-rest-1.2.14.jar" to create the restclient

Stack trace as follows
org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]
at org.json.JSONTokener.syntaxError(JSONTokener.java:433)
at org.json.JSONObject.<init>(JSONObject.java:195)
at org.json.JSONObject.<init>(JSONObject.java:319)
at com.bullhornsdk.data.api.helper.RestApiSession.login(RestApiSession.java:232)
at com.bullhornsdk.data.api.helper.RestApiSession.createSession(RestApiSession.java:128)
at com.bullhornsdk.data.api.helper.RestApiSession.<init>(RestApiSession.java:88)
at com.rusapi.candigram.frontoffice.BullhornRestClient.authenticate(BullhornRestClient.java:86)
at com.rusapi.candigram.frontoffice.RpBullhornFrontOfficeImpl.deliver(RpBullhornFrontOfficeImpl.java:54)
at com.rusapi.candigram.camel.FrontOfficeProcessor.process(FrontOfficeProcessor.java:106)
at org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:103)
at org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:71)
at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)
at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:468)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:87)
at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:112)
at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:721)
at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:681)
at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:651)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:315)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:253)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1158)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1150)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1047)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Appears to me we are getting some kind of invalid result back for the user, yet like I said I can login in interactivly and through curl using same credentials.

Anyone come across anything similar?
Thanks
Brian

pmularski
Bullhorn Support Staff
Posts: 884
Joined: Wed Dec 31, 1969 8:00 pm

Re: Rest Login

Postby pmularski » Wed Nov 22, 2017 10:00 am

Good Morning Brian,

Without seeing your code, it is going to be hard to diagnose the possible cause. Doing some quick google work, this post may have some helpful coding solutions for you, or at least will give you a possible next set of steps.

https://stackoverflow.com/questions/4773663/jsonobject-text-must-begin-with
Patrick Mularski
Senior Enterprise Support Analyst
B U L L H O R N
Staffing and Recruiting Software, On Target, On Demand
Bullhorn Support Contact Numbers
US: 617-478-9126
UK: 44 800 032 2848
Australia: 61 28 073 5089
International: 617-478-9131

briansallee
User
Posts: 4
Joined: Tue Nov 21, 2017 5:10 pm

Re: Rest Login - 02624137

Postby briansallee » Wed Nov 22, 2017 11:44 am

Patrick, thanks for the response. I had already googled that, and several other things looking for some low hanging fruit.
The thing is, the code being used is in Bullhorns jar so I don't have any code to provide, the extent of our code is to invoke a method in the jar (passing in credentials)

The error appears to be something from the Bullhorn rest client itself, which is generated trying to parse the results returned from the API during oauth2 negotiation. But since this is a BH provided jar, and the error appears to be between that jar and the BH API there isn't a lot more I can provide.

Thanks
Brian

briansallee
User
Posts: 4
Joined: Tue Nov 21, 2017 5:10 pm

Re: Rest Login - 02624137

Postby briansallee » Wed Nov 22, 2017 1:42 pm

And now it is working again with no changes on my part.
Weird.
Thanks again,
Brian


Return to “REST API”

Who is online

Users browsing this forum: No registered users and 5 guests