Giter VIP home page Giter VIP logo

sdk-rest's Introduction

sdk-rest

A Java client library for working with the Bullhorn REST API. Handles authentication and objectifies API operations.

Available as a Maven dependency

Add dependency to your pom file

	<dependency>
		<groupId>com.bullhorn</groupId>
		<artifactId>sdk-rest</artifactId>
		<version>1.0</version>
	</dependency>

Basic setup:

Provide your credentials and instantiate StandardBullhornApiRest:

        BullhornRestCredentials creds = new BullhornRestCredentials();
		creds.setPassword("apipassword");
		creds.setRestAuthorizeUrl("rest.authorizeUrl");
		creds.setRestClientId("rest.clientId");
		creds.setRestClientSecret("rest.clientSecret");
		creds.setRestLoginUrl(env.getProperty("rest.loginUrl");
		creds.setRestSessionMinutesToLive("rest.sessionMinutesToLive");
		creds.setRestTokenUrl("rest.tokenUrl");
		creds.setUsername("apiusername");
		BullhornData bullhornData = new StandardBullhornData(creds);

Usage

See the unit tests for sample usage.

Use with Spring Boot

Add a configuration class:

@Configuration
@PropertySource("classpath:application-${spring.profiles.active}.properties")
public class AppConfig {

	@Autowired
	private Environment env;

	@Bean
	public static PropertySourcesPlaceholderConfigurer propertyPlaceholderConfigurer() {
		return new PropertySourcesPlaceholderConfigurer();
	}

	/**
	 * Provide your credentials and instantiate {@link StandardBullhornData} with those.
	 * @return
	 */
	@Profile({ "staging", "production" })
	@Bean
	public BullhornData bullhornData() {

		RestCredentials creds = new BullhornRestCredentials();
        creds.setPassword("apipassword");
        creds.setRestAuthorizeUrl("rest.authorizeUrl");
        creds.setRestClientId("rest.clientId");
        creds.setRestClientSecret("rest.clientSecret");
        creds.setRestLoginUrl(env.getProperty("rest.loginUrl");
        creds.setRestSessionMinutesToLive("rest.sessionMinutesToLive");
        creds.setRestTokenUrl("rest.tokenUrl");
        creds.setUsername("apiusername");
		return new StandardBullhornData(creds);

	}

	/**
	 * Using {@link MockBullhornData} for testing purposes. This implementation of {@link BullhornData} uses test data stored in local
	 * text files.
	 * 
	 * @return
	 */
	@Profile("testing")
	@Bean
	public BullhornData mockBullhornData() {

		return new MockBullhornData();

	}
}

sdk-rest's People

Contributors

johnsully83 avatar awubullhorn avatar ndickerson avatar acrowe2 avatar hiqbal01 avatar monroepe avatar thegiddylimit avatar bullhorn-adye avatar maartenoortwijn avatar tkennedy0617 avatar jlrutledge-bh avatar andrew-balzer avatar mikecogle avatar ccarbonellbh avatar bullhorn-pmckinstry avatar magnusfiorepalm avatar selckin avatar ianweist avatar

Watchers

James Cloos avatar Luke Grey avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.