ContactService


Click here for a complete list of operations.

UpdateContacts

Update contacts using array of ContactEditableData. Contacts for update are detected by id field of ContactEditableData.
If you do not specify this field, update will fail with code NoIdInContactData according to input parameter returnBadFormatedData (see below).

Params:
  • contactData - array of ContactEditableData. Field id in every record is required.
    Array should not be empty or null (this case will result in EmptyContactData fail)
  • returnBadFormatedData - specify how to process wrong formated user input. if false - one wrong record in input array will result in Soap client fail (no tasks will be updated).
    If true - wrong input reports will be collected and returned as result of method call. Correct data will result in task updated. Updated tasks will be also returned (See Result below).
Result is BatchContactOperationResult with fields:
  • contacts - array of ContactOperationResult with updated contact and new contact status. See UpdatedContact for ContactOperationResult description.
  • badContactEditableData - array of BadContactEditableData.
    BadContactEditableData:
    • index - index of contact data in input array. If it is null then contactId will specify contact id
    • contactId - contact id for which modification attempt was made. If it is null then index field will specify the index of wrong data in input array.
    • data - wrong contact data
    • code - error code, same as in Soap client faults messages (see CreateContact method)
    • message - fault code description
Soap client faults:
  • NoIdInContactData - id was not specified in contact data
  • EmptyContactData - input array of data is empty
  • SimilarExists - similar contact is allready exists. Contact similarity is detected by contact type, contact address, contact gateway and contact alert sending delay
  • WrongAlertDelay - wrong alert delay
  • WrongActivePeriodInterval - wrong contact activity period
  • WrongActiveDay - wrong contact activity days
  • WrongEmailFormat - specified report format is incorrect. See reportFormat field available values in EmailContact or EmailContactEditableData
  • WrongSmsGateway - wrong sms gateway specified. See GetSmsGateways for available gateways.
  • WrongIMGateway - wrong instant messaging gateway specified. See GetIMGateways for available gateways.
  • WrongContactType - wrong contact type specified. See GetContactTypes for available gateways.
  • Subscription error codes - see subscription service AddSubscriptions

Test

The test form is only available for requests from the local machine.

SOAP 1.1

The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.

POST /api/soap/v1/contact.asmx HTTP/1.1
Host: www.host-tracker.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://www.host-tracker.com/Services/UpdateContacts"

<?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:Header>
    <AuthHeader xmlns="http://www.host-tracker.com/Services">
      <login>string</login>
      <password>string</password>
      <ticket>string</ticket>
    </AuthHeader>
  </soap:Header>
  <soap:Body>
    <UpdateContacts xmlns="http://www.host-tracker.com/Services">
      <contactData>
        <ContactEditableData>
          <id>guid</id>
          <name>string</name>
          <address>string</address>
          <alertDelay>int</alertDelay>
          <activePeriodStart>string</activePeriodStart>
          <activePeriodEnd>string</activePeriodEnd>
          <activeDays>
            <string>string</string>
            <string>string</string>
          </activeDays>
          <subscriptions>
            <Subscription xsi:nil="true" />
            <Subscription xsi:nil="true" />
          </subscriptions>
        </ContactEditableData>
        <ContactEditableData>
          <id>guid</id>
          <name>string</name>
          <address>string</address>
          <alertDelay>int</alertDelay>
          <activePeriodStart>string</activePeriodStart>
          <activePeriodEnd>string</activePeriodEnd>
          <activeDays>
            <string>string</string>
            <string>string</string>
          </activeDays>
          <subscriptions>
            <Subscription xsi:nil="true" />
            <Subscription xsi:nil="true" />
          </subscriptions>
        </ContactEditableData>
      </contactData>
      <returnBadFormatedData>boolean</returnBadFormatedData>
    </UpdateContacts>
  </soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?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>
    <UpdateContactsResponse xmlns="http://www.host-tracker.com/Services">
      <UpdateContactsResult>
        <contacts>
          <ContactOperationResult>
            <contact xsi:nil="true" />
            <status>string</status>
          </ContactOperationResult>
          <ContactOperationResult>
            <contact xsi:nil="true" />
            <status>string</status>
          </ContactOperationResult>
        </contacts>
        <badContactEditableData>
          <BadContactEditableData>
            <index>int</index>
            <contactId>guid</contactId>
            <code>string</code>
            <message>string</message>
          </BadContactEditableData>
          <BadContactEditableData>
            <index>int</index>
            <contactId>guid</contactId>
            <code>string</code>
            <message>string</message>
          </BadContactEditableData>
        </badContactEditableData>
      </UpdateContactsResult>
    </UpdateContactsResponse>
  </soap:Body>
</soap:Envelope>