Download the PHP package outkit/php-client without Composer

On this page you can find all versions of the php package outkit/php-client. 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 php-client

Outkit API Client

This is the official PHP client for the Outkit API.

Installation

Outkit is available as a Composer package. Add Outkit to your composer.json file like so:

Or you could just add it manually, like so:

Usage

Setup and authentication

You should figure out a way to get your credentials into your script without hardcoding them into your source files, like using environment variables.

Submitting a message

Submitting a message for rendering and/or delivery will return a message record with the Outkit ID and the status set to received (as well as a few other properties that can be determined at creation time). The API call returns as soon as the message is saved on our servers, it does not wait for rendering or delivery to take place (by default - see the section on synchronous processing below). You can retrieve the status of a message at any time. We also support webhook notifications on status changes.

Retrieving a message

You can retrieve the status and data of a message at any time. After the message has been rendered, we will also return the applicable rendered fields (subject, html_body and text_body for emails, text_body for SMS messages) so that you can see exactly what was/will be sent.

Return values

Both API calls return a single PHP stdClass with information about the message being submitted/inquired about. Which fields have content at any given time depends on which fields were submitted and the current status of the message. All JSON objects and arrays are translated to PHP stdClasses and Arrays.

So if the above was stored in $message, you could access status as $message->status.

Rendering a message

To support the use case of rendering a message using the Outkit infrastructure, but sending it yourself, you can specify "render_only" => true in the message record.

Once the message has been rendered, its data will contain a text_body field (all types), and subject and html_body fields for emails. These can then be fed directly to, say, a Mailgun client or SMTP server. See details below.

Synchronous processing

For some use cases (sending emails from scripts, using Outkit as a renderer etc.), it can be desirable to have the API calls operate synchronously - ie. attempt rendering/delivery immediately instead of queueing them, and return the rendered message and (optionally) its delivery status in the data from the API call. This can be accomplished by setting "sync" => true in the submitted message.

Note that this will incur additional costs (see our pricing page for details), and that each Outkit customer is only allowed a limited number of such requests (currently 100.000 per month), since they are more difficult and costly for us to scale. Customers that need additional synchronous requests can contact support to have their monthly limit raised.

Message lifecycle

Submitted messages typically go through the following stages, which are reflected in the status field:

Typically, a message will go through all stages in a matter of milliseconds, but it can sometimes take a little longer.

Note that different message can have different statuses. For example, a message with the render_only flag set will never be queued for delivery or delivered. Messages that supply their own text_body and html_body instead of using a template will never be rendered, only delivered.

Note that the delivered status does not necessarily mean that the message has been delivered to the end user. Once the backend has accepted the message, it’s up to the backend to perform final delivery. Most backends offer webhooks if you need confirmation of the actual delivery.

There are some additional statuses your message can have, in case of errors and problems:

If the message has any of these statuses, there will be more information in the status_message field. Also, you can inspect the full backend response in the response field.

All messages have a done flag (true or false) which indicate whether we have finished processing it. Nothing more will happen to a message once it is done, regardless of its status.

A note on function names

The method names for messages (getMessage and createMessage) are deliberately generic, to align them with future expansions of the API (say, createProject). So even though you might feel like you are submitting or sending a message (and we often use terms like that in our own docs), in API terms you are always just createMessage-ing it.

You’ll probably wrap our functions in your own sendSms or enqueueEmail or whatever anyway, so it shouldn’t be much of an issue. We feel that when dealing with APIs and their clients, consistency trumps linguistic accuracy.

TODO


All versions of php-client with dependencies

PHP Build Version
Package Version
Requires nategood/httpful Version *
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 outkit/php-client contains the following files

Loading the files please wait ....