Glue API - Content Items API feature integration

Edit on GitHub

Install Feature API

Prerequisites

To start feature integration, overview and install the necessary features:

NAME VERSION INTEGRATION GUIDE
Spryker Core 202108.0 Glue Application feature integration
Product 202108.0 Products API feature integration
Content Item 202108.0

1) Install the required modules using Composer

Run the following command(s) to install the required modules:

composer require spryker/content-banners-rest-api:"^2.1.0" spryker/content-product-abstract-lists-rest-api:"^1.0.0" --update-with-dependencies
“Verification”

Ensure that the following modules have been installed in vendor/spryker:

MODULE EXPECTED DIRECTORY
ContentBannersRestApi vendor/spryker/content-banners-rest-api
ContentProductAbstractListsRestApi vendor/spryker/content-product-abstract-lists-rest-api

2) Set up transfer objects

Run the following command to generate transfer changes:

console transfer:generate
“Verification”

Make sure that the following changes have been applied in transfer objects, see src/Generated/Shared/Transfer/ folder:

TRANSFER TYPE EVENT
RestErrorMessage class created
RestContentBannerAttributes class created
ContentProductAbstractListType class created
ContentBannerType class created
AbstractProductsRestAttributes class created

3) Set up Behavior

Enable resources and relationships

ContentBannerResourceRoutePlugin GET, ContentProductAbstractListRoutePlugin GET verbs are protected resources. Please refer to the Configure section of the Configure documentation.

Activate the following plugins:

PLUGIN SPECIFICATION PREREQUISITES NAMESPACE
ContentBannerResourceRoutePlugin Registers a /content-banners/{CONTENT-KEY} resource route. None Spryker\Glue\ContentBannersRestApi\Plugin
ContentProductAbstractListRoutePlugin Registers a /content-product-abstract-lists/{CONTENT-KEY}/content-product-abstract resource route. None Spryker\Glue\ContentProductAbstractListsRestApi\Plugin

src/Pyz/Glue/GlueApplication/GlueApplicationDependencyProvider.php

<?php

namespace Pyz\Glue\GlueApplication;

use Spryker\Glue\ContentBannersRestApi\Plugin\ContentBannerResourceRoutePlugin;
use Spryker\Glue\ContentProductAbstractListsRestApi\Plugin\ContentProductAbstractListRoutePlugin;
use Spryker\Glue\GlueApplication\GlueApplicationDependencyProvider as SprykerGlueApplicationDependencyProvider;

class GlueApplicationDependencyProvider extends SprykerGlueApplicationDependencyProvider
{
	/**
	* {@inheritdoc}
	*
	* @return \Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\ResourceRoutePluginInterface[]
	*/
	protected function getResourceRoutePlugins(): array
	{
		return [
			new ContentBannerResourceRoutePlugin(),
			new ContentProductAbstractListRoutePlugin(),
		];
	}
}
“Verification”

Make sure that the following endpoints return the result with the all necessary data. For example: