Skip to main content

Getting Started with PHP

Safe API Key Storage

In a production setup, do not store API Keys in the host's environment variables or in the source code.

Requirements

Install the Opportify SDK

Install Using a Package Manager

To start using the Opportify SDK in your PHP project, you can install the Opportify SDK from the Composer package manager:

composer require opportify/opportify-sdk-php

Usage

Client

After you installed the library, you can create a client instance and interface with it.

use Opportify\Sdk\EmailInsights;

$emailInsights = new EmailInsights("YOUR-API-KEY-HERE");

Make a request

use Opportify\Sdk\EmailInsights;

$params = [
"email" => "test@gmial.com", // *gmial* - just an example to be auto-corrected
"enableAi" => true,
"enableAutoCorrection" => true
];

$result = $emailInsights->analyze($params);

What's next?

How-To Guides

Once you have installed the Opportify SDK, you can start building your application. You can find usage examples in this Wiki's how-to guides.