POST v1/accounts/{foreignaccountkey}/networks/{foreignkey}/datacontrol/domainfiltering/policies

Create a new Domain Filtering Policy on this network.<br/> The Domain Filtering Policy has the following properties:-<br/> 1) Name. The unique name for this policy. Domain Filtering Policies are references by this name.<br/> 2) DefaultAction. THe is either allow or deny. This is the action thats applied if none of the filters match<br/> 3) WhitlList. This is the 1st filter. A list of domains that are allowed. The domain can be specified by exact match, suffix or regualr expression<br/> 4) Blacklist. This is the 2st filter. A list of domains that are disallowed. The domain can be specified by exact match, suffix or regualr expression<br/> 5) CategoryRules. This is the 3rd filter. A list of Category rule, eaction containied an allow/deny action and a list of doamin categories to look for<br/>

Request Information

URI Parameters

NameDescriptionTypeAdditional information
foreignaccountkey

The Api Account to query

string

Required

foreignkey

The network on the account to query

string

Required

Body Parameters

The details of the new Domain Filtering Policy

DataControlDnfPolicy
NameDescriptionTypeAdditional information
Name

The unique name for the DNF policy

string

None.

DefaultAction

The default action to be applied. This can be one of:-<br/> Unknown = 0, Deny = 1, Permit = 2

DNFActionType

None.

WhiteList

Collection of DataControlDnfNameMatch

None.

Blacklist

Gets and sets a blacklist of allowed DNF name match rules. Any traffic matching these rules will be blocked

Collection of DataControlDnfNameMatch

None.

CategoryRules

Gets and sets a list of rules based on DNS categorization.

Collection of DataControlDnfCategoryRule

None.

Request Formats

application/json, text/json

Sample:
{
  "Name": "sample string 1",
  "DefaultAction": 0,
  "WhiteList": [
    {
      "Pattern": "sample string 1",
      "MatchCondition": 0
    },
    {
      "Pattern": "sample string 1",
      "MatchCondition": 0
    }
  ],
  "Blacklist": [
    {
      "Pattern": "sample string 1",
      "MatchCondition": 0
    },
    {
      "Pattern": "sample string 1",
      "MatchCondition": 0
    }
  ],
  "CategoryRules": [
    {
      "Name": "sample string 1",
      "Action": 0,
      "CategoryNumbers": [
        1,
        2
      ]
    },
    {
      "Name": "sample string 1",
      "Action": 0,
      "CategoryNumbers": [
        1,
        2
      ]
    }
  ]
}

application/xml, text/xml

Sample:
<DataControlDnfPolicy xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AS.Models.API">
  <PbnbId>2</PbnbId>
  <Blacklist>
    <DataControlDnfNameMatch>
      <MatchCondition>EqualTo</MatchCondition>
      <Pattern>sample string 1</Pattern>
    </DataControlDnfNameMatch>
    <DataControlDnfNameMatch>
      <MatchCondition>EqualTo</MatchCondition>
      <Pattern>sample string 1</Pattern>
    </DataControlDnfNameMatch>
  </Blacklist>
  <CategoryRules>
    <DataControlDnfCategoryRule>
      <PbnbId>2</PbnbId>
      <Action>Unknown</Action>
      <CategoryNumbers xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:int>1</d4p1:int>
        <d4p1:int>2</d4p1:int>
      </CategoryNumbers>
      <Name>sample string 1</Name>
    </DataControlDnfCategoryRule>
    <DataControlDnfCategoryRule>
      <PbnbId>2</PbnbId>
      <Action>Unknown</Action>
      <CategoryNumbers xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:int>1</d4p1:int>
        <d4p1:int>2</d4p1:int>
      </CategoryNumbers>
      <Name>sample string 1</Name>
    </DataControlDnfCategoryRule>
  </CategoryRules>
  <DefaultAction>Unknown</DefaultAction>
  <Name>sample string 1</Name>
  <WhiteList>
    <DataControlDnfNameMatch>
      <MatchCondition>EqualTo</MatchCondition>
      <Pattern>sample string 1</Pattern>
    </DataControlDnfNameMatch>
    <DataControlDnfNameMatch>
      <MatchCondition>EqualTo</MatchCondition>
      <Pattern>sample string 1</Pattern>
    </DataControlDnfNameMatch>
  </WhiteList>
</DataControlDnfPolicy>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'DataControlDnfPolicy'.

Response Information

Resource Description

The newly created Domain Filtering Policy

PBPRReturnOfDataControlDnfPolicy
NameDescriptionTypeAdditional information
Data

DataControlDnfPolicy

None.

Success

Gets the success status of the API call

boolean

None.

Meta

Gets the optional meta-data

Dictionary of string [key] and string [value]

None.

Code

Get the http code of the API call e.g. 200, 202, 409

integer

None.

ErrorCode

Get the failure error code of the API call. This is available if Success is false

integer

None.

ErrorSubCode

Gets the error sub code if available

integer

None.

ErrorDescription

Gets a textual description of the error

string

None.

StatusUrl

Gets the status url for any ACCEPTed API commands. Any command (POST,DELETE,PATCh,PUT) to the API usually returns a 202 response code. The status of the command can be queried using the URL provided

string

None.

ContinuationToken

Gets the token to be used for paged queries

string

None.

Response Formats

application/json, text/json

Sample:
{
  "Success": true,
  "Meta": {
    "sample string 1": "sample string 2",
    "sample string 3": "sample string 4"
  },
  "Code": 2,
  "ErrorCode": 3,
  "Data": {
    "Name": "sample string 1",
    "DefaultAction": 0,
    "WhiteList": [
      {
        "Pattern": "sample string 1",
        "MatchCondition": 0
      },
      {
        "Pattern": "sample string 1",
        "MatchCondition": 0
      }
    ],
    "Blacklist": [
      {
        "Pattern": "sample string 1",
        "MatchCondition": 0
      },
      {
        "Pattern": "sample string 1",
        "MatchCondition": 0
      }
    ],
    "CategoryRules": [
      {
        "Name": "sample string 1",
        "Action": 0,
        "CategoryNumbers": [
          1,
          2
        ]
      },
      {
        "Name": "sample string 1",
        "Action": 0,
        "CategoryNumbers": [
          1,
          2
        ]
      }
    ]
  },
  "ErrorSubCode": 4,
  "ErrorDescription": "sample string 5",
  "StatusUrl": "sample string 6",
  "ContinuationToken": "BxFAXRUEKVV%2BTRMbGlBGdA%3D%3D"
}

application/xml, text/xml

Sample:
<PBPRReturnOfDataControlDnfPolicy7NMnQmOk xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AS.Models.API">
  <Code>2</Code>
  <ContinuationToken>BxFAXRUEKVV%2BTRMbGlBGdA%3D%3D</ContinuationToken>
  <ErrorCode>3</ErrorCode>
  <ErrorDescription>sample string 5</ErrorDescription>
  <ErrorSubCode>4</ErrorSubCode>
  <Meta xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringstring>
      <d2p1:Key>sample string 1</d2p1:Key>
      <d2p1:Value>sample string 2</d2p1:Value>
    </d2p1:KeyValueOfstringstring>
    <d2p1:KeyValueOfstringstring>
      <d2p1:Key>sample string 3</d2p1:Key>
      <d2p1:Value>sample string 4</d2p1:Value>
    </d2p1:KeyValueOfstringstring>
  </Meta>
  <StatusUrl>sample string 6</StatusUrl>
  <Success>true</Success>
  <Data>
    <PbnbId>2</PbnbId>
    <Blacklist>
      <DataControlDnfNameMatch>
        <MatchCondition>EqualTo</MatchCondition>
        <Pattern>sample string 1</Pattern>
      </DataControlDnfNameMatch>
      <DataControlDnfNameMatch>
        <MatchCondition>EqualTo</MatchCondition>
        <Pattern>sample string 1</Pattern>
      </DataControlDnfNameMatch>
    </Blacklist>
    <CategoryRules>
      <DataControlDnfCategoryRule>
        <PbnbId>2</PbnbId>
        <Action>Unknown</Action>
        <CategoryNumbers xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:int>1</d5p1:int>
          <d5p1:int>2</d5p1:int>
        </CategoryNumbers>
        <Name>sample string 1</Name>
      </DataControlDnfCategoryRule>
      <DataControlDnfCategoryRule>
        <PbnbId>2</PbnbId>
        <Action>Unknown</Action>
        <CategoryNumbers xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:int>1</d5p1:int>
          <d5p1:int>2</d5p1:int>
        </CategoryNumbers>
        <Name>sample string 1</Name>
      </DataControlDnfCategoryRule>
    </CategoryRules>
    <DefaultAction>Unknown</DefaultAction>
    <Name>sample string 1</Name>
    <WhiteList>
      <DataControlDnfNameMatch>
        <MatchCondition>EqualTo</MatchCondition>
        <Pattern>sample string 1</Pattern>
      </DataControlDnfNameMatch>
      <DataControlDnfNameMatch>
        <MatchCondition>EqualTo</MatchCondition>
        <Pattern>sample string 1</Pattern>
      </DataControlDnfNameMatch>
    </WhiteList>
  </Data>
</PBPRReturnOfDataControlDnfPolicy7NMnQmOk>