Download the PHP package omnifox/sdk without Composer

On this page you can find all versions of the php package omnifox/sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sdk

omnifox/sdk

Official PHP SDK for the Omnifox.io REST API.

Omnifox is an omnichannel customer messaging platform (WhatsApp, Instagram, Messenger, Telegram, TikTok, email, webchat, SMS) with a shared inbox, AI agents, CRM, boards, calendar, product catalog, orders and quotes. This SDK wraps the v1 REST API documented at https://omnifox.io/docs.

Install

The package is on Packagist: https://packagist.org/packages/omnifox/sdk. If Packagist is not reachable from your network, install it straight from GitHub:

Quickstart (plain PHP)

Results are associative arrays, already unwrapped from the API's {success, message, data} envelope.

Laravel

Add the credentials to config/services.php:

Bind one client in App\Providers\AppServiceProvider::register():

Then inject it anywhere:

Authentication

Create a token in Omnifox under Settings > API keys and pass it as apiKey. The SDK sends Authorization: Bearer <token> on every request.

Workspaces

Tokens from the API-keys screen are pinned to one workspace, and the server resolves it from the token, so workspaceId is optional for them. If you do set it, it must match the token's workspace (a mismatch is a deliberate 403).

Set it anyway when you can: four endpoints validate workspace_id as a required body field however the token is scoped: users->setAgentStatus(), teams->create(), channels->create() and broadcasts->create(). With workspaceId configured the SDK fills it in; without it those four throw Omnifox\Exception\InvalidArgumentException before any request is sent, instead of an opaque 422.

The workspace travels as the workspace_id query parameter. The X-Workspace-Id header is not read by the API, so the SDK never sends it.

Identifiers

Every contact method accepts a numeric id or a kind:value selector, URL-encoded for you:

Pagination

list() returns a lazy Omnifox\Pagination\Paginator; iterate it and pages are fetched as needed. listPage() returns one Omnifox\Pagination\Page.

The API answers listings with four envelopes (plain, paginated() with top-level meta, a Laravel paginator inside data, and ?pagination=cursor). The paginator understands all four: it asks for cursor mode and falls back to ?page=N on endpoints that ignore it, so it never stops after the first page. It hard-stops at 500 pages.

Errors

Every exception implements Omnifox\Exception\OmnifoxException.

Exception When
AuthenticationException 401: token missing, wrong or revoked
PaymentRequiredException 402: the plan or wallet does not cover it
PermissionDeniedException 403: plan gate, token ability (read:crm, write:projects...), workspace mismatch
NotFoundException 404: does not exist, or belongs to another workspace
ConflictException 409: e.g. booking a calendar slot that is taken
ValidationException 422: getFieldErrors() returns Laravel's field => messages map
RateLimitException 429 after retries: getRetryAfter() in seconds
ServerException 5xx after retries
ApiException base class of all of the above: getStatusCode(), getErrorCode(), getDetails(), getRequestId(), getBody()
NetworkException no HTTP response (DNS, TLS, refused, timeout)
InvalidArgumentException rejected locally, before any request

429 and 5xx answers and connection failures are retried with exponential backoff and jitter (honouring Retry-After), maxRetries times (default 3). Timeouts are not retried.

Per-call options

Every write method takes a last $options argument, as an array or a RequestOptions:

For any route without a dedicated method there is an escape hatch with the same auth, workspace and retry handling: $omnifox->request('GET', '/me/notifications') (unwrapped) or $omnifox->requestRaw(...) (whole body).

Resources

Property Methods
contacts list, listPage, get, search, listViaDsl, create, upsert, update, delete, merge, openConversation, closeConversation, assignConversation, setConversationStatus, comment, channels, attachTag, detachTag, attachTagsByName, detachTagsByName, sendMessage, listMessages, getMessage
conversations list, listPage, get, create, assign, close, reopen, addNote, listMessages, sendMessage, getMessage, windowStatus
messages send
channels list, listPage, get, create, disconnect, health, templates
broadcasts list, listPage, get, create, cancel
customFields list, listPage, get, create, update, delete
tags, snippets, workspaces list, listPage, get, create, update, delete
webhooks list, listPage, get, create, update, delete, rotateSecret
workflows list, listPage, get, activate, deactivate, trigger
users me, logout, listAgents, listAgentsPage, getAgent, setAgentStatus
teams list, listPage, get, create, update, delete, addMember, removeMember
companies list, listPage, get, create, update, delete, attachContact, detachContact
deals list, listPage, get, create, update, delete, moveToStage, close, timeline, board, bulk
pipelines list, get, create, update, delete, createStage, updateStage, deleteStage
crmActivities list, listPage, create, get, update, complete, delete
boards list, get, view, columns, activity, create, update, delete, duplicate, createGroup
boardItems create, get, update, delete, duplicate, move, setCellValue, listUpdates, addUpdate
appointments listCalendars, listServices, slots, list, book, update, cancel
products list, listPage, get, create, update, delete
orders list, listPage, get, create, update, setStatus, recordPayment, delete
catalogSettings get, update, applyPreset
quotes list, listPage, get, create, update, delete, send, markViewed, accept, reject, pdf, billingEntities
reports overview, conversations, agents, heatmap, crmFunnel, crmForecast, crmWinLossReasons

Conversations

Contacts

CRM

CRM routes need the CRM plan feature and, on scoped tokens, read:crm / write:crm.

Calendar and video meetings

Catalog, orders and quotes

Boards

Notes for PHP specifically

Development

License

MIT


All versions of sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-json Version *
guzzlehttp/guzzle Version ^7.5
guzzlehttp/psr7 Version ^2.4
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.1 || ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package omnifox/sdk contains the following files

Loading the files please wait ...