jonathanraftery / bullhorn-rest-client

Simple client for the Bullhorn REST API
MIT License
11 stars 14 forks source link

Sometimes getting refresh token issue #1

Closed vikram0460 closed 6 years ago

vikram0460 commented 6 years ago

Sometimes the session refresh is not working.

Is there anyway that we can all the records of candidates, companies, contacts, job orders, placements?

jonathanraftery commented 6 years ago

Please post specifics of the behavior you're seeing regarding the session refresh. Note that the default memory store used by the auth client depends on write access to the execution directory, and does not offer sufficient security for many environments.

Job orders can be retrieved with $jobOrders = $client->JobOrders->search($luceneConditions, ['*']); Using conditions such as 'isDeteted:false' will return all active job orders, even if the entity count is greater than the Bullhorn limit of 500 per request. The client will make multiple requests and return the concatenated array of job orders.

The second optional parameter to the method is an array of field names you want to pull for the job orders. In this example, ['*'] will pull all fields. ['id','title','dateBegin'] is another possible usage, and ['id'] is default.

Currently, this client offers fairly limited functionality and does not support candidates, placements, etc. Retrieving them is very similar to retrieving the job orders, and the JobOrders class can be used as a guide in pulling the rest. (Eventually we plan to add this to the client by default.)

vikram0460 commented 6 years ago

Thanks for the reply, as it was getting only few times, I missed to capture the screenshot. When I found the issue next time I will have the screenshot and post it here.

By the way thanks for the plug-in it is very useful for me.

jonathanraftery commented 6 years ago

Thank you! Very glad it was helpful.

I've added the job order entity requests to the readme, and will certainly correct any issues you identify with the session refresh!

vikram0460 commented 6 years ago

Thanks for the update.

There is another issue, it is reoccurring, I think this problem with Bullhorn not with your plug-in.

Anyway I am posting here it might give you an idea

I have masked code with XXXXXX original request has different value.

Client error: GET https://rest31.bullhornstaffing.com/rest-services/XXXXXX/search/Candidate?fields=*&query=isDeleted:0&count=500&start=1000 resulted in a 400 Bad Request response: { "errorMessage" : "Could not access HTTP invoker remote service at [http://sl131dataservices.vip.bos.bullhorn.com/dat (truncated...) /var/www/html/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php113

vikram0460 commented 6 years ago

Getting session issue like below

Identity provider exception {"exception":"[object] (jonathanraftery\Bullhorn\Rest\Authentication\AuthorizationException(code: 0): Identity provider exception at /var/www/html/vendor/jonathanraftery/bullhorn-auth-client/src/Client.php:154)

session_refresh_issue_bullhorn

jonathanraftery commented 6 years ago

This is most often caused by incorrect credentials (clientID or client secret). However, it will also occur with credentials which have never been used before, as the client will run into the terms of service acknowledgement, which it currently does not automate through. In that case, you will need to manually go through the OAuth login one time, using those credentials, to clear the ToS acknowledgement.

jonathanraftery commented 6 years ago

Regarding the refresh issues, see issue #4 . This is quite likely the cause of the problems you were experiencing (now fixed).

vikram0460 commented 6 years ago

Issue is re occurring.