jobapis / jobs-usajobs
Making it simple to integrate your application with the USAJOBS API.
Installs: 4 240
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 2
Open Issues: 0
Requires
- php: >=5.5.0
- jobapis/jobs-common: ^2.0.0
Requires (Dev)
- mockery/mockery: >=0.9.4
- phpunit/php-code-coverage: ~2.0
- phpunit/phpunit: >=4.6
- squizlabs/php_codesniffer: ~2.0
This package is auto-updated.
Last update: 2024-10-29 04:53:04 UTC
README
This package provides USAJOBS Job Search API support for Jobs Common.
Installation
To install, use composer:
composer require jobapis/jobs-usajobs
Usage
Create a Query object and add all the parameters you'd like via the constructor.
// Add parameters to the query via the constructor $query = new JobApis\Jobs\Client\Queries\UsajobsQuery([ 'AuthorizationKey' => YOUR_API_KEY ]);
Or via the "set" method. All of the parameters documented can be added.
// Add parameters via the set() method $query->set('Keyword', 'engineering');
You can even chain them if you'd like.
// Add parameters via the set() method $query->set('LocationName', 'Chicago, IL') ->set('JobCategoryCode', '1234');
Then inject the query object into the provider.
// Instantiating provider with a query object $client = new JobApis\Jobs\Client\Provider\UsajobsProvider($query);
And call the "getJobs" method to retrieve results.
// Get a Collection of Jobs $jobs = $client->getJobs();
This will return a Collection of Job objects.
Testing
$ ./vendor/bin/phpunit
If you want to run a complete integration test, you need to provide your API Key:
$ AUTHORIZATION_KEY=<YOUR_API_KEY> ./vendor/bin/phpunit
Contributing
Please see CONTRIBUTING for details.
Credits
License
The Apache 2.0. Please see License File for more information.