HTTP Methods and Responses
The Stealthwatch APIs use conventional HTTP request methods and response codes to indicate success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that resulted from the provided information, and codes in the 5xx range indicate an error with our servers.
HTTP Requests
Use standard HTTP requests to access the Stealthwatch System REST API. The methods are applied consistently across all resources and should be fairly familiar to any other REST APIs you may have used:
Desired Option | HTTP Method |
---|---|
Read | GET |
Create | POST |
Update | PUT |
Delete | DELETE |
NOTE: Not all resources support all HTTP methods. For example, some resources may only support GET.
HTTP Responses
If the operation succeeded, expect a standard 200 OK response. You should always check the Status-Code field in the HTTP header. If it is anything other than 200, then the operation failed. The error codes are in the following table:
Staus Code | Description |
---|---|
400 Bad Request | General error when fulfilling the request that would cause an invalid state, for example, domain validation errors or missing data. |
403 Forbidden | Authentication credentials were not provided. |
404 Not Found | Used when the requested resource is not found, whether because it does not exist, or for security reasons, the service wants to mask its existence. |
405 Method Not Allowed | A request was made of a resource using a request method not supported by that resource, for example, using GET on a write-only resource or using PUT on a read-only resource. |
500 Internal Server Error | Catch-all error when the server-side has an exception. In the event of a failure, the response body will contain a JSON response that should contain more information about what caused the operation to fail. |
NOTE: The Stealthwatch Cloud REST API returns HTTP responses in JSON format only.