Download the PHP package opportify/opportify-sdk-php without Composer
On this page you can find all versions of the php package opportify/opportify-sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package opportify-sdk-php
Opportify-SDK-PHP
Table of Contents
- Overview
- Requirements
- Getting Started
- Calling Email Insights
- Calling IP Insights
- Calling Fraud Protection
- Batch Analysis (Email & IP)
- Batch Email Analysis (JSON)
- Batch Email Analysis (Plain Text)
- Batch Email Analysis (File Upload)
- Batch IP Analysis (JSON)
- Batch IP Analysis (Plain Text)
- Batch IP Analysis (File Upload)
- Batch Export Jobs
- Email Batch Exports
- IP Batch Exports
- Enabling Debug Mode
- Handling Errors
- About this package
Overview
The Opportify SDK gives your PHP application access to the full Opportify platform:
| Product | Purpose |
|---|---|
| Email Insights | Validate, enrich, and score email addresses |
| IP Insights | Geolocate, enrich, and assess risk for IP addresses |
| Fraud Protection | Analyze form submissions for fraud risk across email, IP, geo, session, and velocity signals |
All products share a common API key and the same SDK installation.
Base URLs
| Product | Base URL |
|---|---|
| Email & IP Insights | https://api.opportify.ai/insights/v1/ |
| Fraud Protection | https://api.opportify.ai/intel/v1/ |
Requirements
Requires PHP v8.1 or later.
Getting Started
First, install Opportify via the Composer package manager:
Calling Email Insights
Calling IP Insights
Calling Fraud Protection
Analyze a form submission for fraud risk. The response provides an overall risk score with a breakdown by signal source (email, IP, geo, session, velocity).
All parameter names accept both snake_case and camelCase (e.g. user_ip or userIp).
Batch Analysis (Email & IP)
You can submit multiple emails or IPs in a single request. Batch jobs are processed asynchronously; the response returns a job identifier (jobId) you can poll for status.
1. Batch Email Analysis (JSON)
2. Batch Email Analysis (Plain Text)
Provide one email per line and set the content type to text/plain.
3. Batch Email Analysis (File Upload)
Supply a .csv (one email per row; header optional) via batchAnalyzeFile(). A .csv triggers multipart/form-data; other extensions fall back to text/plain (newline-delimited body).
4. Batch IP Analysis (JSON)
5. Batch IP Analysis (Plain Text)
6. Batch IP Analysis (File Upload)
Convenience & Notes
batchAnalyzeFile()auto-selects content type:.csv->multipart/form-data; otherwisetext/plain.- For
text/plain, pass newline-delimited values via thetextkey. - For
multipart/form-data, pass a readable file path via thefilekey (handled internally bybatchAnalyzeFile()). - The
nameparameter is optional for all batch operations and helps with job identification and tracking. enableAutoCorrectionapplies only to Email Insights.- Always wrap calls in a try-catch (see Error Handling) to capture API errors.
- Polling cadence depends on payload size; a short delay (1–3s) between status checks is recommended.
Batch Export Jobs
Use batch exports to materialize filtered results from completed jobs. Exports run asynchronously and expose polling helpers similar to batch status checks.
Email Batch Exports
IP Batch Exports
Enabling Debug Mode
All wrappers support debug mode, which enables verbose HTTP logging via Guzzle:
You can also override the host, API prefix, or version for testing against staging environments:
Handling Errors
We strongly recommend wrapping all SDK calls in a try-catch to handle API errors.
Email Insights & IP Insights use OpenAPI\Client\ApiException:
Fraud Protection uses its own namespace OpenAPI\FraudIntel\Client\ApiException:
All ApiException instances expose the same interface:
| Method | Type | Example |
|---|---|---|
$e->getMessage() |
string | "[403] Client error: POST https://api.opportify.ai/... resulted in a 403 Forbidden" |
$e->getResponseBody() |
string | '{"errorMessage":"Your plan does not support AI features","errorCode":"INVALID_PLAN"}' |
$e->getCode() |
integer | 403 |
About this package
This PHP package is a customization of the base generated by:
- OpenAPI Generator project.