PHPackages                             exsitedapidemo/autobill-exsitedemo - 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. exsitedapidemo/autobill-exsitedemo

ActiveLibrary[API Development](/categories/api)

exsitedapidemo/autobill-exsitedemo
==================================

PHP SDK for the Exsited API

01PHP

Since Jul 15Pushed 7mo agoCompare

[ Source](https://github.com/exsited/exsited-php)[ Packagist](https://packagist.org/packages/exsitedapidemo/autobill-exsitedemo)[ RSS](/packages/exsitedapidemo-autobill-exsitedemo/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

CakePHP Project Setup with Exsited PHP SDK
==========================================

[](#cakephp-project-setup-with-exsited-php-sdk)

This document provides step-by-step instructions for setting up a CakePHP project and integrating it with the Exsited PHP SDK. Follow this guide to create the project, install the SDK, configure authentication, and make API calls.

Table of Contents
-----------------

[](#table-of-contents)

1. [Prerequisites](#1-prerequisites)
2. [Project Setup](#2-project-setup)
3. [Installing the SDK](#3-installing-the-sdk)
4. [Configuration](#4-configuration)
5. [Authentication Setup](#5-authentication-setup)
6. [Making API Calls Using the SDK](#6-making-api-calls-using-the-sdk)

1. Prerequisites
----------------

[](#1-prerequisites)

Ensure you have the following installed:

- **PHP**: Version 7.0 or higher
- **XAMPP**: For local development and testing
- **Composer**: Dependency management
- **CakePHP**: PHP framework for the project

2. Project Setup
----------------

[](#2-project-setup)

### Step 1: Create a New CakePHP Project

[](#step-1-create-a-new-cakephp-project)

```
composer create-project --prefer-dist cakephp/app my_cakephp_project
cd my_cakephp_project
```

### Step 2: Configure Database (Optional for Testing)

[](#step-2-configure-database-optional-for-testing)

- Edit `config/app.php`
- Update the `Datasources` section with your database credentials.
- Ensure XAMPP is running and the database is accessible.

3. Installing the SDK
---------------------

[](#3-installing-the-sdk)

### Step 1: Install the SDK Package

[](#step-1-install-the-sdk-package)

```
composer require exsitedapi/exsited-sdk:dev-main --with-all-dependencies
```

### Step 2: Verify Installation

[](#step-2-verify-installation)

- SDK should be located at: `vendor/apidemo/autobill-sdkdemo`

4. Configuration
----------------

[](#4-configuration)

### Step 1: Create `token.json`

[](#step-1-create-tokenjson)

In `vendor/apidemo/autobill-sdkdemo/`, create `token.json`:

```
[
  {
    "apiUrl": "https://api-stage.exsited.com/",
    "appUrl": "https://api-stage.exsited.com/",
    "client_id": "[YOUR_CLIENT_ID]",
    "client_secret": "[YOUR_CLIENT_SECRET]",
    "access_token": "[YOUR_ACCESS_TOKEN]",
    "refresh_token": "[YOUR_REFRESH_TOKEN]",
    "redirect_uri": "https://www.google.com",
    "authTokenRenewCallback": {}
  }
]
```

### Step 2: Create `sdk-config.json`

[](#step-2-create-sdk-configjson)

```
{
  "apiVersion": "v3",
  "reQuestTimeOut": 240
}
```

5. Authentication Setup
-----------------------

[](#5-authentication-setup)

Update `token.json` with actual credentials:

KeyValue`client_id`\[YOUR\_CLIENT\_ID\]`client_secret`\[YOUR\_CLIENT\_SECRET\]`redirect_uri`\[YOUR\_REDIRECT\_URI\]`apiUrl`\[YOUR\_API\_URL\]`appUrl`\[YOUR\_APP\_URL\]6. Making API Calls Using the SDK
---------------------------------

[](#6-making-api-calls-using-the-sdk)

### Step 1: Create SDK Controller

[](#step-1-create-sdk-controller)

`src/Controller/SdkController.php`

```
