All Projects → eosnewmedia → JSON-API-Client

eosnewmedia / JSON-API-Client

Licence: MIT license
Abstract client-side php implementation of the json api specification (jsonapi.org)

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to JSON-API-Client

go-json-spec-handler
Simple JSON API Spec Compatibility in Golang
Stars: ✭ 41 (+141.18%)
Mutual labels:  json-api, api-client
Kitsu
🦊 A simple, lightweight & framework agnostic JSON:API client
Stars: ✭ 166 (+876.47%)
Mutual labels:  json-api, api-client
RESTEasy
REST API calls made easier
Stars: ✭ 12 (-29.41%)
Mutual labels:  json-api, api-client
DummyJSON
DummyJSON provides different types of REST Endpoints filled with JSON data which you can use in developing the frontend with your favorite framework and library without worrying about writing a backend.
Stars: ✭ 213 (+1152.94%)
Mutual labels:  json-api, api-client
WikidataR
An R package for the Wikidata API
Stars: ✭ 49 (+188.24%)
Mutual labels:  api-client
drowsy
😪 Lazy integrations tool for RESTful interfaces to aid POC development and streamline integrations
Stars: ✭ 19 (+11.76%)
Mutual labels:  api-client
rippled-php
A PHP library for rippled (XRP Ledger) communication.
Stars: ✭ 33 (+94.12%)
Mutual labels:  api-client
insomnia-workspace
An Insomnia Workspace for Alpaca API
Stars: ✭ 34 (+100%)
Mutual labels:  api-client
php-json-api
JSON API transformer outputting valid (PSR-7) API Responses.
Stars: ✭ 68 (+300%)
Mutual labels:  json-api
pinboard.net
Fully featured API wrapper for pinboard.in
Stars: ✭ 21 (+23.53%)
Mutual labels:  api-client
QuranJSON
Simplified Perfect Complete Quran JSON (Indonesia Translation, Tafsir, and Audio) with API
Stars: ✭ 83 (+388.24%)
Mutual labels:  json-api
rdfp
This R package connects the DoubleClick for Publishers API from R
Stars: ✭ 16 (-5.88%)
Mutual labels:  api-client
drf-json-schema
Extensible JSON API schema for Django Rest Framework
Stars: ✭ 15 (-11.76%)
Mutual labels:  json-api
binance-client-websocket
🛠️ C# client for Binance websocket API
Stars: ✭ 41 (+141.18%)
Mutual labels:  api-client
strava
PHP Class for the Strava API (v3)
Stars: ✭ 117 (+588.24%)
Mutual labels:  api-client
monzo-php
PHP Library for use with https://monzo.com
Stars: ✭ 20 (+17.65%)
Mutual labels:  api-client
noire-server
Hapi Boilerplate
Stars: ✭ 20 (+17.65%)
Mutual labels:  api-client
php-abraflexi
PHP Based Library for easy interaction with czech accounting system FlexiBee.
Stars: ✭ 15 (-11.76%)
Mutual labels:  api-client
bolaget.io
RESTful(ish) JSON API for Swedish alcohol monopoly, Systembolaget. Running on preemptibles on k8s! 🚀✨🍺
Stars: ✭ 27 (+58.82%)
Mutual labels:  json-api
sia-cog
Various cognitive api for machine learning, vision, language intent alalysis. Covers traditional as well as deep learning model design and training.
Stars: ✭ 34 (+100%)
Mutual labels:  api-client

JSON API Client

Build Status

Abstract client-side PHP implementation of the json api specification.

Installation

composer require enm/json-api-client

It's recommended to install kriswallsmith/buzz as http-client and nyholm/psr7 for http factories.

composer require kriswallsmith/buzz nyholm/psr7

You can also use any HTTP client which implements PSR-18.

Usage

First you should read the docs at enm/json-api-common where all basic structures are defined.

Your API client is an instance of Enm\JsonApi\Client\JsonApiClient, which requires a PSR-18 HTTP client (Psr\Http\Client\ClientInterface) to execute requests.

$client = new JsonApiClient(
    'http://example.com/api',
    $httpClient, // instance of Psr\Http\Client\ClientInterface
    $uriFactory, // instance of Psr\Http\Message\UriFactoryInterface
    $requestFactory, // instance of Psr\Http\Message\RequestFactoryInterface
    $streamFactory, // instance of Psr\Http\Message\StreamFactoryInterface
    new Serializer(),
    new Deserializer()
);

$request = $client->createGetRequest(new Uri('/myResources/1')); // will fetch the resource at http://example.com/api/myResources/1
$request->requestInclude('myRelationship'); // include a relationship

$response = $client->execute($request);

$document = $response->document();
$myResource = $document->data()->first(); // the resource fetched by this request
$myIncludedResources = $document->included()->all(); // the included resources fetched with the include parameter
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].