Download the PHP package elvesora/enrichment-php without Composer

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

Elvesora Enrichment for PHP

A framework-independent PHP client for turning a business domain into a structured company profile with the Elvesora Company Enrichment API.

Requirements

Obtain and manage the key through the Elvesora Enrichment documentation. Keep it in server-side configuration; never expose it in browser or mobile client code.

Installation

Quick start

The package does not load a .env file. If your application uses a dotenv library or framework environment loader, initialize it before reading the key and constructing the client.

domain must be non-empty and no longer than 255 characters. The optional idempotency key is trimmed, treats an empty string as absent, cannot exceed 255 characters, and cannot contain control characters. Invalid local input throws InvalidArgumentException before an HTTP request is sent.

Results

Successful API responses return an immutable EnrichmentResult. It exposes readonly properties for:

Use $result->isEnriched() to test for an ENRICHED result, $result->wasReplayed() to detect a cached idempotent replay, and $result->toArray() or json_encode($result) when the original response shape is more convenient.

CreditMetadata exposes limit, used, remaining, consumedByRequest, periodStartedAt, and periodEndsAt, plus toArray() and JSON serialization.

Non-chargeable business responses

The API uses HTTP 400 when the domain was understood but no chargeable enrichment was produced. Current result types include NOT_FOUND, FREE_EMAIL_PROVIDER, DISPOSABLE, and INVALID_DOMAIN. These responses throw ApiException because they are non-success HTTP responses, while preserving resultType, responseBody, and any returned credits metadata:

Errors

Exception reference

Exception When it is thrown
InvalidArgumentException Empty or invalid local configuration, domain, idempotency key, timeout, or base URL; no HTTP request is sent.
AuthenticationException The response has result type UNAUTHORIZED, or is HTTP 401 without a result type.
ValidationException The response has result type VALIDATION_ERROR, or is HTTP 422 without a result type. Use errors() for field-level validation messages.
UsageLimitException The response has result type LIMIT_EXCEEDED, or is HTTP 429 without a result type. Use limit() and remaining() for credit metadata.
IdempotencyConflictException The response has result type IDEMPOTENCY_KEY_CONFLICT, or is HTTP 409 without a result type.
ApiException The API returns another non-success response, including HTTP 400 business outcomes and upstream failures.
InvalidResponseException The API response is malformed JSON, is not a JSON object, has invalid headers, or violates the expected result or credit contract.
TransportException The HTTP client cannot complete the request because of a connection, DNS, TLS, timeout, or similar transport failure.

All SDK exceptions extend EnrichmentException. It exposes readonly statusCode, resultType, retryable, retryAfter, responseBody, credits, and idempotencyStatus properties. Credit metadata is optional on exceptions because authentication and request-validation responses may not include it. API keys are never added to exception messages.

Exception selection is based on result_type before HTTP status. This preserves upstream failures correctly when the API returns UPSTREAM_ERROR with the upstream status code.

Idempotency and credits

Only an ENRICHED result consumes one credit. HTTP 400 business outcomes, request validation failures, authentication failures, credit-limit rejections, idempotency conflicts, and server or upstream errors do not consume a credit.

Pass an idempotency key when a request may be retried. Responses are retained for 24 hours. Reusing the same key with the same domain returns the retained response without consuming another credit and sets Idempotency-Status: replayed; reusing it with a different domain throws IdempotencyConflictException and sets its idempotencyStatus to conflict when the header is present.

The client does not retry automatically. Automatic retries can create duplicate credit consumption when no idempotency key is supplied. Decide whether to retry from the exception's retryable and retryAfter properties, and reuse the original idempotency key for the same domain.

Configuration

The default endpoint is https://enrichment.elvesora.com/api/v1/enrichment/company. HTTP and HTTPS custom base URLs are accepted so local and test environments can use the same client.

Timeout values are seconds and must be greater than zero. connectTimeout is capped internally at the total timeout. A custom base URL must be an absolute HTTP or HTTPS URL with a host and cannot contain embedded credentials, a query string, or a fragment. The user agent must be a non-empty string.

You may pass a custom Guzzle client as the second constructor argument. This supports shared handlers, proxies, observability middleware, and deterministic tests.

Development

The test suite uses mocked HTTP responses and sends no requests to the live Elvesora API.

License

MIT. See LICENSE.


All versions of enrichment-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-json Version *
ext-mbstring Version *
guzzlehttp/guzzle Version ^7.9 || ^8.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 elvesora/enrichment-php contains the following files

Loading the files please wait ...