PHPackages                             thalvik/resdiary-api-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. thalvik/resdiary-api-client

ActiveLibrary[API Development](/categories/api)

thalvik/resdiary-api-client
===========================

PHP client for ResDiary REST API

1389PHP

Since Apr 12Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Thalvik/resdiary-api-client)[ Packagist](https://packagist.org/packages/thalvik/resdiary-api-client)[ RSS](/packages/thalvik-resdiary-api-client/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP client for ResDiary API
===========================

[](#php-client-for-resdiary-api)

This is an unoffical PHP client for ResDiary API. It includes basic HTTP client, which is a simple HTTP wrapper around Guzzle HTTP client library. It then communicates with ResDiary API by calling available endpoints. Check the ResDiary API documentation for available API calls.

Basic usage
-----------

[](#basic-usage)

Run composer

`composer require thalvik/resdiary-api-client`

Initalize the class with parameters

```
use Thalvik\ResDiaryApiClient\RdaClient;

$rdaClient = new RDAClient([
	'api_url' => 'https://thegreatapi.com/', //Change this to value given by ResDiary
	'username' => 'someusername', //Change this to value given by ResDiary
	'password' => 'somepassword' //Change this to value given by ResDiary
]);
```

Since token is lasting 24 hours, you want to check if you havent already saved token, for example calling in your custom function to check it in database

```
$tokenSaved = someFunctionToRetrieveSaved24hToken('YOUR_RESDIARY_TOKEN_NAME');
```

You then call `setAccessToken()` on a client, which if token has expired, will set new token and retrieve it

```
$tokenClient = $rdaClient->setAccessToken($tokenSaved);
```

You can then check if token has changed, you set new one for next 24 hours calling in your custom function

```
if ($tokenClient != $tokenSaved) {
	someFunctionToSave24hToken( 'YOUR_RESDIARY_TOKEN_NAME', $tokenClient);
}
```

You can then use client to call methods on available services

```
$now = new \DateTime();

$restaurantSetup = $rdaClient->getConsumerService('Restaurant') //Service name
->setMicroSiteName('TestProvider') //Set microSiteName
->getSetup([ //Call method
	'date' => $now->format('Y-m-d'),
	'channelCode' => 'ONLINE',
]);
```

If there are some errors in client request, you can check them by calling `hasErrors` and `getErrors` methods. `getErrors`will return array with `Message` and `ValidationErrors`

```
if ($rdaClient->hasErrors()) {
	print_r($rdaClient->getErrors());
	exit();
}
```

Else, the call will return relevant data

```
print_r($restaurantSetup);
```

To run tests, fill the credentials in phpunit.xml.dist file

```

```

Then run PHPUnit

`vendor/bin/phpunit`

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b47433c2422101fb7838ee87086bae4bdf6a8eed5774ca0c9cca749cc145ee93?d=identicon)[thalvik](/maintainers/thalvik)

---

Top Contributors

[![Thalvik](https://avatars.githubusercontent.com/u/5910333?v=4)](https://github.com/Thalvik "Thalvik (2 commits)")

### Embed Badge

![Health badge](/badges/thalvik-resdiary-api-client/health.svg)

```
[![Health](https://phpackages.com/badges/thalvik-resdiary-api-client/health.svg)](https://phpackages.com/packages/thalvik-resdiary-api-client)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
