ContactService


Click here for a complete list of operations.

UpdateContact

Update existing contact. NotFound Soap client fault will be rised if contact will not be found.

Params:
  • contactId - id of contact (GUID), required.
  • contactData - ContactEditableData or it's derived type (see CreateContact method), required.
Result is ContactOperationResult with fields:
  • contact - updated contact information in form of Contact derived type
  • status - new contact status. Contact will need to be confirmed if you change address and/or gateway of it.
    • Confirmed - changed contact remains confirmed
      Updated contact could become confirmed if there are allready exists confirmed contact with same pair (address, gateway).
    • ConfirmedOverlimited - changed contact remains confirmed and overlimited
    • LowSmsBalance - updated contact became unconfirmed but code was not send due to low sms balance
    • CodeSent - updated contact became unconfirmed and new code was sent to specified address
    • CodeFail - updated contact became unconfirmed but code was not send due to server error. Try resend code after some time.
    • CodeSentEarlier - address and gateway of contact was not changed but contact was unconfirmed. Code for it was sent earlier and will not be resend by this method.
Soap client faults:
  • 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/UpdateContact"

<?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>
    <UpdateContact xmlns="http://www.host-tracker.com/Services">
      <contactId>guid</contactId>
      <contactData>
        <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>
            <alertTypes xsi:nil="true" />
            <reportTypes xsi:nil="true" />
            <taskIds xsi:nil="true" />
            <contactIds xsi:nil="true" />
          </Subscription>
          <Subscription>
            <alertTypes xsi:nil="true" />
            <reportTypes xsi:nil="true" />
            <taskIds xsi:nil="true" />
            <contactIds xsi:nil="true" />
          </Subscription>
        </subscriptions>
      </contactData>
    </UpdateContact>
  </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>
    <UpdateContactResponse xmlns="http://www.host-tracker.com/Services">
      <UpdateContactResult>
        <contact>
          <id>guid</id>
          <confirmed>boolean</confirmed>
          <contactType>string</contactType>
          <name>string</name>
          <address>string</address>
          <sendCost>decimal</sendCost>
          <sendCostDirty>boolean</sendCostDirty>
          <alertDelay>int</alertDelay>
          <activePeriodStart>string</activePeriodStart>
          <activePeriodEnd>string</activePeriodEnd>
          <activeDays>
            <string>string</string>
            <string>string</string>
          </activeDays>
          <billingOverlimit>
            <string>string</string>
            <string>string</string>
          </billingOverlimit>
          <subscriptions>
            <Subscription xsi:nil="true" />
            <Subscription xsi:nil="true" />
          </subscriptions>
        </contact>
        <status>string</status>
      </UpdateContactResult>
    </UpdateContactResponse>
  </soap:Body>
</soap:Envelope>