|
| 1 | +# dismoi/api-client |
| 2 | + |
| 3 | +OpenAPI documentation and _sandbox_ for **DisMoi** (_Tell Me_ in french), |
| 4 | +a FLOSS web annotations project to turn the tide of the opinion wars back in favor of the internauts. |
| 5 | + |
| 6 | +- [Official Website](https://www.dismoi.io/) |
| 7 | +- [Source Code](https://github.com/dis-moi) |
| 8 | +- [Report Issues](https://github.com/dis-moi/backend/issues) (_please!_) |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | +## Installation & Usage |
| 13 | + |
| 14 | +### Requirements |
| 15 | + |
| 16 | +PHP 7.3 and later. |
| 17 | +Should also work with PHP 8.0 but has not been tested. |
| 18 | + |
| 19 | +### Composer |
| 20 | + |
| 21 | +To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`: |
| 22 | + |
| 23 | +```json |
| 24 | +{ |
| 25 | + "repositories": [ |
| 26 | + { |
| 27 | + "type": "vcs", |
| 28 | + "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git" |
| 29 | + } |
| 30 | + ], |
| 31 | + "require": { |
| 32 | + "GIT_USER_ID/GIT_REPO_ID": "*@dev" |
| 33 | + } |
| 34 | +} |
| 35 | +``` |
| 36 | + |
| 37 | +Then run `composer install` |
| 38 | + |
| 39 | +### Manual Installation |
| 40 | + |
| 41 | +Download the files and include `autoload.php`: |
| 42 | + |
| 43 | +```php |
| 44 | +<?php |
| 45 | +require_once('/path/to/dismoi/api-client/vendor/autoload.php'); |
| 46 | +``` |
| 47 | + |
| 48 | +## Getting Started |
| 49 | + |
| 50 | +Please follow the [installation procedure](#installation--usage) and then run the following: |
| 51 | + |
| 52 | +```php |
| 53 | +<?php |
| 54 | +require_once(__DIR__ . '/vendor/autoload.php'); |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | +// Configure API key authorization: apiKey |
| 59 | +$config = DisMoi\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); |
| 60 | +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
| 61 | +// $config = DisMoi\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); |
| 62 | + |
| 63 | + |
| 64 | +$apiInstance = new DisMoi\Client\Api\AuthenticationApi( |
| 65 | + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. |
| 66 | + // This is optional, `GuzzleHttp\Client` will be used as default. |
| 67 | + new GuzzleHttp\Client(), |
| 68 | + $config |
| 69 | +); |
| 70 | +$credentials = new \DisMoi\Client\Model\Credentials(); // \DisMoi\Client\Model\Credentials | Generate a new Json Web Token (JWT) |
| 71 | + |
| 72 | +try { |
| 73 | + $result = $apiInstance->postCredentialsItem($credentials); |
| 74 | + print_r($result); |
| 75 | +} catch (Exception $e) { |
| 76 | + echo 'Exception when calling AuthenticationApi->postCredentialsItem: ', $e->getMessage(), PHP_EOL; |
| 77 | +} |
| 78 | + |
| 79 | +``` |
| 80 | + |
| 81 | +## API Endpoints |
| 82 | + |
| 83 | +All URIs are relative to *http://localhost* |
| 84 | + |
| 85 | +Class | Method | HTTP request | Description |
| 86 | +------------ | ------------- | ------------- | ------------- |
| 87 | +*AuthenticationApi* | [**postCredentialsItem**](docs/Api/AuthenticationApi.md#postcredentialsitem) | **POST** /api/v4/_jwt | Returns an authentication token (JWT) from login credentials. |
| 88 | +*ContributorApi* | [**getContributorItem**](docs/Api/ContributorApi.md#getcontributoritem) | **GET** /v4/contributors/{id} | Retrieves a Contributor resource. |
| 89 | +*MatchingContextApi* | [**apiNoticesMatchingContextsGetSubresourceNoticeSubresource**](docs/Api/MatchingContextApi.md#apinoticesmatchingcontextsgetsubresourcenoticesubresource) | **GET** /v4/notices/{id}/matching_contexts | Retrieves a Notice resource. |
| 90 | +*MatchingContextApi* | [**getMatchingContextCollection**](docs/Api/MatchingContextApi.md#getmatchingcontextcollection) | **GET** /v4/matching_contexts | Retrieves the collection of MatchingContext resources. |
| 91 | +*MatchingContextApi* | [**getMatchingContextItem**](docs/Api/MatchingContextApi.md#getmatchingcontextitem) | **GET** /v4/matching_contexts/{id} | Retrieves a MatchingContext resource. |
| 92 | +*MatchingContextApi* | [**postMatchingContextCollection**](docs/Api/MatchingContextApi.md#postmatchingcontextcollection) | **POST** /v4/matching_contexts | Creates a MatchingContext resource. |
| 93 | +*NoticeApi* | [**apiNoticesMatchingContextsGetSubresourceNoticeSubresource**](docs/Api/NoticeApi.md#apinoticesmatchingcontextsgetsubresourcenoticesubresource) | **GET** /v4/notices/{id}/matching_contexts | Retrieves a Notice resource. |
| 94 | +*NoticeApi* | [**deleteNoticeItem**](docs/Api/NoticeApi.md#deletenoticeitem) | **DELETE** /v4/notices/{id} | Removes the Notice resource. |
| 95 | +*NoticeApi* | [**getNoticeCollection**](docs/Api/NoticeApi.md#getnoticecollection) | **GET** /v4/notices | Retrieves the collection of Notice resources. |
| 96 | +*NoticeApi* | [**getNoticeItem**](docs/Api/NoticeApi.md#getnoticeitem) | **GET** /v4/notices/{id} | Retrieves a Notice resource. |
| 97 | +*NoticeApi* | [**postNoticeCollection**](docs/Api/NoticeApi.md#postnoticecollection) | **POST** /v4/notices | Creates a Notice resource. |
| 98 | + |
| 99 | +## Models |
| 100 | + |
| 101 | +- [ContributorJsonldRead](docs/Model/ContributorJsonldRead.md) |
| 102 | +- [Credentials](docs/Model/Credentials.md) |
| 103 | +- [InlineResponse200](docs/Model/InlineResponse200.md) |
| 104 | +- [InlineResponse2001](docs/Model/InlineResponse2001.md) |
| 105 | +- [InlineResponse200HydraSearch](docs/Model/InlineResponse200HydraSearch.md) |
| 106 | +- [InlineResponse200HydraSearchHydraMapping](docs/Model/InlineResponse200HydraSearchHydraMapping.md) |
| 107 | +- [InlineResponse200HydraView](docs/Model/InlineResponse200HydraView.md) |
| 108 | +- [MatchingContextCreate](docs/Model/MatchingContextCreate.md) |
| 109 | +- [MatchingContextJsonldCreate](docs/Model/MatchingContextJsonldCreate.md) |
| 110 | +- [MatchingContextJsonldRead](docs/Model/MatchingContextJsonldRead.md) |
| 111 | +- [MatchingContextRead](docs/Model/MatchingContextRead.md) |
| 112 | +- [NoticeCreate](docs/Model/NoticeCreate.md) |
| 113 | +- [NoticeJsonldCreate](docs/Model/NoticeJsonldCreate.md) |
| 114 | +- [NoticeJsonldRead](docs/Model/NoticeJsonldRead.md) |
| 115 | +- [NoticeRead](docs/Model/NoticeRead.md) |
| 116 | +- [Token](docs/Model/Token.md) |
| 117 | + |
| 118 | +## Authorization |
| 119 | + |
| 120 | +### apiKey |
| 121 | + |
| 122 | +- **Type**: API key |
| 123 | +- **API key parameter name**: Authorization |
| 124 | +- **Location**: HTTP header |
| 125 | + |
| 126 | + |
| 127 | +## Tests |
| 128 | + |
| 129 | +To run the tests, use: |
| 130 | + |
| 131 | +```bash |
| 132 | +composer install |
| 133 | +vendor/bin/phpunit |
| 134 | +``` |
| 135 | + |
| 136 | +## Author |
| 137 | + |
| 138 | + |
| 139 | + |
| 140 | +## About this package |
| 141 | + |
| 142 | +This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: |
| 143 | + |
| 144 | +- API version: `4.0.0` |
| 145 | + - Package version: `0.0.1` |
| 146 | +- Build package: `io.dismoi.codegen.PhpClientCodegen` |
0 commit comments