SDK surface reference¶
This document outlines the public PHP surface. Classes provide the PHP mapping for the OpenAPI endpoint contract.
Entry points¶
OkatanaClient¶
Construct OkatanaClient with a Configuration object, or use OkatanaClient::create().
$client = OkatanaClient::create(
baseUrl: 'https://pm.example.com',
apiKey: $_ENV['OKATANA_TOKEN'],
);
Public service accessors:
| Method | Service |
|---|---|
organizations() |
OrganizationsApi |
projects() |
ProjectsApi |
boards() |
BoardsApi |
tickets() |
TicketsApi |
documents() |
DocumentsApi |
notifications() |
NotificationsApi |
request() |
low-level relative /api/v1 request |
Configuration¶
Constructor arguments:
| Argument | Type | Default | Meaning |
|---|---|---|---|
baseUrl |
string |
required | Deployment origin or complete /api/v1 base URL. |
apiKey |
string |
required | Okatana bearer credential. |
timeout |
float |
30.0 |
Default Guzzle request timeout in seconds. |
userAgent |
string |
SDK identifier | Outbound User-Agent value. |
retryPolicy |
?RetryPolicy |
safe-read policy | Retry policy for transport errors and selected statuses. |
The base URL must be absolute HTTP(S), cannot contain a query or fragment, and has no package default.
Service methods¶
OrganizationsApi¶
get(string $organization): ApiResponse
ProjectsApi¶
list(string $organization): ApiResponsecreate(string $organization, CreateProjectRequest|array $request): ApiResponseget(string $project): ApiResponseupdate(string $project, UpdateProjectRequest|array $request): ApiResponsedelete(string $project): ApiResponsemembers(string $project): ApiResponselabels(string $project): ApiResponsetags(string $project): ApiResponseanalytics(string $project): ApiResponse
BoardsApi¶
list(string $project): ApiResponsecreate(string $project, CreateBoardRequest|array $request): ApiResponseupdate(string $board, UpdateBoardRequest|array $request): ApiResponsereorder(string $project, ReorderBoardsRequest|array $request): ApiResponsedelete(string $board, ?string $moveToBoardId = null): ApiResponse
TicketsApi¶
list(string $project, ?TicketListOptions $options = null): ApiResponsecreate(string $project, CreateTicketRequest|array $request): ApiResponsereorder(string $project, ReorderTicketsRequest|array $request): ApiResponseget(string $ticket): ApiResponseupdate(string $ticket, UpdateTicketRequest|array $request): ApiResponsedelete(string $ticket): ApiResponsemove(string $ticket, MoveTicketRequest|array $request): ApiResponsecomment(string $ticket, TicketCommentRequest|array $request): ApiResponse
DocumentsApi¶
list(string $organization, ?DocumentListOptions $options = null): ApiResponsecreate(string $organization, CreateDocumentRequest|array $request): ApiResponseget(string $document): ApiResponseupdate(string $document, UpdateDocumentRequest|array $request): ApiResponsedelete(string $document): ApiResponsecomment(string $document, DocumentCommentRequest|array $request): ApiResponse
NotificationsApi¶
send(string $organization, SendNotificationRequest|array $request): ApiResponse
Request classes¶
Create and command payloads are immutable readonly value objects:
CreateProjectRequestCreateBoardRequestReorderBoardsRequestCreateTicketRequestReorderTicketsRequestMoveTicketRequestTicketCommentRequestCreateDocumentRequestDocumentCommentRequestSendNotificationRequest
List option objects:
TicketListOptionsDocumentListOptions
PATCH builders preserve the distinction between an omitted field and explicit JSON null:
UpdateProjectRequestUpdateBoardRequestUpdateTicketRequestUpdateDocumentRequest
Every service write method also accepts an associative array as a forward-compatibility escape hatch.
Enums¶
TicketPriority:lowest,low,normal,high,highest,critical.DocumentStatus:draft,published.Scope: all current external API scopes, including*.
Response objects¶
ApiResponse¶
Important members and methods:
statusCode— raw HTTP status.headers— normalized response headers.body— unmodified response body string.json— decoded JSON object/array ornullfor an empty body.data()— unwrap the top-leveldataenvelope when present.collection()— return a simple collection or paginator item collection.pagination()— returnPaginationmetadata when the response uses the documented Laravel paginator shape.header(string $name)— first joined header value.requestId()— common request/correlation ID header lookup.isNoContent()— true for HTTP204.
Pagination¶
Provides currentPage, lastPage, perPage, total, nextPageUrl, previousPageUrl, and items while retaining the raw paginator object.
Models¶
Models are optional typed views. They keep the source object in raw so unknown response fields remain available.
ProjectBoardTicketDocumentDocumentTagApiError
Use response helpers directly for endpoint payloads that do not have a schema in the supplied OpenAPI document. The SDK does not invent fields for underspecified responses.
Exceptions¶
All SDK exceptions derive from OkatanaException.
| Exception | Condition |
|---|---|
ConfigurationException |
invalid base URL, empty token, invalid timeout, or invalid configuration |
TransportException |
PSR-18 transport could not send/parse a request after allowed retry attempts |
AuthenticationException |
HTTP 401 |
AuthorizationException |
HTTP 403 |
NotFoundException |
HTTP 404 |
ValidationException |
HTTP 422; exposes Laravel-style errors() |
RateLimitException |
HTTP 429; exposes parsed Retry-After seconds when available |
ApiException |
other HTTP error status |
UnexpectedResponseException |
malformed or unexpected success payload |
Transport extension points¶
OkatanaClient accepts:
Psr\Http\Client\ClientInterface;Psr\Http\Message\RequestFactoryInterface;Psr\Http\Message\StreamFactoryInterface;Psr\Log\LoggerInterface;- SDK
Sleeperfor deterministic retry tests.
The default implementation uses Guzzle, but package consumers can inject a different PSR-18 client.