curl, json, and mbstring extensions.
Installing
Your first request
You’ll need an API key from Settings > API keys (see API keys). Then:How endpoints work
There’s one class per API group underIncidentIo\Api, named for the group and its version (IncidentsV2Api, SeveritiesV1Api, CatalogV3Api), and one model class per request and response under IncidentIo\Model. Each endpoint has four methods:
incidentsV2List(...)returns the response model.incidentsV2ListWithHttpInfo(...)returns[$model, $statusCode, $headers].incidentsV2ListAsync(...)andincidentsV2ListAsyncWithHttpInfo(...)return Guzzle promises for the same.
Pagination
List endpoints return a page and a cursor. PasspaginationMeta.after back as after until it’s empty:
Filtering
Filter parameters take an operator and a list of values, as an array:Errors
A response outside 2xx throwsIncidentIo\ApiException. Its code is the HTTP status, and the body is the API’s JSON error:
ApiException, with code 0. If you contact us about a failed request, include the request_id from the body.
Configuration
Configuration holds the API key, the base URL (setHost, which defaults to https://api.incident.io), and the user agent (setUserAgent). The first argument to every Api class is a Guzzle client, so timeouts, proxies, and middleware are Guzzle options:
429 and a Retry-After header in seconds. Guzzle’s retry middleware can handle this, and the README has a ready-made example.
Enum values
Enum values are constants on the model that uses them, such asActionV1::STATUS_COMPLETED, and the properties themselves are plain strings. We add enum values as a backwards-compatible change, so the SDK accepts values it doesn’t know: a newer value comes through as sent. If you match on an enum, give it a default arm.
Deprecated endpoints
Endpoints we’ve deprecated stay available, but they’re marked@deprecated, which IDEs and static analysers pick up. Don’t go by the version in the name: some v2 endpoints are deprecated too.
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
Packagist
The
incident-io/sdk-php package and its versions.GitHub
Source, README, and issues for the PHP SDK.
API reference
Endpoints, authentication, rate limits, and errors.
All SDKs
Clients for Go, TypeScript, Python, Rust, Ruby, and .NET.