PHPackages                             jsadways/data-api - 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. jsadways/data-api

ActiveLibrary[API Development](/categories/api)

jsadways/data-api
=================

1.0.29(9mo ago)0448↓76.4%1PHP

Since Nov 19Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/JsAdways/dataApi)[ Packagist](https://packagist.org/packages/jsadways/data-api)[ RSS](/packages/jsadways-data-api/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (36)Used By (1)

Install
-------

[](#install)

composer require jsadways/data-api

Edit .env file
--------------

[](#edit-env-file)

if you use the old repository version add this to .env file

```
REPOSITORY_VERSION=0

```

The defined route url in this package
-------------------------------------

[](#the-defined-route-url-in-this-package)

1. Used in local backend, to receive request from frontend and pass request to the second url below in another system

`POST` `/api/data_api/fetch`

`parameters`

```
{
    system : 'string, the system name you want to get data, which defined in HR system',
    repository : 'string, the repository name you what to get data in the target system',
    condition : 'json, the json condition you wnat to filter out the data, the struce must be the scopFilter package defined'
}

```

`response`

```
{
    data : 'json, the data you filter out from other system'
}

```

2. Used in other system backend, for filter out data using repository

\*\*\*We doesn't recommend using this url directly\*\*\* `GET` `/api/data_api/get`

`parameters`

```
{
    repository : 'string, the repository name you what to get data in the target system',
    condition : 'json, the json condition you wnat to filter out the data, the struce must be the scopFilter package defined'
}

```

`response`

```
{
    data : 'json, the data you filter out from other system'
}

```

3. Used in other system backend, for call the process api

`POST` `/api/data_api/process`

`parameters`

```
{
    system : 'string, the system name you want to get data, which defined in HR system',
    api : 'string, the api path you want to call defined in an other system, ec: verify_copany',
    token: 'string, Bearer token to verify your permission',
    payload: 'Object, the payload api need'
}

```

`response`

```
{
    data : 'json, the api response'
}

```

4. Use Command to list all system process api

`php artisan data-api:list`

`response`

```
+-------------+
| system name |
+-------------+
+--------+--------------------------------+------------+---------+--------+----------+----------------+
| Method | URI                            | Parameters |         |        |          |                |
+--------+--------------------------------+------------+---------+--------+----------+----------------+
| POST   | the api url                    |            | Name    | Type   | Required | Description    |
|        |                                | 0          |         |        |          |                |
|        |                                | 1          |         |        |          |                |
+--------+--------------------------------+------------+---------+--------+----------+----------------+

```

Examples
--------

[](#examples)

1. Call route url post from frontend

`code`

```
axios.post('local_backend/api/data_api/fetch',{
    system: 'crm',
    repository: 'customer',
    condition: '{"filter":{"id_number_eq":"27743336"},"per_page":"0"}'
})

```

`description`

```
frontend post to 'local_backend/api/data_api/fetch',
to get customer data from crm system,
where id_number column equals to '27743336'

```

`response`

```
{   "status_code":200,
    "data":
    [
        {
            "id":1,
            "created_at":"2024-09-19T08:43:00.000000Z",
            "name":"JS-Adways Group",
            "short_name":"js",
            "en_name":"js adways",
            "id_number":"27743336",
            "zip_code":"110",
            "address":"R.O.C",
            "finance_email":null,
            "type":1,
            "memo":null,
            "contact_list":[],
            "identity_list":
            [
                {
                    "id":1,
                    "created_at":"2024-09-19T08:43:00.000000Z",
                    "customer_id":1,
                    "identity":1
                },
                {
                    "id":2,
                    "created_at":"2024-09-19T08:43:00.000000Z",
                    "customer_id":1,
                    "identity":2
                }
            ]
        }
    ]
}

```

2. Call Service from backend system

`code`

- use service

```
use Jsadways\DataApi\Core\Services\Cross\Dtos\CrossDataDto;
use Jsadways\DataApi\Services\Cross\CrossService;

$payload = [
        'system' => 'crm',
        'repository' => 'customer',
        'condition' => '{"filter":{"id_number_eq":"27743336"},"per_page":"0"}'
];
$result = (new CrossService())->fetch(new CrossDataDto(...$payload));

```

- use static method

```
use Jsadways\DataApi\Core\Services\Cross\Dtos\CrossDataDto;
use Jsadways\DataApi\Facades\CrossFacade;

$payload = [
        'system' => 'crm',
        'repository' => 'customer',
        'condition' => '{"filter":{"id_number_eq":"27743336"},"per_page":"0"}'
];
$result = CrossFacade::fetch(new CrossDataDto(...$payload));

```

3. Call Process API

`code`

- use service

```
use Jsadways\DataApi\Core\Services\Cross\Dtos\CrossProcessDto;
use Jsadways\DataApi\Services\Cross\CrossService;

$payload = [
        'system' => 'crm',
        'token' => 'Bearer XXXXXXXXXXXXXX',
        'api => 'company_verify'
        'payload' => [
             'id_number' => '27743336',
             'name' => '傑思愛德威媒體股份有限公司'
        ]
];
$result = (new CrossService())->fetch(new CrossProcessDto(...$payload));

```

4. Use Command to list all system service api

`code`

- php artisan

```
php artisan data-api:list

```

- response

```
+-----+
| CRM |
+-----+
+--------+--------------------------------+------------+---------+--------+----------+--------------------------------------------------------------------------+
| Method | URI                            | Parameters |         |        |          |                                                                          |
+--------+--------------------------------+------------+---------+--------+----------+--------------------------------------------------------------------------+
| POST   | api/process_api/company_verify |            | Name    | Type   | Required | Description                                                              |
|        |                                | 0          | title   | string | 1        | 標題                                                                      |
|        |                                | 1          | content | string | 1        | 內容文字內容文字內容文字內容文字內容文字內容文字                                 |
+--------+--------------------------------+------------+---------+--------+----------+--------------------------------------------------------------------------+

```

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance58

Moderate activity, may be stable

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.8% 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.

###  Release Activity

Cadence

Every ~9 days

Total

35

Last Release

272d ago

Major Versions

0.0.5 → 1.0.02024-12-06

### Community

Maintainers

![](https://www.gravatar.com/avatar/1a2da5558a0ae5dd3db858692625743a90f0ddfeb11af514ea66da48d7dfd0e8?d=identicon)[JsAdways](/maintainers/JsAdways)

---

Top Contributors

[![alvin-js](https://avatars.githubusercontent.com/u/59727853?v=4)](https://github.com/alvin-js "alvin-js (45 commits)")[![ottosak](https://avatars.githubusercontent.com/u/150006407?v=4)](https://github.com/ottosak "ottosak (4 commits)")

### Embed Badge

![Health badge](/badges/jsadways-data-api/health.svg)

```
[![Health](https://phpackages.com/badges/jsadways-data-api/health.svg)](https://phpackages.com/packages/jsadways-data-api)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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