setWafOrigin — Changing the site origin (routing)

The setWafOrigin method updates the origin IP address if the site’s location has or will change.

The API endpoint is:

https://api.sitelock.com/v1/partner

Request format

  • SiteLockOnlineRequest: This element is used to delineate the full API request.

    • authentication: The partner’s username, password, and branding

      • username: The partner’s API username

      • password: The partner’s API password

      • partner: (Optional) The brand name to use in messaging

    • setWafOrigin: The method name

      • site_id: The id of the site for which the origin is to be updated

      • waf_origin: (Repeatable) A new origin of the site, either an IP address or a CNAME type record. To add multiple origins, the plan must support this capability.

Example request

<SiteLockOnlineRequest>
    <authentication>
        <user>Username</user>
        <password>Password</password>
    </authentication>
    <setWafOrigin>
        <site_id>1234567</site_id>
        <waf_origin>10.10.10.127</waf_origin>
    </setWafOrigin>
</SiteLockOnlineRequest>

Response format

  • SiteLockOnlineRequest: This element is used to delineate the full API request.

    • setWafOrigin: The method name

      • origins: The new origin of the site

      • status: Either ok or error

Example sucess response

<SiteLockOnlineResponse>
    <setWafOrigin>
        <origins>10.10.10.127</origins>
        <status>ok</status>
    </setWafOrigin>
</SiteLockOnlineResponse>

Example error response

<SiteLockOnlineResponse>
    <setWafOrigin>
        <error code="6002">Invalid configuration parameter value</error>
    </setWafOrigin>
</SiteLockOnlineResponse>

This error indicates that the value sent in the waf_origin field wasn’t valid and couldn’t be used. Examples of invalid values are:

  • Incomplete IP addresses: 1.2.3

  • IP addresses not in valid range: 500.600.700.8

  • CNAME type records that don’t exist: foo.example.notadomain

  • Multiple targets for plans that don’t support it: 1.2.3.4,5.6.7.8