PHP code example of fmasites / omeda

1. Go to this page and download the library: Download fmasites/omeda library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fmasites / omeda example snippets


use FMASites\Omeda\OmedaApi;

$api = new OmedaApi();

$api = new OmedaApi(baseApiUrl: 'https://...', clientBaseApiUrl: 'https://...');

// Brand
$api->brandComprehensiveLookup();             // Cached for 8 hours

// Customer
$api->customerComprehensiveLookup($id);
$api->customerLookupByEmail($email);
$api->customerLookupByEmailCandidates($email);  // 300 (multiple matches) returns the Customers list instead of false

// Orders & Transactions
$api->storeCustomerAndOrder($data);
$api->transactionLookup($transactionId);
$api->runProcessor($transactionIds);          // Utility API

// Postal
$api->postalInfoLookup($zipCode);             // Utility API

// Behaviors
$api->assignBehavior($customerId, $behaviors);

// Email
$api->emailOptinQueue($email, $deploymentTypeId, $options);

// Products & Deployments
$api->productLookupByBrand();                 // All defined products for the brand, including past Issues per product
$api->emailDeploymentSearch($criteria);       // Search past Omail deployments, e.g. ['Type' => $deploymentTypeId, 'DeploymentDateStart' => ..., 'DeploymentDateEnd' => ..., 'Statuses' => ['SENT']]
$api->emailDeploymentLookup($trackId);        // Deployment detail, including per-split HtmlContentUrl/TextContentUrl
$api->fetchDeploymentContent($url);           // Fetches a HtmlContentUrl/TextContentUrl - these need the appid header too, so they can't be linked to directly

use FMASites\Omeda\DataAdapter;

// Filter demographics down to specific type IDs
DataAdapter::filterByDemographicTypes($brandData, [1, 2, 3]);

// Simplify the full brand lookup response to a smaller structure
DataAdapter::simplifyBrandComprehensiveLookupData($brandData);

// Remove specific demographic value options by ID
DataAdapter::removeDemographicValueOptionsById($brandData, [10, 11]);

// Simplify a products array
DataAdapter::simplifyProductData($products);