bachus03 / prismic-api-client
Prismic
Installs: 2 535
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^7.3 || ^8.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: *
- guzzlehttp/psr7: *
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.12
- phpunit/phpunit: ^8.0 || ^9.0
README
Installation & Usage
Requirements
PHP 7.3 and later. Should also work with PHP 8.0 but has not been tested.
Composer
To install the bindings via Composer, add the following to composer.json
:
{ "repositories": [ { "type": "vcs", "url": "https://github.com/bachus03/prismic-api-client" } ], "require": { "GIT_USER_ID/GIT_REPO_ID": "*@dev" } }
Then run composer install
Manual Installation
Download the files and include autoload.php
:
<?php require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
Getting Started
Please follow the installation procedure and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); $apiInstance = new OpenAPI\Client\Api\PrismicItemsApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); $custom_field = 56; // int | Name of custom field created in prismic $request_body = array(new \stdClass); // object[] try { $result = $apiInstance->pushItems($custom_field, $request_body); print_r($result); } catch (Exception $e) { echo 'Exception when calling PrismicItemsApi->pushItems: ', $e->getMessage(), PHP_EOL; }
API Endpoints
All URIs are relative to http://localhost/if/write
Models
Authorization
All endpoints do not require authorization.
Tests
To run the tests, use:
composer install vendor/bin/phpunit
About this package
- API version:
1.0.7