bootiq/cms-api-vendor

B!Q CMS api vendor

00.01.00 2018-02-08 15:03 UTC

This package is not auto-updated.

Last update: 2024-04-22 16:19:53 UTC


README

BOOT!Q Logo

pipeline status coverage report

Installation

For installation of Boot!Q CMS API vendor use composer:

composer require bootiq/cms-api-vendor

Configuration

Adapter

For using our adapter, simply use factory or DI in your project and provide needed services and parameters as shown below:

$adapter = new \BootIq\CmsApiVendor\Adapter\GuzzleSecurityTokenAdapter(
    new \GuzzleHttp\Client(),
    $responseFactory,
    $urn,
    $apiPublicId,
    $apiSecret
);
  • $responseFactory is service for creating responses. You can use our default factory BootIq\CmsApiVendor\Response\ResponseFactory, or if you want use own response factory, your factory have to implement BootIq\CmsApiVendor\Response\ResponseFactoryInterface.
  • $urn is web address of your CMS system for example: 'https://cms.bootiq.io/api/v1/'.
  • $apiPublicId is your public id which is used for identifying our customer.
  • $apiSecret is key for hashing and authorizing our customer.

For using own adapter, you have to implement AdapterInterface from BootIq\CmsApiVendor\Adapter.

Modification of our adapter

You can change following attribute or services in our adapter, simply by using setter:

  • Timeout - Timeout of calling our CMS system (default: 10s).
  • Cache - Every request and response are able to cache by setting cache service (PSR-16).
  • Logger - Logger can log every call to our CMS system (default: no loging => NullLogger; PSR-3).

Usage

For using our CMS API you can use your own services, or our default services.

PageService

  • getPageById - will get page from CMS by its id.
  • getPageBySlug - will get page from CMS by its slug.