Installing
Gemfile:
incident_io_api, but the library is require "incident_io", and everything lives under the IncidentIo module.
Your first request
You’ll need an API key from Settings > API keys (see API keys). Then:How endpoints work
Each API resource has a class, such asIncidentsV2Api or AlertsV2Api, with one method per endpoint. Path parameters and request bodies are positional arguments, and everything optional goes in a trailing hash:
_with_http_info twin:
Pagination
List endpoints are cursor-paginated. Read the next cursor frompagination_meta.after and pass it back as after:
Filtering
Filters that take an operator are nested hashes:Errors
A failed request raises a subclass ofIncidentIo::ApiError for its status code, so you can rescue the cases you care about and let the rest through:
BadRequestError (400), AuthenticationError (401), PermissionDeniedError (403), NotFoundError (404), ConflictError (409), UnprocessableEntityError (422), RateLimitError (429), and ServerError (5xx). Network failures and timeouts raise ApiError itself, with a code of nil. When you hit the rate limit, RateLimitError#retry_after tells you how many seconds to wait.
Configuration
IncidentIo.configure sets the defaults every API class uses. If you need more than one configuration in a process, build an ApiClient and pass it in:
config.configure_faraday_connection { |conn| ... } gives you the connection, so you can add middleware such as retries or logging.
Enum values
Fields the API documents as an enum are plain strings in this SDK, and the documentation lists the known values. We add enum values as a backwards-compatible change, and plain strings mean a value newer than your installed gem never breaks the response.Deprecated endpoints
Endpoints we’ve deprecated stay available, but they’re marked@deprecated in the documentation and warn when called. Ruby hides deprecation warnings by default, so run with ruby -W:deprecated, or set Warning[:deprecated] = true, to see them.
Versioning
The SDK is kept up to date with the API automatically. Additions to the API are minor versions. A change that would break your code, like a removed field, is released as a new major version, and its release notes list what changed.Resources
RubyGems
The
incident_io_api gem and its versions.GitHub
Source, README, and issues for the Ruby SDK.
API reference
Endpoints, authentication, rate limits, and errors.
All SDKs
Clients for Go, TypeScript, Python, Rust, PHP, and .NET.