Skip to content

nToklo/ntokloapi-php

Repository files navigation

nToklo API PHP connector

Version: 1.0.5 stable

This library will allow you to connect to the nToklo API and create your own applications, get tokens and the results. Full documentation of the API can be found in the nToklo dev website

Installation

Composer

$ composer require ntoklo/ntokloapi-php

Usage

You can see how to use this library on the documentation

Include the require path to autoload.php and instantiate a new NtokloApi class and pass through the nToklo api key and secret.

require "vendor/autoload.php";

$api = new NtokloApi('nToklo API key', 'nToklo API secret');

Examples

Events

Events API allows customers to send nToklo user activity. Click here for more info on Events

$api->postEvent( $array );

Add Products

Add a new product to the Ntoklo API Click here for more info on posting product

$api->postProduct( $array );

Get product

Get a product by ID Click here for more info on getting product by Id

$api->getProduct( $productId );

Recommendations

Recommendations API allows customers to retrieve recommendations based on user history and product attributes Click here for more info on recommendations

$api->recommendations( $userId, $productId, $scope, $value );

Charts

Charts API allows customers to retrieve a list of popular products. Charts represents a rolling time window (daily or weekly) and can be scoped by product attributes and filtered by action. Click here for more info on charts

$api->chart( $timestamp, $scope, $value, $action, $tw, $maxItems );

Add to blacklist

Add to blacklist Click here for more info on adding product to blacklist

$api->addBlacklist($productId);

Remove from blacklist

Remove from blacklist Click here for more info on removing product from blacklist

$api->removeBlacklist($productId);

Get blacklist product

Gettin all blacklisted product Click here for more info on getting blacklisted products

$api->fetchBlacklist();

Features

This is a list of the functionality that is available on this API connector:

  • postEvent($date);
  • postProduct($data_product);
  • getProduct($productId);
  • recommendations($userId = null, $productId = null, $scope = null, $value = null);
  • chart($timestamp = null, $scope = null, $value = null, $action = null, $tw = null, $maxItems = null);
  • addBlacklist($productId);
  • removeBlacklist($productId);
  • fetchBlacklist();

Authors

License

This library is licensed under the Apache 2.0 license. See LICENSE for more details

Copyright

Copyright 2015 nToklo Ltd.

About

PHP connector for ntoklo recommendations engine

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages