### Install WebwinkelKeur API Client Source: https://github.com/webwinkelkeur/client/blob/master/README.md Install the API client using Composer. This is the initial setup step for using the client in your project. ```bash composer require webwinkelkeur/client ``` -------------------------------- ### Retrieve Ratings Summary Source: https://github.com/webwinkelkeur/client/blob/master/README.md Get a summary of all ratings, including the average rating and the total number of ratings. Useful for displaying overall satisfaction. ```php try { $ratingsSummary = $webwinkelKeurClient->getRatingsSummary(); echo 'The average rating is ' . $ratingsSummary->getRatingAverage() . ' out of ' . $ratingsSummary->getAmount() . " ratings."; } catch (Client\Exception $e) { echo $e->getMessage(); } ``` -------------------------------- ### Initialize WebwinkelKeur Client Source: https://github.com/webwinkelkeur/client/blob/master/README.md Initialize the WebwinkelKeur client with your WebwinkelKeur ID and authentication token. This is required before making any API requests. ```php use WebwinkelKeur\Client; use WebwinkelKeur\Client\Request; $webwinkelKeurClient = new Client($id, $authToken); ``` -------------------------------- ### Send Invitation via WebwinkelKeur API Source: https://github.com/webwinkelkeur/client/blob/master/README.md Send an invitation to a customer using the API client. Ensure all required fields like customer name, email, order number, and total are set. ```php $invitation = new Request\Invitation(); $invitation ->setCustomerName('John Doe') ->setEmailAddress('john.doe@example.com') ->setPhoneNumbers(['+1.2024561111', '+1.2024561414']) ->setOrderNumber(184553) ->setOrderTotal(23.55); try { $webwinkelKeurClient->sendInvitation($invitation); echo 'Success!'; } catch (Client\Exception $e) { echo $e->getMessage(); } ``` -------------------------------- ### Retrieve All Ratings Source: https://github.com/webwinkelkeur/client/blob/master/README.md Fetch all available customer ratings. This can be used to display feedback on your website. ```php try { foreach ($webwinkelKeurClient->getRatings() as $rating) { echo $rating->getName() . ' says "' . $rating->getComment() . ""\n"; } } catch (Client\Exception $e) { echo $e->getMessage(); } ``` -------------------------------- ### Retrieve Webshop Details Source: https://github.com/webwinkelkeur/client/blob/master/README.md Fetch details about your webshop, including its name and address. This information can be used for display or verification purposes. ```php try { $webshop = $webwinkelKeurClient->getWebshop(); $address = $webshop->getAddress(); echo $webshop->getName() . ' is located at ' . $address->getNumber() . ' ' . $address->getStreet() . ', ' . $address->getCity(); } catch (Client\Exception $e) { echo $e->getMessage(); } ``` -------------------------------- ### Retrieve Sent Invitations Source: https://github.com/webwinkelkeur/client/blob/master/README.md Fetch a list of previously sent invitations. This allows you to review invitation history and details. ```php try { foreach ($webwinkelKeurClient->getSentInvitations() as $sentInvitation) { echo 'Invitation for order ' . $sentInvitation->getOrderNumber() . ' was sent on ' . $sentInvitation->getCreatedAt()->format('r') . ' to ' . $sentInvitation->getEmail() . "\n"; } } catch (Client\Exception $e) { echo $e->getMessage(); } ``` -------------------------------- ### Retrieve Rich Snippet Data Source: https://github.com/webwinkelkeur/client/blob/master/README.md Obtain the rich snippet data from the API. This is typically used for SEO purposes to enhance search engine results. ```php try { $richSnippet = $webwinkelKeurClient->getRichSnippet(); echo $richSnippet; } catch (Client\Exception $e) { echo $e->getMessage(); } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.