Skip to content

Latest commit

 

History

History
192 lines (153 loc) · 8.63 KB

README.md

File metadata and controls

192 lines (153 loc) · 8.63 KB

SwaggerClient-php

Sirena API for lead providers and prospect data manipulation

This PHP package is automatically generated by the Swagger Codegen project:

  • API version: 1.5.0
  • Build package: io.swagger.codegen.languages.PhpClientCodegen For more information, please visit http://www.getsirena.com

Requirements

PHP 5.4.0 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/zephia/sirena-api-client.git"
    }
  ],
  "require": {
    "zephia/sirena-api-client": "1.*"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/SwaggerClient-php/autoload.php');

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: ApiKey
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
// Configure OAuth2 access token for authorization: OAuth2
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$api_instance = new Swagger\Client\Api\InteractionsApi();
$format = "format_example"; // string | An optional flag to force a response format. Note that the API also supports content negotiation and honors the Accept header.
$agent = "agent_example"; // string | The id of the agent to filter
$status = "status_example"; // string | The status to filter
$created_after = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | The start date to filter interactions by their creation date
$start = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | @deprecated - use createdAfter The start date to filter interactions by their creation date (alias of createdAfter)
$created_before = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | The end date to filter interactions by their creation date
$end = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | @deprecated - use createdBefore The end date to filter interactions by their creation date (alias of createdBefore)

try {
    $result = $api_instance->getInteractions($format, $agent, $status, $created_after, $start, $created_before, $end);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling InteractionsApi->getInteractions: ', $e->getMessage(), PHP_EOL;
}

?>

Documentation for API Endpoints

All URIs are relative to http://api.getsirena.com/v1

Class Method HTTP request Description
InteractionsApi getInteractions GET /prospects/interactions
LeadsApi getCategories GET /leads/categories
LeadsApi getDefaults GET /leads/defaults
LeadsApi newInsuranceLead POST /lead/insurance
LeadsApi newRetailLead POST /lead/retail
LeadsApi newSavingPlanLead POST /lead/saving-plan
LeadsApi newVehicleLead POST /lead/vehicle
NotificationsApi deactivateSubscription DELETE /notifications/subscription/{subscriptionId}
NotificationsApi getActiveSubscriptionById GET /notifications/subscription/{subscriptionId}
NotificationsApi getActiveSubscriptions GET /notifications/subscriptions
NotificationsApi getTopics GET /notifications/topics
NotificationsApi newSubscription POST /notifications/subscriptions
ProspectsApi deleteProspect DELETE /prospect/{prospectId}
ProspectsApi getInteractionById GET /prospect/{prospectId}/interaction/{interactionId}
ProspectsApi getInteractions GET /prospects/interactions
ProspectsApi getProspectById GET /prospect/{prospectId}
ProspectsApi getProspectInteractions GET /prospect/{prospectId}/interactions
ProspectsApi getProspectQuotes GET /prospect/{prospectId}/quotes
ProspectsApi getProspects GET /prospects
ProspectsApi getQuoteById GET /prospect/{prospectId}/quote/{quoteId}
ProspectsApi getQuotes GET /prospects/quotes
ProspectsApi newProspectQuote POST /prospect/{prospectId}/quotes
ProspectsApi updateProspectQuote PUT /prospect/{prospectId}/quote/{quoteId}
QuotesApi getProspectQuotes GET /prospect/{prospectId}/quotes
QuotesApi getQuoteById GET /prospect/{prospectId}/quote/{quoteId}
QuotesApi getQuotes GET /prospects/quotes
QuotesApi newProspectQuote POST /prospect/{prospectId}/quotes
QuotesApi updateProspectQuote PUT /prospect/{prospectId}/quote/{quoteId}

Documentation For Models

Documentation For Authorization

ApiKey

  • Type: API key
  • API key parameter name: api-key
  • Location: URL query string

OAuth2

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL: http://localhost:2000/oauth2/authorization
  • Scopes:
  • leads:write: Lead Provider
  • prospects:read: Read Prospects
  • prospects:readAdditionalData: Read Prospects Aditional Data
  • prospects:write: Write Prospects
  • notifications: Notifications

Author

[email protected]