RSM InTime provides a SOAP Web Service Interface that allows two-way flow of information to external systems. This enables automated and efficient transfer of data to and from your other systems reducing effort and duplication.
If you would like to enable the use of Web Services please contact our Support team. This will need to be enabled on your system and a set of credentials for accessing the service will be supplied.
The full technical API specification is available here.
Create web services account
You can create web services account for a user using the create or edit options under profiles -> administrators screen. This feature automatically adds the user as a web services user, allowing them to access the RSM InTime API.
To create a web services account, follow these steps:
Go to profiles -> administrators.
Click create to add a new administrator or edit to modify an existing profile.
Enter the required details. You must enter a valid email address to receive the account password.
Select the web service account check box. A warning message appears, click OK. Then click Save.
A web service agency reference code is generated, which is common for all users in the same agency. The configured user can use the agency reference code, username, and password for web services authentication.
Scenarios and uses
This section describes various scenarios of how the Web Services can be used.
Authentication
Before you can call any other RSM InTime Web Service method you must first call the authenticate() method. Providing valid credentials to this method will return an authentication token that must be provided with all other Web Service calls.
Modified Items
getModifiedItems() and getModifiedItemsWithRefCode() functions return a list of items that have been updated since a specific date and time. This is useful where you wish to maintain a copy of various entities in an external system.
When you first start go live with the Web Services you can use this function to get a list of all existing entities by specifying a date that is earlier than the first entity in the system. You can then read in the details of all the entities so you know you have a complete copy of all the data in RSM InTime. This can be a large amount of data and could take a significant amount of resources so should only be a one-off exercise at the start of the integration.
Once you have a current copy you can then periodically check for any items that have been modified since the last update and just update the details of those modified items. This is much more efficient than attempting to update all entities every the time.
Identifying Entities
Most RSM InTime entities can be referenced by three different fields: the internal database ID (primary key); a GUID referred to as "refCode"; and the "externalId". We recommend using the externalId wherever possible as this is what is displayed as the primary reference in the RSM InTime UI, can contain alpha-numerics and is human readable. Some entities such as InvoiceInfo do not have an externalId field so the refCode should be used to reference these.
Data Retrieval (Read operations)
There are a number of methods that enable you to read back the full details of an entity. The required entity can be identified by a number of different fields. Examples are:
getWorkerByRefCode() returns the worker entity that has the specified RefCode.
getClientById() returns the Client entity with the specified Id.
getPlacementByExternalId() returns the Placement entity with the specified External Id.
getUsersByExternalId() returns a list of User entities that have the specified External Id. For this method a list of items rather than a single items is returned as is it possible, although not advisable, to have multiple users with the same external Id.
getTimesheetById() returns the Timesheet with the specified Id.
These methods return a complex data structure that represents the RSM InTime entity. Some of these also contain other data types that constain information about related entities. For example the Timesheet object that is returned from getTimesheetById() can also contain a number of InvoiceInfo objects that hold information about the invoices that the Timesheet is associated with. It also contains a number of Shift objects that detail the worked time that has been entered on the Timesheet.
There are also a number of Search type methods that retrieve multiple results. This enables you to retrieve a set of entities that are filtered according to some criteria. Examples are:
getTimesheetIdsWithStatusAndDatesForWorker() This returns a list of Timesheet Ids for a specific Worker that have a specific status within a certain date range.
getInvoicesForClient() This returns a list of all invoices relating to a specific Client.
Data Creation (Write Operations)
From version 2.0 onwards it is possible to create data in RSM InTime via the Web Services. This includes the following entities: Worker, Client, Manager, Consultant, Provider, Placement and Timesheet. These mostly take the form of createOrUpdate<Entity> as this allows the same method to be used to create the entity if it doesn't exist or update it if it does. Examples are: createOrUpdateWorker(), createorUpdatePlacement() and createOrUpdateProvider()
If you are gong to create and update data in RSM InTime it is best practice to attempt to read the entity from RSM InTime first. This ensures that any updates made within the UI are not lost and any fields not accessible through the API are not overwritten by the Web Service update. This is demonstrated in the examples below.
Timesheets
updateTimesheet() method will create a new Timesheet or update an existing one if it exists in Draft status. The Timesheet will be saved with Draft status. The Timesheet object you supply to this method must contain all the necessary data which includes a valid Placement reference, the Period End date and one or more Shifts. Each Shift must reference a valid Rate from the Placement, the Time worked or a Decimal value and the Date on which it was worked. It will normally be necessary to retrieve the details of the Placement the Timesheet relates to in order to correctly complete all the required fields.
As of 3.12 there is a "hidden" parameter. This creates the timesheet but keeps it hidden from the UI so it can not be affected by UI processes. This can be used to create a timesheet that should only be invoiced via the web services for example. Hidden timesheets can be updated via this method while they are still in draft status but you must set the hidden parameter of the method call to true. You can unhide the timesheet by changing the "hidden" property of the timesheet to false. Hidden timesheets still have to be approved before they can be invoiced/exported - the forceApproveTimesheet can be used for this which bypasses the approval route. Hidden timesheets are automatically unhidden when first invoiced on either the Sales or Purchase side.
submitTimesheet() would then be called to submit the Timesheet for approval once it has all the necessary time (Shifts) added to it.
rejectTimesheet() or approveTimesheet() are then used to process the approval.
revertTimesheet() can also be used to revert a Submitted or Approved status Timesheet if required. This has exactly the same result as reverting a Timesheet though the RSM InTime UI.
Invoicing
As of 3.12 you can generate invoices using the generateInvoices( ) method. This method requires a SearchCriteria parameter which is used to filter the items to be invoiced. This needs to be populated with appropriate criteria to select only the items you wish to invoice.
Warning: if no criteria are specified all invoiceable items in the system will be invoiced!
It is possible to specify a list of specific timesheet IDs or ExpenseItem IDs that you wish to invoice using SearchCriteria.timesheetIDs or SearchCriteria.expenseItemIDs.
You must specify the type of invoices you wish to generate from: ClientInvoice, SelfBillInvoice or AdviceNote.
You can not credit invoices using this method. However, invoicing net negative items will result in a Credit Note rather than an Invoice.
To invoice "Hidden" timesheets, set the SearchCriteria.includeHidden property to true.
Examples:
request.setInvoiceType("ClientInvoice");
searchCriteria.setIncludeTimesheets(true);
searchCriteria.setIncludeHidden(true);
long[] tsIds = new long[2];
tsIds[0] = 123L;
tsIds[1] = 456L;
searchCriteria.setTimesheetIDs(tsIds);
searchCriteria.setIncludeExpenses(false);
searchCriteria.setExpenseItemIDFrom(3001L);
searchCriteria.setExpenseItemIDTo(3009L);
request.setSearchCriteria(searchCriteria);
Calendar invDate = Calendar.getInstance();
invDate.set(2024,10,1,0,0,0);
request.setInvoiceDate(invDate);
As of 3.12 you can uploadSupplierInvoice() to an AdviceNote and accept it via acceptSupplierInvoice()
Single Sign On
getSingleSignOnToken() can be used to log in to RSM InTime using an existing RSM InTime User account. This method returns a token that you can then append to any valid RSM InTime URL and it will allow you to retrieve the page as if you were logged into the system directly. This means you can embed RSM InTime pages within another web site or retrieve other data.
An example SSO token would look like this:
QS5TbWl0aDoxNjk0NzY3NDI5NTM0Ojg0OThkMGY1ZTQzMzdlYzI0YjRiZjU3YzZhNDg4MDI4
So appending an SSO token for an Admin user to a URL for the summary of a Worker could look like this:
http://demo.in-time.co.uk/summary/worker?id=1&ticket=QS5TbWl0aDoxNjk0NzY3NDI5NTM0Ojg0OThkMGY1ZTQzMzdlYzI0YjRiZjU3YzZhNDg4MDI4
For the Summary screens only you can append "&embed=true" to the URL to hide the menu and footers. This does not apply to other InTime screens.
IMPORTANT: Note that once you have accessed InTime with an SSO token you are logged into InTime as that user and navigation and access rights are determined exactly as if you logged into InTime directly as that user.
Other methods
The interface also provides various other methods. Some examples:
getMissingTimesheetsForPlacement() identifies any periods within the specified range that do not contain an approved timesheet. The response will include a status that indicates if it is Missing, Draft or Submitted.
getAllPayElements() returns a list of all Pay Elements present in the system.
getURLForContractorsPayslip() retrieves the URL to viewing a workers Payslips. *InPay Linked systems only
Getting started
The RSM InTime Web Service uses the Simple Object Access Protocol (SOAP) interface as opposed to REST. This is a stricter protocol than REST which means you can only call the defined methods available and the return types will be in a fixed format. Normally you would start by building "stub" code against the WSDL file that defines the interface.
LATEST WSDL Version: https://your_system_url.com/services/IntimeServiceV3_8?wsdl
Java Example
This example was written using the WSDL file for version 3.2 of the web services on our demo system:
https://demo.in-time.co.uk/services/IntimeServiceV3_2?wsdl
Various tools are available for building the stub code. wsdl2java in the axis 2 package works well for java development:
From the command line run:
/axis2-1.6.2/bin/wsdl2java.sh -or -uri "https://demo.in-time.co.uk/services/IntimeServiceV3_2?wsdl"
This will produce the following files:
/src/uk/co/in_time/IntimeServiceV3_2Stub.java
/src/uk/co/in_time/IntimeServiceV3_2CallbackHandler.java
/src/uk/co/in_time/IntimeServiceV3_2IntimeWebServiceException.java
Include and reference these files in your application and you will be able to make calls to the Web Services. Some examples are given below.
It is important to enclose your web service calls in try / catch blocks as Exceptions are used as the mechanism for feeding back any issues. For example if you attempt to create a placement without providing an External ID, an exception will be returned from the Web Service call with an appropriate message.
Client Code - Pseudocode examples
RETRIEVING ENTITY DATA FROM A FRONTEND SYSTEM:
#Get placements and associated data from frontend system that you require in InTIME#Consultant def cons = getConsultantsByExternalID(consultantId); if(cons>1)"Error" def con = cons.first(); if(con==null)con = new Consutlant(); con*PopulateFields* createOrUpdateConsutlant(con); #Manager Client def mclients = getClientsByExternalID(mclientId); if(mclients>1)"Error" def mclient = mclients.first(); if(mclient==null)mclient = new Client(); mclient*PopulateFields* createOrUpdateClient(mclient); #Manager def mans = getManagersByExternalID(managerId); if(mans>1)"Error" def man = mans.first(); if(man==null)man = new Manager(); man.client = mclient man*PopulateFields* createOrUpdateManager(man); #Provider def provs = getProvidersByExternalID(providerId); if(provs>1)"Error" def prov = provs.first(); if(prov==null)prov = new Provider(); prov*PopulateFields* createOrUpdateProvider(prov); #Worker def wkrs = getWorkersByExternalID(workerId); if(wkrs>1)"Error" def wkr = wkrs.first(); if(wkr==null)wkr = new Worker(); if(prov!=null)wkr.provider = prov wkr*PopulateFields* createOrUpdateWorker(wkr); #Billing Client def bclients = getClientsByExternalID(bclientId); if(pclients>1)"Error" def bclient = bclients.first(); if(bclient==null)bclient = new Client(); bclient*PopulateFields* createOrUpdateClient(bclient); #Placement def plac = getPlacementByExternalID(placementId); if(plac==null)plac = new Placement(); plac.consultant = con plac.client = bclient plac.manager = man plac.worker = wkr plac*PopulateFields* createOrUpdatePlacement(plc); |
|---|
#Get placements and associated data from frontend system that you require in InTIME#Consultant def cons = getConsultantsByExternalID(consultantId); if(cons>1)"Error" def con = cons.first(); if(con==null)con = new Consutlant(); con*PopulateFields* createOrUpdateConsutlant(con); #Manager Client def mclients = getClientsByExternalID(mclientId); if(mclients>1)"Error" def mclient = mclients.first(); if(mclient==null)mclient = new Client(); mclient*PopulateFields* createOrUpdateClient(mclient); #Manager def mans = getManagersByExternalID(managerId); if(mans>1)"Error" def man = mans.first(); if(man==null)man = new Manager(); man.client = mclient man*PopulateFields* createOrUpdateManager(man); #Provider def provs = getProvidersByExternalID(providerId); if(provs>1)"Error" def prov = provs.first(); if(prov==null)prov = new Provider(); prov*PopulateFields* createOrUpdateProvider(prov); #Worker def wkrs = getWorkersByExternalID(workerId); if(wkrs>1)"Error" def wkr = wkrs.first(); if(wkr==null)wkr = new Worker(); if(prov!=null)wkr.provider = prov wkr*PopulateFields* createOrUpdateWorker(wkr); #Billing Client def bclients = getClientsByExternalID(bclientId); if(pclients>1)"Error" def bclient = bclients.first(); if(bclient==null)bclient = new Client(); bclient*PopulateFields* createOrUpdateClient(bclient); #Placement def plac = getPlacementByExternalID(placementId); if(plac==null)plac = new Placement(); plac.consultant = con plac.client = bclient plac.manager = man plac.worker = wkr plac*PopulateFields* createOrUpdatePlacement(plc); |
|---|
RETRIEVING UPDATES FROM RSM InTime:
def entityList = getModifiedItemsWithRefCode(java.lang.String token, java.util.Calendar since) for(entityList){ if(entity.getType()=="Worker")*Read full Worker and action as required* if(entity.getType()=="Placement")*Read full Placement and action as required* if(entity.getType()=="Timesheet")*Read full Timesheet and action as required* if(entity.getType()=="ExpenseItem")*Read full Expense Item and action as required* if(entity.getType()=="Client")*Read full Client and action as required* if(entity.getType()=="LtdCoProvider")*Read full Ltd Company Provider and action as required* if(entity.getType()=="Consultant")*Read full Consultant and action as required* if(entity.getType()=="Manager")*Read full Manager and action as required* if(entity.getType()=="LtdCoUser")*Read full Ltd Company User and action as required* if(entity.getType()=="Reckoning")*Read full Invoice, Credit Note or Advice Note and action as required* if(entity.getType()=="ContractDocument")*Read full Contract Document and action as required* if(entity.getType()=="PurchaseOrder")*Read full Purchase Order and action as required* if(entity.getType()=="PaymentBatch")*Read full Payment Batch and action as required* if(entity.getType()=="Project")*Read full Project and action as required (WS V2.9+)* } |
|---|
def entityList = getModifiedItemsWithRefCode(java.lang.String token, java.util.Calendar since) for(entityList){ if(entity.getType()=="Worker")*Read full Worker and action as required* if(entity.getType()=="Placement")*Read full Placement and action as required* if(entity.getType()=="Timesheet")*Read full Timesheet and action as required* if(entity.getType()=="ExpenseItem")*Read full Expense Item and action as required* if(entity.getType()=="Client")*Read full Client and action as required* if(entity.getType()=="LtdCoProvider")*Read full Ltd Company Provider and action as required* if(entity.getType()=="Consultant")*Read full Consultant and action as required* if(entity.getType()=="Manager")*Read full Manager and action as required* if(entity.getType()=="LtdCoUser")*Read full Ltd Company User and action as required* if(entity.getType()=="Reckoning")*Read full Invoice, Credit Note or Advice Note and action as required* if(entity.getType()=="ContractDocument")*Read full Contract Document and action as required* if(entity.getType()=="PurchaseOrder")*Read full Purchase Order and action as required* if(entity.getType()=="PaymentBatch")*Read full Payment Batch and action as required* if(entity.getType()=="Project")*Read full Project and action as required (WS V2.9+)* } |
|---|
RETRIEVING INVOICE LINKS:
def entityList = getModifiedItemsWithRefCodeByType(java.lang.String token, java.util.Calendar since, java.lang.String "Reckoning") for(entityList:entity){ def entityRefCode = entity.getRefCode() def downloadlink = "https://<SERVER URL>/reckoning/collectInvoice?refCode="+entityRefCode Call(downloadlink) } |
|---|
def entityList = getModifiedItemsWithRefCodeByType(java.lang.String token, java.util.Calendar since, java.lang.String "Reckoning") for(entityList:entity){ def entityRefCode = entity.getRefCode() def downloadlink = "https://<SERVER URL>/reckoning/collectInvoice?refCode="+entityRefCode Call(downloadlink) } |
|---|
RETRIEVING INVOICES TO EXPORT:
def needRatePayElementCode = false //Not usually needed but if required change to true def entityList = getModifiedItemsWithRefCodeByType(java.lang.String token, java.util.Calendar since, java.lang.String "Reckoning") for(entityList){ def entityRefCode = entity.getRefCode() def invoiceInfo = getInvoiceByRefCode(java.lang.String token, java.lang.String entityRefCode) def invoicingAccount def accountCode def nominalCode //Note - Nominal codes aren't always stored on the invoicing entity it depends on the accounts system and nominal requirements def entityType = invoiceInfo.getEntityType() def entityRefCode = invoiceInfo.getEntityRefCode() if(entityType="Client"){ invoicingAccount = getClientByRefCode(java.lang.String entityRefCode) accountCode = invoicingAccount.getAccountsRef() nominalCode = invoicingAccount.getNominalCode() { if(entityType="Worker"){ invoicingAccount = getWorkerByRefCode(java.lang.String entityRefCode) accountCode = invoicingAccount.getAccountsReference() nominalCode = invoicingAccount.getNominalCode() } if(entityType="Provider"){ invoicingAccount = getProviderByRefCode(java.lang.String entityRefCode) accountCode = invoicingAccount.getAccountsRef() nominalCode = invoicingAccount.getNominalCode() } //Get any other details from invocing entities requied above to create / update sales or purchase account in accounts package. if(!(invoiceInfo.getExported)){ for(invoiceInfo.getInvoiceLineInfo():InvoiceLineInfo invoiceLineInfo){ def invoiceLineInfoPlacementId = invoiceLineInfo.getPlacementId def invoiceLineInfoTimesheetId = invoiceLineInfo.getTimesheetId def invoiceLineInfoShiftId = invoiceLineInfo.getShiftId def invoiceLineInfoExpenseItemId = invoiceLineInfo.getExpenseId def invoiceLineInfoAdjustmentId = invoiceLineInfo.getAdjustmentId def placement = getPlacementById(java.lang.String token, java.lang.Long invoiceLineInfoPlacementId) def timesheet = getTimesheetById(java.lang.String token, java.lang.Long invoiceLineInfoTimesheetId) def expenseItem = getExpenseItemById(java.lang.String token, java.lang.Long invoiceLineInfoExpenseItemId) def adjustment = getAdjustmentById(java.lang.String token, java.lang.Long invoiceLineInfoAdjustmentId)
if(needRatePayElementCode){ def invoiceLineInfoShiftId = invoiceLineInfo.getShiftId def shifts = timesheet.getShifts() def wantedShift for(shifts s where s.id=invoiceLineInfoShiftId) wantedShift = s if(wantedShift){ def rate = wantedShift.getRate() def payElementCode = rate.getPayElementCode() } } //Collect details from InvoiceInfo, InvoiceLineInfo, Placement, Timesheet, ExpenseItem, Adjustment, Shift, Rate, Pay Element as required for transaction in Accounts System } def exportSuccessful = false; #Attempt to export details to Accounts System and if successfull exportSuccessful=true if(exportSuccessful)markInvoiceAsExported(java.lang.String token, java.lang.String invoiceInfo.getRefCode(), java.lang.String now()) } } |
|---|
def needRatePayElementCode = false //Not usually needed but if required change to true def entityList = getModifiedItemsWithRefCodeByType(java.lang.String token, java.util.Calendar since, java.lang.String "Reckoning") for(entityList){ def entityRefCode = entity.getRefCode() def invoiceInfo = getInvoiceByRefCode(java.lang.String token, java.lang.String entityRefCode) def invoicingAccount def accountCode def nominalCode //Note - Nominal codes aren't always stored on the invoicing entity it depends on the accounts system and nominal requirements def entityType = invoiceInfo.getEntityType() def entityRefCode = invoiceInfo.getEntityRefCode() if(entityType="Client"){ invoicingAccount = getClientByRefCode(java.lang.String entityRefCode) accountCode = invoicingAccount.getAccountsRef() nominalCode = invoicingAccount.getNominalCode() { if(entityType="Worker"){ invoicingAccount = getWorkerByRefCode(java.lang.String entityRefCode) accountCode = invoicingAccount.getAccountsReference() nominalCode = invoicingAccount.getNominalCode() } if(entityType="Provider"){ invoicingAccount = getProviderByRefCode(java.lang.String entityRefCode) accountCode = invoicingAccount.getAccountsRef() nominalCode = invoicingAccount.getNominalCode() } //Get any other details from invocing entities requied above to create / update sales or purchase account in accounts package. if(!(invoiceInfo.getExported)){ for(invoiceInfo.getInvoiceLineInfo():InvoiceLineInfo invoiceLineInfo){ def invoiceLineInfoPlacementId = invoiceLineInfo.getPlacementId def invoiceLineInfoTimesheetId = invoiceLineInfo.getTimesheetId def invoiceLineInfoShiftId = invoiceLineInfo.getShiftId def invoiceLineInfoExpenseItemId = invoiceLineInfo.getExpenseId def invoiceLineInfoAdjustmentId = invoiceLineInfo.getAdjustmentId def placement = getPlacementById(java.lang.String token, java.lang.Long invoiceLineInfoPlacementId) def timesheet = getTimesheetById(java.lang.String token, java.lang.Long invoiceLineInfoTimesheetId) def expenseItem = getExpenseItemById(java.lang.String token, java.lang.Long invoiceLineInfoExpenseItemId) def adjustment = getAdjustmentById(java.lang.String token, java.lang.Long invoiceLineInfoAdjustmentId)
if(needRatePayElementCode){ def invoiceLineInfoShiftId = invoiceLineInfo.getShiftId def shifts = timesheet.getShifts() def wantedShift for(shifts s where s.id=invoiceLineInfoShiftId) wantedShift = s if(wantedShift){ def rate = wantedShift.getRate() def payElementCode = rate.getPayElementCode() } } //Collect details from InvoiceInfo, InvoiceLineInfo, Placement, Timesheet, ExpenseItem, Adjustment, Shift, Rate, Pay Element as required for transaction in Accounts System } def exportSuccessful = false; #Attempt to export details to Accounts System and if successfull exportSuccessful=true if(exportSuccessful)markInvoiceAsExported(java.lang.String token, java.lang.String invoiceInfo.getRefCode(), java.lang.String now()) } } |
|---|
|
RETRIEVING TIMESHEETS:
def entityList = getModifiedItemsWithRefCodeByType(java.lang.String token, java.util.Calendar since, java.lang.String "Timesheet") for(entity:entityList){ def entityRefCode = entity.getRefCode() def timesheet = getTimesheetByRefCode(java.lang.String token, java.lang.String entityRefCode) for(shift:timesheet.getShifts(){ def date = new Date(shift.getDay()) def start = new Date(shift.getStartTime()) def start = new Date(shift.getEndTime()) def start = new Date(shift.getMealBreak()) def hours = new Date(shift.getHours()) def hoursDecimal = shift.getDecimal() def rateName = shift.getRateName() def ratePay = getRate().getPay() def rateCharge = getRate().getCharge() //PUT INFORMATION COLLECTED HERE WHERE YOU WANT TO PUT IT } } |
|---|
def entityList = getModifiedItemsWithRefCodeByType(java.lang.String token, java.util.Calendar since, java.lang.String "Timesheet") for(entity:entityList){ def entityRefCode = entity.getRefCode() def timesheet = getTimesheetByRefCode(java.lang.String token, java.lang.String entityRefCode) for(shift:timesheet.getShifts(){ def date = new Date(shift.getDay()) def start = new Date(shift.getStartTime()) def start = new Date(shift.getEndTime()) def start = new Date(shift.getMealBreak()) def hours = new Date(shift.getHours()) def hoursDecimal = shift.getDecimal() def rateName = shift.getRateName() def ratePay = getRate().getPay() def rateCharge = getRate().getCharge() //PUT INFORMATION COLLECTED HERE WHERE YOU WANT TO PUT IT } } |
|---|
UPDATING FINANCIAL TAG VALUES:
def fiancialTags = ws.getAllFinancialTags def requiredTg for(fiancialTags:TagCategory tg){ if(tg.name == "financialName")requiredTg = tg } def tagValues = requiredTg.getTagCategoryValues() def requiredValue = "tagValue" def matched = false for(tagValues:TagCategoryValue tcv){ if(tcv==requiredValue)matched=true } if(!matched){ def tv = new TagCategoryValue() tv.setValue(requiredValue) tagValues.add(tv) requiredTg.setTagCategoryValues(tagValues) ws.createOrUpdateFinancialTag(requiredTg) } |
|---|
def fiancialTags = ws.getAllFinancialTags def requiredTg for(fiancialTags:TagCategory tg){ if(tg.name == "financialName")requiredTg = tg } def tagValues = requiredTg.getTagCategoryValues() def requiredValue = "tagValue" def matched = false for(tagValues:TagCategoryValue tcv){ if(tcv==requiredValue)matched=true } if(!matched){ def tv = new TagCategoryValue() tv.setValue(requiredValue) tagValues.add(tv) requiredTg.setTagCategoryValues(tagValues) ws.createOrUpdateFinancialTag(requiredTg) } |
|---|
UPDATING ONCOSTS ON A PLACEMENT (example below is purchase oncosts but same for sales):
def plc = getPlacementByExternalId(token,xxxxx) – xxxx being unique placement Ref def onCostConfig = new OnCost() onCostConfig.description = “xxxx” //Must match existing OnCosts Config def placementOnCost = new OnCostsInstance() placementOnCost.onCost = onCostConfig placementOnCost.amount = xxxx //As required def exists = false for(def currentOnCostInstance:placement.purchaseOnCosts){ if(currentOnCostInstance.onCost.description == “xxxx”)exists=true //Match description above} if(!exists) plc.purchaseOnCosts.add(placementOnCost) createOrUpdatePlacement(plc) |
|---|
def plc = getPlacementByExternalId(token,xxxxx) – xxxx being unique placement Ref def onCostConfig = new OnCost() onCostConfig.description = “xxxx” //Must match existing OnCosts Config def placementOnCost = new OnCostsInstance() placementOnCost.onCost = onCostConfig placementOnCost.amount = xxxx //As required def exists = false for(def currentOnCostInstance:placement.purchaseOnCosts){ if(currentOnCostInstance.onCost.description == “xxxx”)exists=true //Match description above} if(!exists) plc.purchaseOnCosts.add(placementOnCost) createOrUpdatePlacement(plc) |
|---|
Java Code
Authenticate
try { //Create an instance of the stub IntimeServiceV3_2Stub stub = new IntimeServiceV3_2Stub("https://demo.in-time.co.uk/services/IntimeServiceV3_2?wsdl"); //Get an authentication token IntimeServiceV3_2Stub.Authenticate auth=new IntimeServiceV3_2Stub.Authenticate(); auth.setAgencyRefCode("<supplied_credentials>"); auth.setUsername("<supplied_credentials>"); auth.setPassword("<supplied_credentials>"); IntimeServiceV3_2Stub.AuthenticateResponse authResp=stub.authenticate(auth); String ticket=authResp.get_return(); System.out.println("Authentication token:" + ticket); //Use this authentication token (ticket) to pass in to any of the other WebService calls } catch (java.lang.Exception e) { System.out.println("Exception occurred: " + e); } |
|---|
try { //Create an instance of the stub IntimeServiceV3_2Stub stub = new IntimeServiceV3_2Stub("https://demo.in-time.co.uk/services/IntimeServiceV3_2?wsdl"); //Get an authentication token IntimeServiceV3_2Stub.Authenticate auth=new IntimeServiceV3_2Stub.Authenticate(); auth.setAgencyRefCode("<supplied_credentials>"); auth.setUsername("<supplied_credentials>"); auth.setPassword("<supplied_credentials>"); IntimeServiceV3_2Stub.AuthenticateResponse authResp=stub.authenticate(auth); String ticket=authResp.get_return(); System.out.println("Authentication token:" + ticket); //Use this authentication token (ticket) to pass in to any of the other WebService calls } catch (java.lang.Exception e) { System.out.println("Exception occurred: " + e); } |
|---|
Read a Placement
try { IntimeServiceV3_2Stub.GetPlacementByExternalId request=new IntimeServiceV3_2Stub.GetPlacementByExternalId(); request.setId("WEB-PLC-001"); request.setToken(ticket); //from authenticate call GetPlacementByExternalIdResponse placementResponse=stub.getPlacementByExternalId(request); Placement placement=placementResponse.get_return(); if (placement != null) { System.out.println("Read Placement with External Id: " + placement.getExternalId() + " Internal Id: " + placement.getId()); System.out.println("RefCode: " + placement.getRefCode()); System.out.println("Worker:" + placement.getWorker().getExternalId() + " " + placement.getWorker().getLastname()); System.out.println("Consultant: " + placement.getConsultant().getExternalId() + " " + placement.getConsultant().getLastname()); System.out.println("Manager: " + placement.getManager().getExternalId() + " " + placement.getManager().getLastname()); System.out.println("Client: " + placement.getClient().getExternalId() + " " + placement.getClient().getName()); System.out.println("Start: " + placement.getStart().getTime()); if (placement.getEnd() != null) { System.out.println("End: " + placement.getEnd().getTime()); } System.out.println("Created: " + placement.getCreated().getTime()); System.out.println("Modified: " + placement.getModified().getTime()); System.out.println("TimesheetDateCalculatorName: " + placement.getTimesheetDateCalculatorName()); System.out.println("Timesheeet Approval Route: " + placement.getTimesheetApprovalRoute()); System.out.println("Chargeable Expense Approval Route: " + placement.getChargeableExpenseApprovalRoute()); System.out.println("Non-Chargeable Expense Approval Route: " + placement.getNonChargeableExpenseApprovalRoute()); System.out.println("ContractedHours: " + placement.getContractedHours()); System.out.println("JobDescription :" + placement.getJobDescription()); System.out.println("JobTitle: " + placement.getJobTitle()); System.out.println("NoCommunications: " + placement.getNoCommunications()); System.out.println("PurchaseOrderNum: " + placement.getPurchaseOrderNum()); System.out.println("SalesProject: " + placement.getSalesProject()); System.out.println("PurchaseBranch: " + placement.getPurchaseBranch()); System.out.println("CurrencyForCharge: " + placement.getCurrencyForCharge()); System.out.println("CurrencyForPayExpenses: " + placement.getCurrencyForPayExpenses()); System.out.println("CurrencyForPayTimesheets: " + placement.getCurrencyForPayTimesheets()); System.out.println("Perm: " + placement.getPerm()); System.out.println("TimesheetEmailApproval: " + placement.getTimesheetEmailApproval()); System.out.println("Timesheet layout: " + placement.getLayout()); System.out.println("Internal Agency Comments: " + placement.getInternalAgencyComments()); System.out.println("Holiday Accural Rate: " + placement.getHolidayAccuralRate()); System.out.println("Expenses Template: " + placement.getExpenseTemplate()); System.out.println("Charge Tax Code Override: " + placement.getChargeTaxCodeOverride()); System.out.println("Self Bill Tax Code Override: " + placement.getSelfBillTaxCodeOverride()); System.out.println("PAYEDeductionsOnLtd: " + placement.getPAYEDeductionsOnLtd()); if (placement.getInvoiceContactOverride() != null) { Contact contact = placement.getInvoiceContactOverride(); Address address = contact.getAddress(); System.out.println("Placement charge invoice contact override: "); System.out.println(" Firstname: " + contact.getFirstname()); System.out.println(" Lastname: " + contact.getLastname()); System.out.println(" Email: " + contact.getEmail()); System.out.println(" Phone: " + contact.getPhone()); System.out.println(" Fax: " + contact.getFax()); System.out.println(" Mobile: " + contact.getMobile()); System.out.println("Address:"); System.out.println(" Line 1:" + address.getLine1()); System.out.println(" Line 2:" + address.getLine2()); System.out.println(" Town:" + address.getTown()); System.out.println(" County:" + address.getCounty()); System.out.println(" Postcode: " + address.getPostcode()); System.out.println(" Country:" + address.getCountry()); System.out.println(" Country Code:" + address.getCountryCode()); } if (placement.getRates() != null) { for (Rate rate : placement.getRates()) { System.out.println("Rate Name:" + rate.getName()); System.out.println("Pay:" + rate.getPay()); System.out.println("Charge:" + rate.getCharge()); System.out.println("Priority:" + rate.getPriorityOrder()); System.out.println("ID:" + rate.getId()); System.out.println("Period:" + rate.getPeriod()); System.out.println("PeriodDuration:" + rate.getPeriodDuration()); System.out.println("SelectableByWorkers:" + rate.getSelectableByWorkers()); System.out.println("TimePattern:" + rate.getTimePattern()); System.out.println("TimesheetFields:" + rate.getTimesheetFields()); System.out.println("PayElementCode:" + rate.getPayElementCode()); System.out.println("Payable:" + rate.getPayable()); System.out.println("Chargeable:" + rate.getChargeable()); |
|---|
try { IntimeServiceV3_2Stub.GetPlacementByExternalId request=new IntimeServiceV3_2Stub.GetPlacementByExternalId(); request.setId("WEB-PLC-001"); request.setToken(ticket); //from authenticate call GetPlacementByExternalIdResponse placementResponse=stub.getPlacementByExternalId(request); Placement placement=placementResponse.get_return(); if (placement != null) { System.out.println("Read Placement with External Id: " + placement.getExternalId() + " Internal Id: " + placement.getId()); System.out.println("RefCode: " + placement.getRefCode()); System.out.println("Worker:" + placement.getWorker().getExternalId() + " " + placement.getWorker().getLastname()); System.out.println("Consultant: " + placement.getConsultant().getExternalId() + " " + placement.getConsultant().getLastname()); System.out.println("Manager: " + placement.getManager().getExternalId() + " " + placement.getManager().getLastname()); System.out.println("Client: " + placement.getClient().getExternalId() + " " + placement.getClient().getName()); System.out.println("Start: " + placement.getStart().getTime()); if (placement.getEnd() != null) { System.out.println("End: " + placement.getEnd().getTime()); } System.out.println("Created: " + placement.getCreated().getTime()); System.out.println("Modified: " + placement.getModified().getTime()); System.out.println("TimesheetDateCalculatorName: " + placement.getTimesheetDateCalculatorName()); System.out.println("Timesheeet Approval Route: " + placement.getTimesheetApprovalRoute()); System.out.println("Chargeable Expense Approval Route: " + placement.getChargeableExpenseApprovalRoute()); System.out.println("Non-Chargeable Expense Approval Route: " + placement.getNonChargeableExpenseApprovalRoute()); System.out.println("ContractedHours: " + placement.getContractedHours()); System.out.println("JobDescription :" + placement.getJobDescription()); System.out.println("JobTitle: " + placement.getJobTitle()); System.out.println("NoCommunications: " + placement.getNoCommunications()); System.out.println("PurchaseOrderNum: " + placement.getPurchaseOrderNum()); System.out.println("SalesProject: " + placement.getSalesProject()); System.out.println("PurchaseBranch: " + placement.getPurchaseBranch()); System.out.println("CurrencyForCharge: " + placement.getCurrencyForCharge()); System.out.println("CurrencyForPayExpenses: " + placement.getCurrencyForPayExpenses()); System.out.println("CurrencyForPayTimesheets: " + placement.getCurrencyForPayTimesheets()); System.out.println("Perm: " + placement.getPerm()); System.out.println("TimesheetEmailApproval: " + placement.getTimesheetEmailApproval()); System.out.println("Timesheet layout: " + placement.getLayout()); System.out.println("Internal Agency Comments: " + placement.getInternalAgencyComments()); System.out.println("Holiday Accural Rate: " + placement.getHolidayAccuralRate()); System.out.println("Expenses Template: " + placement.getExpenseTemplate()); System.out.println("Charge Tax Code Override: " + placement.getChargeTaxCodeOverride()); System.out.println("Self Bill Tax Code Override: " + placement.getSelfBillTaxCodeOverride()); System.out.println("PAYEDeductionsOnLtd: " + placement.getPAYEDeductionsOnLtd()); if (placement.getInvoiceContactOverride() != null) { Contact contact = placement.getInvoiceContactOverride(); Address address = contact.getAddress(); System.out.println("Placement charge invoice contact override: "); System.out.println(" Firstname: " + contact.getFirstname()); System.out.println(" Lastname: " + contact.getLastname()); System.out.println(" Email: " + contact.getEmail()); System.out.println(" Phone: " + contact.getPhone()); System.out.println(" Fax: " + contact.getFax()); System.out.println(" Mobile: " + contact.getMobile()); System.out.println("Address:"); System.out.println(" Line 1:" + address.getLine1()); System.out.println(" Line 2:" + address.getLine2()); System.out.println(" Town:" + address.getTown()); System.out.println(" County:" + address.getCounty()); System.out.println(" Postcode: " + address.getPostcode()); System.out.println(" Country:" + address.getCountry()); System.out.println(" Country Code:" + address.getCountryCode()); } if (placement.getRates() != null) { for (Rate rate : placement.getRates()) { System.out.println("Rate Name:" + rate.getName()); System.out.println("Pay:" + rate.getPay()); System.out.println("Charge:" + rate.getCharge()); System.out.println("Priority:" + rate.getPriorityOrder()); System.out.println("ID:" + rate.getId()); System.out.println("Period:" + rate.getPeriod()); System.out.println("PeriodDuration:" + rate.getPeriodDuration()); System.out.println("SelectableByWorkers:" + rate.getSelectableByWorkers()); System.out.println("TimePattern:" + rate.getTimePattern()); System.out.println("TimesheetFields:" + rate.getTimesheetFields()); System.out.println("PayElementCode:" + rate.getPayElementCode()); System.out.println("Payable:" + rate.getPayable()); System.out.println("Chargeable:" + rate.getChargeable()); |
|---|