Page 1 of 1

SOAP API 2.5 Get Placement Edit History

Posted: Thu Jun 26, 2014 11:50 pm
by htphuong82
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

Re: SOAP API 2.5 Get Placement Edit History

Posted: Fri Jun 27, 2014 10:11 am
by s.emmons
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

Re: SOAP API 2.5 Get Placement Edit History

Posted: Mon Jun 30, 2014 6:44 am
by htphuong82
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

Re: SOAP API 2.5 Get Placement Edit History

Posted: Mon Jun 30, 2014 11:20 pm
by htphuong82
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)?

Re: SOAP API 2.5 Get Placement Edit History

Posted: Tue Jul 01, 2014 9:51 am
by s.emmons
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!

Re: SOAP API 2.5 Get Placement Edit History

Posted: Wed Jul 02, 2014 5:11 am
by htphuong82
Thanks Sam again,

I will make a request Bullhorn Support.

Good day!

Re: SOAP API 2.5 Get Placement Edit History

Posted: Thu Nov 05, 2015 12:11 pm
by srookey
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.