ContactService


Click here for a complete list of operations.

CreateContacts

Create contacts from array of ContactEditableData (array of derived classes: EmailContactEditableData, SmsContactEditableData, IMContactEditableData, VoiceCallEditableData).

Params:
  • array of ContactEditableData - see CreateContact for details.
  • returnBadFormatedData - if false then wrong data in one contact will result in fail of whole batch.
    If true then contacts with correct data will be created; wrong data and created contacts will be returned as result of method.
Result is BatchContactOperationResult with fields:
  • contacts - created contacts - array of Contact (derived types)
  • badContactEditableData - status of contact creation - array of BadContactEditableData:
    • index - index of contact 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:
  • EmptyContactData - contact data array is empty or was not specified
  • Other Soap faults same to faults in CreateContact method

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/CreateContacts"

<?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>
    <CreateContacts 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>
    </CreateContacts>
  </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>
    <CreateContactsResponse xmlns="http://www.host-tracker.com/Services">
      <CreateContactsResult>
        <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>
      </CreateContactsResult>
    </CreateContactsResponse>
  </soap:Body>
</soap:Envelope>