blashbrook / papiclient
Provides Client for Polaris ILS API
v2.0.0
2025-09-11 19:17 UTC
Requires
- php: ^8.2
- league/commonmark: ^2.4.0
- nette/schema: ^v1.3.0
Requires (Dev)
- orchestra/testbench: ^v8.22.2
- phpunit/phpunit: ~10
- symfony/console: ^v6.4.6
- symfony/css-selector: ^v7.0.3
- symfony/event-dispatcher: ^v7.0.3
- symfony/stopwatch: v7.3.0
- symfony/string: ^v7.0.3
- dev-master
- v2.0.0
- v1.5.0
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.19
- v1.3.18
- v1.3.17
- v1.3.16
- v1.3.15
- v1.3.14
- v1.3.13
- v1.3.12
- v1.3.11
- v1.3.10
- v1.3.9
- v1.3.8
- v1.3.7
- v1.3.6
- v1.3.5
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.0
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.3-alpha
- v1.0.2
- v1.0.1
- dev-dependabot/npm_and_yarn/marked-16.3.0
- dev-dev-master
This package is auto-updated.
Last update: 2025-09-15 01:05:24 UTC
README
This is where your description should go. Take a look at contributing.md to see a to do list.
Installation
Via Composer
$ composer require blashbrook/papiclient
Add the following variables to the project .env file
# Access ID found under PAPI Key Management in the Polaris Web Admin Tool i.e. https://catalog.yourlibrary.org/webadmin/PAPIKeyManagement.aspx PAPI_ACCESS_ID= # Access Key found under PAPI Key Management in the Polaris Web Admin Tool i.e. https://catalog.yourlibrary.org/webadmin/PAPIKeyManagement.aspx PAPI_ACCESS_KEY= # Polaris API base URL i.e. https://catalog/yourlibrary.org/PAPIService/REST PAPI_BASE_URL= # default PAPI_PROTECTED_SCOPE=protected # default PAPI_PUBLIC_SCOPE=public # default PAPI_VERSION=v1 # default PAPI_LANGID=1033 # default PAPI_APPID=100 # default PAPI_ORGID=3 # default protected PAPI URL constructor PAPI_PROTECTED_URI="${PAPI_BASE_URL}/${PAPI_PROTECTED_SCOPE}/${PAPI_VERSION}/${PAPI_LANGID}/${PAPI_APPID}/${PAPI_ORGID}/" # default public PAPI URL constructor PAPI_PUBLIC_URI="${PAPI_BASE_URL}/${PAPI_PUBLIC_SCOPE}/${PAPI_VERSION}/${PAPI_LANGID}/${PAPI_APPID}/${PAPI_ORGID}/" # Polaris branch ID found in Polaris under Administration > Explorer > Branches # Right-click branch name and select Properties > About PAPI_LOGONBRANCHID= # Search under Administration > Staff Member in Polaris # Right-click staff member name and select Properties > About PAPI_LOGONUSERID= # Search under Administration > Workstation in Polaris # Right-click workstation name and select Properties > About PAPI_LOGONWORKSTATIONID= # Active Directory Domain used to log into Polaris i.e. Domain\Username PAPI_DOMAIN= # Polaris username (or if no Domain, user's email address) PAPI_STAFF= # Polaris user password in double quotes PAPI_PASSWORD= # Email to receive staff notifications in double quotes PAPI_ADMIN_EMAIL="ecard@dcplibrary.org" # Display name for staff email in double quotes PAPI_ADMIN_NAME=
Usage
- Use Injection to instantiate PAPIClient in a class:
use Blashbrook\PAPIClient\PAPIClient;
protected PAPIClient $papiclient;
public function __construct(PAPIClient $papiclient) {
$this->papiclient = $papiclient;
}
- In a Livewire component, use the boot method:
use Blashbrook\PAPIClient\PAPIClient;
protected PAPIClient $papiclient;
public function boot(PAPIClient $papiclient) {
$this->papiclient = $papiclient;
}
- To make an API call to your Polaris server:
// Validate PAPI Access Key
$response = $this->papiclient->method('GET')->uri('apikeyvalidate')->execRequest();
- functions include:
- method('GET|PUT')
- protected() // Uses the protected API base URI instead of the default public URI.
- patron('BARCODE') // Allows you to insert a patron's barcode into the URI.
- uri('API Endpoint') // The part of the URI that performs the desired function (i.e 'authenicator/patron' or 'apikeyvalidate').
- params(array) // Used for form submissions (i.e. ['Barcode'=>'55555555555555', 'Password'=> '1234'] is sent to log in a patron).
- auth('AccessSecret') // Inserts a patron's temporary authentication token in the request headers.
- MORE TO COME!
Change log
PAPIClient has been refactored to use fluency! Now you can chain commands together, making the client more flexible and easier to use.
Please see the changelog for more information on what has changed recently.
@TODO Add Error catching
Testing
$ composer test
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email author email instead of using the issue tracker.
Credits
License
license. Please see the license file for more information.