Download the PHP package rikochey/rikochey-php without Composer
On this page you can find all versions of the php package rikochey/rikochey-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package rikochey-php
Rikochey PHP
Official PHP client for the Rikochey API: websites, forms, server-side submissions, JavaScript actions and API tokens.
- PHP 8.1+, no dependency: curl when available, PHP streams otherwise
- Key-only authentication: the library never handles a password, and never shows the key in a dump
- Typed, read-only responses, and one exception per kind of error
- Pluggable HTTP transport: route requests through your framework's HTTP client, proxy and certificates included
The full guide is published with the API documentation: Client libraries → Rikochey PHP.
Installation
Without Composer, download a release, unzip it in your project and load its autoloader:
Getting started
Create an API key in your workspace (Organization → API tokens), then:
Keep the key on the server, in your configuration: it gives access to every website of your organization, and must never reach a browser.
What it covers
| Resource | Methods |
|---|---|
| Websites | websites()->all(), get($id), inDepartment($code) |
| Forms of a website | websites()->forms($id): the script tag and the active forms, with Form::tag() to place one in a page |
| Submissions | submissions()->submit($websiteId, $formSlug, $fields, $captcha) |
| JavaScript actions | websites()->eventActions($id), updateEventActions($id, $actions, $version) |
| API tokens | tokens()->all(), create($name), revoke($id), revokeAll() |
Place a form in a page
Submit a request from a server
Errors
Every exception extends Rikochey\Exception\RikocheyException:
| Exception | When |
|---|---|
AuthenticationException |
401: key unknown, expired or revoked |
AuthorizationException |
403: another organization, website disabled, captcha (errorCode) |
NotFoundException |
404: unknown website, form or token |
ConflictException |
409: the JavaScript actions changed since they were read |
ValidationException |
422: invalid fields, errors() by field name |
RateLimitException |
429: wait retryAfter seconds |
ApiException |
any other status, or a response that is not JSON |
TransportException |
no response at all: DNS, TLS, timeout |
Your own HTTP client
Implement Rikochey\Http\Transport (one send(Request): Response method) and pass it as the
third argument of the client. Return every HTTP response, error statuses included: the client
turns them into exceptions.
License
MIT. See LICENSE.
All versions of rikochey-php with dependencies
ext-json Version *