# PersonService
This services creates contacts in 24SevenOffice. The property Id is the primary ID and cannot be specified when creating a new contact. If you specify an Id, this means that you are updating a contact.
WARNING
Please note: It is not possible to create employees through the PersonService.
PersonService (opens new window)
PersonService WSDL (opens new window)
# Guides
# Retrieve Contact
Retrive persons by using the GetPersons (opens new window) method or if you need more informtion on that contact, use the GetPersonsDetailed (opens new window) method. We recommend using the GetPersons (opens new window) method if you are able to.
<GetPersons xmlns="http://24sevenOffice.com/webservices">
<personSearch>
<ChangedAfter>2019-01-01T00:00:00</ChangedAfter>
</personSearch>
</GetPersons>
# Save a contact
Save a person by using the SavePerson (opens new window) method.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<SavePerson xmlns="http://24sevenOffice.com/webservices">
<personItem>
<Comment>Add your comment here</Comment>
<ConsumerPersonNo>1234567</ConsumerPersonNo>
<Country>NO</Country>
<CustomerId>100</CustomerId>
<DateOfBirth>1995-01-01</DateOfBirth>
<Department>Development</Department>
<EmailAddresses>
<EmailAddress>
<Description>Work</Description>
<Type>Primary</Type>
<Value>Work@Work.com</Value>
</EmailAddress>
</EmailAddresses>
<EmployeeNumber>1234</EmployeeNumber>
<FaxNumber>
<Description>Fax Home</Description>
<Type>Primary</Type>
<Value>fax@fax.no</Value>
</FaxNumber>
<FirstName>Bob</FirstName>
<Gender>Male</Gender>
<LastName>Olsen</LastName>
<Nickname>Bobby</Nickname>
<PersonalStatus>Single</PersonalStatus>
<PhoneNumbers>
<PhoneNumber>
<Description>Work</Description>
<Type>Mobile</Type>
<Value>12345678</Value>
</PhoneNumber>
</PhoneNumbers>
<PostAddress>
<City>Skien</City>
<Country>NO</Country>
<County>Telemark</County>
<Description>Home</Description>
<PostalArea>Telemark</PostalArea>
<PostalCode>1234</PostalCode>
<State>Buskerud</State>
<Street>Teststreet 1</Street>
<Type>Post</Type>
</PostAddress>
<RelationData>
<RelationData>
<CustomerId>1234</CustomerId>
<Email>Olsen@email.no</Email>
<Mobile>12345678</Mobile>
<Phone>87654321</Phone>
<Title>Boss</Title>
</RelationData>
</RelationData>
<Url>homepage url</Url>
<Workplace>Industries AS</Workplace>
<WorkPosition>Boss</WorkPosition>
<IsPrivate>false</IsPrivate>
<HourCost>250</HourCost>
</personItem>
</SavePerson>
</soap:Body>
</soap:Envelope>
# Add relation to a contact
Use the MakeRelation (opens new window) method to add a relation to a contact.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<MakeRelation xmlns="http://24sevenOffice.com/webservices">
<relation>
<ContactId>123456</ContactId>
<CustomerId>100</CustomerId>
<Email>olsen@email.no</Email>
<Mobile>12345678</Mobile>
<Phone>87654321</Phone>
<Title>Relation Olsen</Title>
</relation>
</MakeRelation>
</soap:Body>
</soap:Envelope>
# Retrieve relations from a contact
The method GetRelations (opens new window) is used to retrieve relations or use the GetRelationsChangedAfter (opens new window) method to receive relations created after a specific date.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetRelations xmlns="http://24sevenOffice.com/webservices">
<personId>123456</personId>
</GetRelations>
</soap:Body>
</soap:Envelope>
# Add notes to a contact
To save a note you need to use the AddNote (opens new window) method.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<AddNote xmlns="http://24sevenOffice.com/webservices">
<note>
<Subject>Note 1</Subject>
<Description>Note description</Description>
<PersonId>123456</PersonId>
</note>
</AddNote>
</soap:Body>
</soap:Envelope>
# Retrieve notes from a contact
To retrieve notes you need to use the GetNotes (opens new window) method. And you have to input the personId as a parameter.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetNotes xmlns="http://24sevenOffice.com/webservices">
<personId>123456</personId>
</GetNotes>
</soap:Body>
</soap:Envelope>
# Delete notes
To delete a note you need to use the DeleteNote (opens new window) method. You can also use the DeleteNoteById (opens new window) to delete a note. This method needs only the NoteId.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<DeleteNote xmlns="http://24sevenOffice.com/webservices">
<note>
<Id>1234</Id>
<Subject>Note 1</Subject>
<Description>Delete note</Description>
<EmployeeId>12345678</EmployeeId>
<DateAdded>2010-01-01</DateAdded>
<Date>2020-01-01</Date>
<PersonId>123456</PersonId>
</note>
</DeleteNote>
</soap:Body>
</soap:Envelope>
# Retrieve contact id
To retrieve a contact id or personId use the GetPersonId (opens new window) or the GetPersonIdsByUserName (opens new window) method.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetPersonId xmlns="http://24sevenOffice.com/webservices">
<consumerPersonNo>1234</consumerPersonNo>
</GetPersonId>
</soap:Body>
</soap:Envelope>
# Methods
Method | Input type | Return type | Description |
---|---|---|---|
AddCategoryToPerson (opens new window) | personId(Long), categoryId(Int) | Adds a CRM Category to a person | |
RemoveCategoryFromPerson (opens new window) | personId(Long), categoryId(Int) | Removes a CRM Category from a person | |
GetPersonCategoryList (opens new window) | personId(Long) | int[] | Returns a list of category ids for a specific person |
GetPersonArrayCategoryList (opens new window) | personIds(Int[]) | PersonCategories[] | Returns a list of category ids for an array of persons |
GetCategoryList (opens new window) | - | Category[] | Returns a list of all CRM categories |
AddNote (opens new window) | NoteData | int | Adds a note and returns the Id of the added note |
DeleteNote (opens new window) | NoteData | Deletes a note | |
DeleteNoteById (opens new window) | noteId(Int) | Deletes a note by using the id | |
GetNotes (opens new window) | personId(Long) | NoteData[] | Gets all notes for a specific person |
GetPersonId (opens new window) | consumerPersonNo(String) | long | Gets 24SevenOffice’s Person Id that corresponds to the given Consumer Person Id |
GetPersonIdsByUserName (opens new window) | username(String) | long[] | Gets a list of Person Ids from a username in 24SO’s system |
GetPersons (opens new window) | PersonSearchParameters | PersonItem[] | Gets a list of persons |
GetPersonsDetailed (opens new window) | PersonSearchParameters | PersonItem[] | Gets a list of persons with more detailed information |
SavePerson (opens new window) | PersonItem | long | Saves a person and returns its ID |
GetRelations (opens new window) | - | ||
GetRelationsChangedAfter (opens new window) | datetime | ||
MakeRelation (opens new window) | RelationData | bool | Insert/update relationdata between a company and a contact. |