SOAP API 2.5 Get Placement Edit History

Forum for users and developers of Bullhorn's Webservices API suite

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
htphuong82
User
Posts: 20
Joined: Wed May 21, 2014 4:23 am

SOAP API 2.5 Get Placement Edit History

Post by htphuong82 » Thu Jun 26, 2014 11:50 pm

Hello,

Can we be able to get Placement Edit History by using SOAP API 2.5? In case it is possible, could you guys share me a piece of code or a link so that I can find some reference?

I am struggling with this 2 days long and have not found any clues. Below is a post that I assumed someone already did it
Thanks,
Phuong
Phuong
Developer

s.emmons
User
Posts: 333
Joined: Wed Dec 31, 1969 8:00 pm

Re: SOAP API 2.5 Get Placement Edit History

Post by s.emmons » Fri Jun 27, 2014 10:11 am

Hi Phoung,

Our documentation for operations to retrieve edit history in 2.5 is located at the following:

Get Edit History:http://developer.bullhorn.com/doc/versi ... istory.htm
By Dates: http://developer.bullhorn.com/doc/versi ... ydates.htm
By TransactionID: http://developer.bullhorn.com/doc/versi ... tionid.htm
Sam Emmons
Enterprise Team Lead
BULLHORN
US Support 617-478-9126

htphuong82
User
Posts: 20
Joined: Wed May 21, 2014 4:23 am

Re: SOAP API 2.5 Get Placement Edit History

Post by htphuong82 » Mon Jun 30, 2014 6:44 am

Hi Sam,

Thanks for the hints, it works for me even there are no phrases in the doc mentioning to Placement.
I could retrieve needed data from APIs. Good supports!

Thanks,
Phuong
Phuong
Developer

htphuong82
User
Posts: 20
Joined: Wed May 21, 2014 4:23 am

Re: SOAP API 2.5 Get Placement Edit History

Post by htphuong82 » Mon Jun 30, 2014 11:20 pm

I share my code in case anyone needs it thanks to Sam again.

Code: Select all

	    ApiService_PortType service = new ApiService_ServiceLocator().getApiServicePort();
	    ApiStartSessionResult startSession = service.startSession("xxxx", "xxxx", "xxxxx-xxxx-xxxx-xxxxxxxxxxxxxxx");        
	    String session = startSession.getSession();  	    	    
        
	    // PLACEMENT EDIT HISTORY WITH ID = 48
	    ApiGetEditHistoryResult editHistoryResult = service.getEditHistory(session, ApiEntityName.Placement.getValue(), 48);
	    if (editHistoryResult != null)
	    {
	    	
	    	ApiEditHistory[] editHistory = editHistoryResult.getEditHistories();
	    	
	    	if ( editHistory != null)
	    	{
	    		for (int i = 0; i < editHistory.length; i++)
		    	{
		    		System.out.println("getTransactionId: " + editHistory[i].getTransactionId());
		    		System.out.println("getEntityId: " + editHistory[i].getEntityId());
		    		System.out.println("getDateAdded: " + editHistory[i].getDateAdded().getTime());
		    		ApiEditHistoryFieldChange[] editHistoryFieldChange = editHistory[i].getFieldChanges();
	    			for (int j = 0; j < editHistoryFieldChange.length; j++)
	    			{
	    				System.out.println();
	    				System.out.println("getColumn Name: " + editHistoryFieldChange[j].getColumnName());
	    				System.out.println("getNewValue: " + editHistoryFieldChange[j].getNewValue());
	    				System.out.println("getOldValue: " + editHistoryFieldChange[j].getOldValue());
	    			}
		    	}
	    	}
	    	else
	    	{
	    		System.out.println("Null");
	    	}
	    }
	    else
	    {
	    	System.out.println("Null");
	    }
By the way, I have questions due to Bullhorn database:
  • 1. I found that there are two tables for recording histories of Placement. One is BH_PlacementHistory and another one is BH_PlacementEditHistory, the first one had been created at the day the first placement was created, while the second was created on April 2009 which is several years later. As a result, all placement histories which was generated before 2009 won't be available. It returns NULL instead, so it took me much time as I thought the APIs don't work. What is the reason? And do we have any way to fix it? (for us, it is not so important. Just to understand deeply).
    2. There are no Category tables on database that was provided by Bullhorn. I guess there is just one table which used for all companies and won't be shared; therefore, I could not retrieve old category names which were used in the past, but the current one. Could you tell me if there are ways to get old category names because we still see them on the web (in case no one has updated yet)?
Phuong
Developer

s.emmons
User
Posts: 333
Joined: Wed Dec 31, 1969 8:00 pm

Re: SOAP API 2.5 Get Placement Edit History

Post by s.emmons » Tue Jul 01, 2014 9:51 am

Hi Phuong,

The are two sections on the History tab for placements in Bullhorn.

BH_PlacementHistory corresponds to the "Summary" section.

BH_PlacementEditHistory and BH_PlacementEditHistoryFieldChange correspond to the "Detail" section.

Categories, specialties, and skills are stored in a master database on our side. You can submit a ticket to Bullhorn Support to have this data provided for your environment.

Hope this helps!
Sam Emmons
Enterprise Team Lead
BULLHORN
US Support 617-478-9126

htphuong82
User
Posts: 20
Joined: Wed May 21, 2014 4:23 am

Re: SOAP API 2.5 Get Placement Edit History

Post by htphuong82 » Wed Jul 02, 2014 5:11 am

Thanks Sam again,

I will make a request Bullhorn Support.

Good day!
Phuong
Developer

srookey
User
Posts: 1
Joined: Tue Oct 20, 2015 2:52 pm

Re: SOAP API 2.5 Get Placement Edit History

Post by srookey » Thu Nov 05, 2015 12:11 pm

htphuong82 wrote:I share my code in case anyone needs it thanks to Sam again.

Code: Select all

	    ApiService_PortType service = new ApiService_ServiceLocator().getApiServicePort();
	    ApiStartSessionResult startSession = service.startSession("xxxx", "xxxx", "xxxxx-xxxx-xxxx-xxxxxxxxxxxxxxx");        
	    String session = startSession.getSession();  	    	    
        
	    // PLACEMENT EDIT HISTORY WITH ID = 48
	    ApiGetEditHistoryResult editHistoryResult = service.getEditHistory(session, ApiEntityName.Placement.getValue(), 48);
	    if (editHistoryResult != null)
	    {
	    	
	    	ApiEditHistory[] editHistory = editHistoryResult.getEditHistories();
	    	
	    	if ( editHistory != null)
	    	{
	    		for (int i = 0; i < editHistory.length; i++)
		    	{
		    		System.out.println("getTransactionId: " + editHistory[i].getTransactionId());
		    		System.out.println("getEntityId: " + editHistory[i].getEntityId());
		    		System.out.println("getDateAdded: " + editHistory[i].getDateAdded().getTime());
		    		ApiEditHistoryFieldChange[] editHistoryFieldChange = editHistory[i].getFieldChanges();
	    			for (int j = 0; j < editHistoryFieldChange.length; j++)
	    			{
	    				System.out.println();
	    				System.out.println("getColumn Name: " + editHistoryFieldChange[j].getColumnName());
	    				System.out.println("getNewValue: " + editHistoryFieldChange[j].getNewValue());
	    				System.out.println("getOldValue: " + editHistoryFieldChange[j].getOldValue());
	    			}
		    	}
	    	}
	    	else
	    	{
	    		System.out.println("Null");
	    	}
	    }
	    else
	    {
	    	System.out.println("Null");
	    }
Phuong,

Thank you for sharing your code. This was very helpful.
~ Sandra

Post Reply