List of tags used in API |
---|
Description: It is used for sending XML Request. To apply any configuration this tag is necessary. API Version also needs to be specified for configurations to be applied successfully.
Usage:
Attribute - APIVersion
Attribute Value - Version of API used. For example: "1900.2"
Example:
<Request APIVersion="1900.2">
<Login>
<Username>admin</Username>
<Password >adminpassword</Password>
</Login>
</Request>
Description: It is used for Authentication.
Usage:
Attribute - N/A
Attribute Value - N/A
Example:
Please refer the above example.
Description: Specify the username in this tag.
Usage:
Attribute - N/A
Attribute Value - N/A
Example:
Please refer the above example.
Description: Specify the password in this tag.
Usage:
Attribute - N/A
Attribute Value - N/A
Example:
Please refer the above example.
Description: It is used to inform that the request is to be served as Add/Update depending on the Attribute value.
Note: If, no "operation" attribute/value is defined in the tag, then Add operation will be performed followed by Update
Usage:
Additional inputs to set sensitive information:
i) Parameter: SecureStorageMasterKey
Attribute - operation
Attribute Value - Add/Update
Example:
<Request>
<Login>
<Username>admin</Username>
<Password>adminpassword</Password>
</Login>
<Set operation="add">
<IPHost>
<Name>CustomIPHostTypeIPV4</Name>
<IPFamily>IPv4</IPFamily>
<HostType>IP</HostType>
<IPAddress>1.1.1.1</IPAddress>
</IPHost>
</Set>
</Request>
Description:Enter the secure storage master key. It's the master key for the firewall from which you've exported the configuration. If you don't enter the master key, your firewall won't import sensitive information, such as passwords, and the dependent settings.
If you don't have the master key, ask the default administrator (username: admin).
Example:
https://1.1.1.1:4444/webconsole/APIController?SecureStorageMasterKey=Passw0rd@12345&reqxml=<Request> ....</Request>
ii) Attribute: Token
Description:Enter the token. You receive it in the GET request. The firewall imports and decrypts sensitive information using the secure storage master key and the token.
Example:
<Request Token="$sfos$0$N=4000CAnkyXQo7T7e6LnNgrcZJFx0Vg7Z7tyrglkqo1KosvB6VRTmHqDyA05yTlkVkmWTbzABokmciI048Tnv4y9j3OiEEWi1E_HklZI5A2qq5v8JL1AlZfykgnnjylc6FT5feV">
<Login> <Username>admin</Username> <Password>admin</Password> </Login> <Set operation="update"> <BackupRestore> <ScheduleBackup> <BackupMode>Local</BackupMode> <BackupPrefix>back_up_test</BackupPrefix> <BackupFrequency>Never</BackupFrequency> . . <EncryptionPassword hashform="mode1">$sfos$7$0$7B68U8kfUxfQtMZ eCl7TO5YFSGes0UDTgRqWg5EXCwMpTXaVcRqqjIe5F4yH~</EncryptionPassword> </ScheduleBackup> </BackupRestore> </Set> </Request> Description: It is used to inform that the request needs to be served for retrieving data of the entity specified.
Usage:
Attribute - N/A
Attribute Value - N/A
Example:
<Request>
<Login>
<Username>admin</Username>
<Password>adminpassword</Password>
</Login>
<Get>
<IPHost></IPHost>
</Get>
</Request>
Description: It is used for retrieving entity data based on the criteria specified in the <Key> tag. It is only applicable for entity "Name"
Usage:
Attribute - N/A
Attribute Value - N/A
Example:
<Request>
<Login>
<Username>admin</Username>
<Password>adminpassword</Password>
</Login>
<Get>
<IPHost>
<Filter>
<key name="Name" criteria="like">CustomIPHostTypeIPV4</key>
</Filter>
</IPHost>
</Get>
</Request>
Description: It is used within the <Filter> tag to specify the filter key and Filter criteria.
Usage:
Attribute - name, criteria
Attribute Value - name = "Name", criteria = ["=","!=","like"]
Example:
Please refer the above example.
Description: It is used to delete data.
Usage:
Attribute - N/A
Attribute Value - N/A
Example:
<Request>
<Login>
<Username>admin</Username>
<Password>adminpassword</Password>
</Login>
<Remove>
<IPHost>
<Name>CustomIPHostTypeIPV4</Name>
</IPHost>
</Remove>
</Request>
Description: Response of any request will be displayed in this tag.
Usage:
Attribute - APIVersion
Attribute Value - Same value as specified in the XML Request or if it is not specified then active firmware API Version will be considered.
Example:
<Response APIVersion="1900.2">
<Login>
<status>Authetication Successful</status>
</Login>
<IPHost transactionid="">
<Status code="502">Message.IPHostRecordExists</Status>
</IPHost>
</Response>
Description: It is a part of the <Response> tag and it indicates the configuration status based on the code.
Usage:
Attribute - code
Attribute Value - code value.
Example:
<Response APIVersion="1900.2">
<Login>
<status>Authetication Successful</status>
</Login>
<IPHost transactionid="">
<Status code="502">Operation failed. Entity having same name already exists</Status>
</IPHost>
</Response>
Description: Enter the encrypted password. You receive it in the GET request. Alternatively, enter the unencrypted password.
|
How to use API ? |
---|
Please use the below link to use API:
https://<Firewall IP>:<port>/webconsole/APIController?reqxml=<Add the XML request here>
Note: Port you mention in above URL should be same as the port you have configured as Admin Console HTTPS Port from System > Administration > Settings.
Example:
https://<Firewall IP>:<port>/webconsole/APIController?reqxml=<Request><Login><Username>admin</Username><Password>adminpassword</Password></Login><Set> <IPHost transactionid=""><Name>ip2</Name><IPFamily>IPv4</IPFamily><HostType>IP</HostType><IPAddress>2.2.2.9</IPAddress></IPHost> </Set></Request>
https://<Firewall IP>:<port>/webconsole/APIController?SecureStorageMasterKey=Passw0rd@12345&reqxml=<Request Token="token"><Login><Username>admin</Username><Password>admin</Password></Login><Set> <backuprestore transactionid=""><schedulebackup><backupmode>Local</backupmode><backupprefix>back_up_test</backupprefix><ftppath/><username/><ftpserver/><password/><emailaddress/><backupfrequency>Never</backupfrequency><day/><hour/><minute/><date/><encryptionpassword hashform="mode1">EncryptedPassword</encryptionpassword></schedulebackup></backuprestore></Set></Request>
https://<Firewall IP>:<port>/webconsole/APIController?reqxml=<Request><Login><Username>admin</Username><Password>adminpassword</Password></Login><Get> <IPHost></IPHost> </Get></Request>
|
Status Code and Description | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|