SonicOS API Reference Guide

Table of Contents

Supported Request Methods

SonicOS API utilizes four of the methods defined in the HTTP protocol (RFC 7231 and RFC 5789) to create, read, update and delete (CRUD) resources. Supported HTTP request methods describes the supported HTTP methods for management operations after authentication. Refer to Client Authentication for the methods supported during authentication.

Supported HTTP request methods
HTTP method Description
GET Retrieves the specified resource or collection of resources. GET is a read-only operation that does not alter appliance state or configuration. A GET operation should not contain a request-body.
POST Submits data to be processed by the specified resource or collection of resources. In most cases, the POST verb is used by SonicOS APIs to create and add a resource to a collection of resources (for example, add a new MAC address-object to collection of objects).
PUT Updates the specified resource. The data included in the PUT request-body replaces the previous configuration.
PATCH Partially updates the specified resource. The data included in the PATCH request-body updates the previous configuration.
DELETE Deletes the specified resource or collection of resources.
Supported HTTP header request and response formats
Type Example
Text/plain GET /api/sonicos/address-objects/mac Accept: text/plain
Application/JSON POST /api/sonicos/address-objects/mac Content-type: application/json Accept: application/json { "address_object": { "mac": { "name": "001122334455" ,"address": "001122334455" ,"multi_homed": true ,"zone": "LAN" } } }
SonicOS API Commands Description
basic Enable SonicOS API HTTP basic access authentication.
digest Enable SonicOS API HTTP digest access authentication.
integrity-protection SonicOS API digest integrity protection.
md5-digest Enable SonicOS API HTTP digest MD5.
rsa-key-size SonicOS API public key RSA key size.
session-security Enable SonicOS API session security.
bearer-token Enable SonicOS API Bearer Token check.
hateoas Enable SonicOS API HATEOAS.
log Disable SonicOS API log.
oeap-mask-method Set SonicOS API OEAP mask (MGF1) method.
chap Enable SonicOS API CHAP authentication.
max-nonce Configure SonicOS API session security max nonce.
public-key Enable SonicOS API public key authentication.
rsa-padding-type Set SonicOS API public key RSA padding type.
sha256-digest Enable SonicOS API HTTP digest SHA256.
compress-response-during-transmission Enable compression of SonicOS API response during transmission.
max-payload Set SonicOS API maximum payload size.
oeap-hash-mode Set SonicOS API OEAP hash mode.
session-variant Allow SonicOS API to use session variants.
enable Enable SonicOS API.
cors Enable SonicOS API CORS support.

System Commands

Description
cancel Cancel current changes and return to the previous mode.
clear Reset functions.
cli CLI Configuration.
commit Commit configuration changes.
end Exits current mode and returns to global configuration mode.
exit Exit the current mode.
export Export system status or configuration.
help Display command help.
no Negate a command or set its defaults.
show Show system status or configuration.