Attached below examples and tutorial on how to get started with Ever XP PHP library.
The PHP SDK is available via Composer. Install it using the command below:
composer require everxp/php
Initialize the EverXP PHP SDK by importing the class and providing the Bearer token for authentication:
require 'vendor/autoload.php'; use Everxp\Everxp; $everxp = new Everxp([ 'bearer_token' => 'YOUR_BEARER_TOKEN' ]);
Make a request to EverXP's API using Bearer authentication. This function supports GET requests and returns the API response as an array.
Key | Type | Optional | Explaination |
---|---|---|---|
api_key | Authorization: Bearer | Required | |
folder | Number | Required | Add new folders here My Bank |
lang | Text | Required | Languages list |
style | Number | Optional | Writing Styles list |
voice | Number | Optional | Writing Voices list |
min_l | Number | Optional | Minimum number of characters |
max_l | Number | Optional | Maximum number of characters |
div | Text | Optional | Returns result as text inside div id otherwise returned as json response |
user_identifier | Text | Optional | Any kind of parameter to identify your customer (IP, User ID, Email, Username, or First and Last name) Example: [email protected]. |
$params = [ 'lang' => 'en', 'style' => 1, 'min_l' => 100, 'max_l' => 200 ]; $response = $everxp->execute_request_bearer($params); if (isset($response['error'])) { echo "Error: " . $response['error']; } else { print_r($response); }
The response is returned as an associative array. Example response:
Array ( [success] => 1 [data] => Array ( [heading] => "This is a sample heading." ) )
In case of errors, the response will include an error
key with details:
Array ( [error] => "Unauthorized: Invalid Bearer Token." )
Facing an error? Error codes list