{"id":19092068,"url":"https://github.com/eosnewmedia/json-api-client","last_synced_at":"2025-10-09T12:39:50.171Z","repository":{"id":56978015,"uuid":"93745195","full_name":"eosnewmedia/JSON-API-Client","owner":"eosnewmedia","description":"Abstract client-side php implementation of the json api specification (jsonapi.org)","archived":false,"fork":false,"pushed_at":"2023-04-21T20:29:43.000Z","size":65,"stargazers_count":18,"open_issues_count":2,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-09-04T03:58:08.640Z","etag":null,"topics":["abstraction","api","api-client","client","json-api","php","php7"],"latest_commit_sha":null,"homepage":"https://eosnewmedia.github.io/JSON-API-Client/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eosnewmedia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-08T12:09:10.000Z","updated_at":"2024-06-06T00:12:09.000Z","dependencies_parsed_at":"2024-06-21T05:55:32.017Z","dependency_job_id":null,"html_url":"https://github.com/eosnewmedia/JSON-API-Client","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/eosnewmedia/JSON-API-Client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eosnewmedia%2FJSON-API-Client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eosnewmedia%2FJSON-API-Client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eosnewmedia%2FJSON-API-Client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eosnewmedia%2FJSON-API-Client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eosnewmedia","download_url":"https://codeload.github.com/eosnewmedia/JSON-API-Client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eosnewmedia%2FJSON-API-Client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001431,"owners_count":26083078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["abstraction","api","api-client","client","json-api","php","php7"],"created_at":"2024-11-09T03:18:00.953Z","updated_at":"2025-10-09T12:39:50.142Z","avatar_url":"https://github.com/eosnewmedia.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"JSON API Client\n===============\n[![Build Status](https://travis-ci.org/eosnewmedia/JSON-API-Client.svg?branch=master)](https://travis-ci.org/eosnewmedia/JSON-API-Client) \n\nAbstract client-side PHP implementation of the [json api specification](http://jsonapi.org/format/).\n\n## Installation\n\n```sh\ncomposer require enm/json-api-client\n```\n\nIt's recommended to install `kriswallsmith/buzz` as http-client and `nyholm/psr7` for http factories.\n\n```sh\ncomposer require kriswallsmith/buzz nyholm/psr7\n```\n\nYou can also use any HTTP client which implements [PSR-18](https://www.php-fig.org/psr/psr-18/).\n\n## Usage\nFirst you should read the docs at [enm/json-api-common](https://eosnewmedia.github.io/JSON-API-Common/) where all basic structures are defined.\n\nYour API client is an instance of `Enm\\JsonApi\\Client\\JsonApiClient`, which requires a PSR-18 HTTP client (`Psr\\Http\\Client\\ClientInterface`) to execute requests.\n\n```php \n\n$client = new JsonApiClient(\n    'http://example.com/api',\n    $httpClient, // instance of Psr\\Http\\Client\\ClientInterface\n    $uriFactory, // instance of Psr\\Http\\Message\\UriFactoryInterface\n    $requestFactory, // instance of Psr\\Http\\Message\\RequestFactoryInterface\n    $streamFactory, // instance of Psr\\Http\\Message\\StreamFactoryInterface\n    new Serializer(),\n    new Deserializer()\n);\n\n$request = $client-\u003ecreateGetRequest(new Uri('/myResources/1')); // will fetch the resource at http://example.com/api/myResources/1\n$request-\u003erequestInclude('myRelationship'); // include a relationship\n\n$response = $client-\u003eexecute($request);\n\n$document = $response-\u003edocument();\n$myResource = $document-\u003edata()-\u003efirst(); // the resource fetched by this request\n$myIncludedResources = $document-\u003eincluded()-\u003eall(); // the included resources fetched with the include parameter\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feosnewmedia%2Fjson-api-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feosnewmedia%2Fjson-api-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feosnewmedia%2Fjson-api-client/lists"}