Developer Resources
Build innovative healthcare recruitment solutions with NHSJob's developer tools and APIs.
Developer Resources
Client Libraries
Our official client libraries make it easy to integrate with the NHSJob API in your preferred programming language. These libraries handle authentication, error handling, rate limiting, and provide a convenient interface for all API operations.
JavaScript Library
Official JavaScript client for the NHSJob API with TypeScript support.
Installation
npm install nhsjob-js
Features
- Full TypeScript support
- Promise-based API
- Automatic rate limit handling
- Comprehensive error handling
- OAuth 2.0 authentication helper
Example Usage
import { NHSJobClient } from 'nhsjob-js';
// Initialize the client with your API key
const client = new NHSJobClient({
apiKey: 'your_api_key_here'
});
// Search for nursing jobs in London
async function searchNursingJobs() {
try {
const jobs = await client.jobs.search({
specialty: 'nursing',
location: 'London',
page: 1,
limit: 10
});
console.log(`Found ${jobs.meta.total_count} nursing jobs`);
jobs.data.forEach(job => {
console.log(`${job.title} - ${job.location} - ${job.salary_range}`);
});
} catch (error) {
console.error('Error searching jobs:', error);
}
}
Python Library
Python client library for the NHSJob API with async support.
Installation
pip install nhsjob-python
Features
- Synchronous and asynchronous API
- Comprehensive test coverage
- Automatic pagination
- Webhook signature verification
- Type hints for modern Python
Example Usage
import nhsjob
# Initialize the client
client = nhsjob.Client(api_key="your_api_key_here")
# Get a specific job
try:
job = client.jobs.get("job_12345")
print(f"Job title: {job.title}")
print(f"Location: {job.location}")
print(f"Salary range: {job.salary_range}")
# Submit an application
application = client.applications.create(
job_id=job.id,
candidate_id="cand_54321",
resume_url="https://example.com/resume.pdf",
cover_letter="I am writing to express my interest..."
)
print(f"Application submitted with ID: {application.id}")
except nhsjob.exceptions.NotFoundError:
print("Job not found")
except nhsjob.exceptions.AuthenticationError:
print("Invalid API key")
except nhsjob.exceptions.APIError as e:
print(f"API error: {e}")
PHP Library
PHP client for the NHSJob API with Laravel integration.
Installation
composer require nhsjob/nhsjob-php
Features
- Laravel integration
- PSR-18 HTTP client compatibility
- Webhook handling
- Detailed logging
- Comprehensive exception handling
Example Usage
<?php
require_once 'vendor/autoload.php';
use NHSJobClient;
use NHSJobExceptionApiException;
// Initialize the client
$client = new Client('your_api_key_here');
try {
// Search for jobs
$searchParams = [
'specialty' => 'cardiology',
'contract_type' => 'permanent',
'page' => 1,
'limit' => 20
];
$jobs = $client->jobs->search($searchParams);
echo "Found {$jobs->meta->total_count} jobs
";
foreach ($jobs->data as $job) {
echo "{$job->title} - {$job->location}
";
}
} catch (ApiException $e) {
echo "Error: {$e->getMessage()}
";
echo "Error code: {$e->getCode()}
";
}
Ruby Library
Ruby gem for interacting with the NHSJob API.
Installation
gem install nhsjob-ruby
Features
- Rails integration
- Automatic retry with backoff
- Idiomatic Ruby interface
- Comprehensive documentation
- OAuth 2.0 support
Example Usage
require 'nhsjob'
# Configure the client
NHSJob.configure do |config|
config.api_key = 'your_api_key_here'
config.max_retries = 3
end
# Create a client instance
client = NHSJob::Client.new
begin
# Get all applications for a specific job
applications = client.applications.list(job_id: 'job_12345')
puts "Found #{applications.total_count} applications"
applications.each do |application|
puts "Application ID: #{application.id}"
puts "Candidate: #{application.candidate_name}"
puts "Status: #{application.status}"
puts "Submitted: #{application.submitted_at}"
puts "---"
end
rescue NHSJob::Error => e
puts "Error: #{e.message}"
end
Community Libraries
In addition to our official libraries, the NHSJob developer community has created libraries for other languages and frameworks. While these are not officially supported, they may be useful for your integration needs.
Contributing
All our official client libraries are open source and we welcome contributions from the community. If you'd like to contribute, please check out the GitHub repositories and review the contribution guidelines.
If you've built a library for a language we don't officially support, please let us know at developers@nhsjob.net and we may feature it in our community libraries section.
Need Help?
If you have questions or need assistance with our client libraries, check out these resources:
- Check the Developer FAQ for common questions
- Join our Developer Discord community
- Email us at api-support@nhsjob.net