When trying to access functionality of the API you must always do a SessionLogin before being able to perform any other actions, and a SessionLogout when you are finished.
Pseudo code for this would be as follows:
Call SessionLogin (see example)
Call MethodInvoke and to perform application specific operations (see examples)
Call SessionLogout when you are finished (see example)
Saving address, phone, notes and custom fields
Many objects in the database support custom fields, phone numbers, notes and addresses. All of this information can be saved when calling any one of the applicable *Save methods via MethodInvoke. Below is an example of a call to EmployeeSave which contains all 4 types of information:
<Employee:EMPLOYEES xmlns:Employee="http://www.dovico.com/schemas/employee.xsd">
<EMPLOYEE ID="-1" TRAWORKFLOW="0" EXPWORKFLOW="0" TIMATT="0" FIRST="Example First" LAST="Example Last" GROUP="100" SOFTWARE="B" WAGE="101" CHARGE="100" START="2003-02-02T00:00:00" END="2004-02-02T00:00:00" SECURITY="96" USERID="ASDF" PASSWORD="ASDF" NUMBER="" EMAIL="" AUTEMAIL="" DAYS="5" HOURS="7.5" ARCHIVE="F" OUTSIDE="" INTEGRATE="">
<CUSTOMFIELDS LINKID="-1"><CUSTOMFIELD ID="-1" CUSTOMTEMPLATE="100"><VALUES><VALUE>This is alphanumeric text</VALUE></VALUES></CUSTOMFIELD>
<CUSTOMFIELD ID="-1" CUSTOMTEMPLATE="101"><VALUES><VALUE>2003-05-25</VALUE></VALUES></CUSTOMFIELD>
<CUSTOMFIELD ID="-1" CUSTOMTEMPLATE="102"><VALUES><VALUE>1</VALUE></VALUES></CUSTOMFIELD>
</CUSTOMFIELDS>
<NOTES LINKID="-1" LINKTYPE="E"><NOTE ID="-1" NOTE="Note 1" DATE="2003-01-01T00:00:00"/><NOTE ID="-1" NOTE="Note 2" DATE="2003-12-31T00:00:00"/></NOTES>
<PHONES LINKID="-1" LINKTYPE="E"><PHONE ID="-1" NUMBER="506 855-4477" DESC="Main Dovico Line" DISPLAY="T"/><PHONE ID="-1" NUMBER="506 855-4154" DESC="Dovico Support" DISPLAY="F"/></PHONES>
<ADDRESSES LINKID="-1" LINKTYPE="E"><ADDRESS ID="-1" LINE1="236 Example St." LINE2="Suite 119" CITY="Example City" STATE="California" POSTAL="12345" DISPLAY="T" URL="http://www.dovico.com" EMAIL="homer@fun.com"/></ADDRESSES>
</EMPLOYEE></Employee:EMPLOYEES>
Note that the LINKID attributes for custom fields, notes etc. is -1 because this is a new employee, and the LINKID will be auto-adjusted to the new employee ID that was inserted. If you are updating information, you should specify the appropriate ID for the root item you are trying to update. (e.g. if your employee ID you are working with is 205 than all LINKID should be 205. Also note that LINKTYPE attribute that is defined for notes, phone and addresses. This tells the system what "type" of object the note etc. belongs to. These constants can be obtained from the CONSTANTS.LINKTYPE*
Deleting phone numbers, addresses and notes.
In order to delete phone numbers addresses and notes, include a <DELETED> element after your inserted/updated information that contains one or more <ID> tags that specify the IDs of notes, phone numbers etc. that could be deleted. See the below example of xml.
<NOTES LINKID="-1" LINKTYPE="E"><NOTE ID="-1" NOTE="Note 1" DATE="2003-01-01T00:00:00"/><NOTE ID="-1" NOTE="Note 2" DATE="2003-12-31T00:00:00"/><DELETED><ID>100</ID><ID>101</ID></DELETED></NOTES>
This example adds two notes, and deletes two existing notes of IDs 100 and 101.