Defaults: CurlTransport and MemoryTokenStore. Calls nothing.
Client::fromEnv(?TokenStore $store = null)
A client with Config::fromEnv().
config(): Config
The settings of this client.
Any endpoint
The path is relative to the REST URL of the session, such as entity/Candidate/1. A full URL is refused. $query is added to the URL, booleans as true and false.
$fields is a comma separated string or a list. Pass start and count in $query to page.
Session
Method
What it does
ping(): array
GET ping. Logs in when there is no session. sessionExpires is in milliseconds.
isAlive(): bool
Logs in when needed and pings. true when Bullhorn answers, false on any failure; never throws a BullhornException. Costs a login without a session: cache the answer.
forgetSession(): void
Drops the session here and in the store. The next call logs in.
Config
Darvis\BullhornApi\Config, immutable. Every default is a constant on the class.
Argument
fromArray() key
Default
clientId
client_id
empty
clientSecret
client_secret
empty
username
username
empty
password
password
empty
loginInfoUrl
login_info_url
Config::LOGIN_INFO_URL
oauthUrl
oauth_url
empty: from loginInfo
restUrl
rest_url
empty: from loginInfo
apiVersion
api_version
*
sessionTtl
session_ttl
60 minutes
timeout
timeout
30.0 seconds
connectTimeout
connect_timeout
10.0 seconds
Config::fromArray(array $values) trims strings and falls back to the default for an empty or unusable value; a password is kept as it is. Config::fromEnv() reads BULLHORN_ plus the key in capitals. missing() lists the credentials that are empty.
Token stores
All implement Darvis\BullhornApi\Token\TokenStore.
Class
Keeps the session
Darvis\BullhornApi\Token\MemoryTokenStore
on the instance, for one process
Darvis\BullhornApi\Token\FileTokenStore
in a file per API user, in an absolute directory outside the web root
Darvis\BullhornApi\Laravel\CacheTokenStore
in Laravel’s cache, encrypted with APP_KEY, with a cache lock
Transports
All implement Darvis\BullhornApi\Http\Transport and return a Darvis\BullhornApi\Http\Response with status, body, headers and header($name).