PHP 7.3 and later. Should also work with PHP 8.0 but has not been tested.
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
Download the files and include autoload.php
:
<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
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;
}
All URIs are relative to http://localhost/if/write
Class | Method | HTTP request | Description |
---|---|---|---|
PrismicItemsApi | pushItems | POST /{custom-field} | Push Items into prismic. |
All endpoints do not require authorization.
To run the tests, use:
composer install
vendor/bin/phpunit
- API version:
1.0.7