kingscode / php-klanten-vertellen-api
This is a wrapper which makes it easy to retrieve and post data to the Klanten Vertellen website
Installs: 10 769
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 6
Forks: 5
Open Issues: 1
Requires
- php: ^8.1
- ext-curl: *
- ext-json: *
This package is auto-updated.
Last update: 2024-10-23 15:26:50 UTC
README
A PHP implementation of the klantenvertellen.nl Api.
This is a PHP package which you can import in any of your PHP projects. The goal of this package is to make it easy to communicate with the KlantenVertellen api with just a few function calls.
Installation
composer require kingscode/php-klanten-vertellen-api
Usage
⚠️ Before you get started, make sure you already have a token
and location id
from the
KlantenVertellen website.
You can get the api-token from:
My Account -> Invite -> Extra Options
The ID to your review page can be found in the link on the same page as the token:
(ex: https://www.klantenvertellen.nl/invite-link/XXXXXXX/yourcompany.nl?lang=en)
Getting started
To get started you need to create a KlantenVertellenWrapper
object, like so:
$repository = new Repository('YOUR-TOKEN-HERE', 1234, 'nl'); $wrapper = new KlantenVertellenWrapper(new GetReviews($repository), new ReviewInvite($repository));
Getting reviews
//This will return 50 latest reviews that got posted on your page $reviews = $wrapper->reviews()->getReviews(50); //This will return the 25 worst reviews that got posted on your page $worstReviews = $wrapper->reviews()->getWorstReviews();
Sending review invites
//You can only send an invite to the same address every 30 days $wrapper->inviter()->sendInvite('info@mail.com', 'First name', 'Last name');