nassaz / ods_api_client
dev-master
2020-04-02 15:56 UTC
Requires
- php: >=5.5
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ~2.12
- phpunit/phpunit: ^4.8
- squizlabs/php_codesniffer: ~2.6
This package is auto-updated.
Last update: 2025-05-29 01:33:29 UTC
README
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
This PHP package is automatically generated by the Swagger Codegen project:
- API version: 2.1.0
- Package version: 1.0.0
- Build package: io.swagger.codegen.languages.PhpClientCodegen
Requirements
PHP 5.5 and later
Installation & Usage
Composer
To install the bindings via Composer, add the following to composer.json
:
{
"repositories": [
{
"type": "git",
"url": "https://github.com/ods/ods_api_client.git"
}
],
"require": {
"ods/ods_api_client": "*@dev"
}
}
Then run composer install
Manual Installation
Download the files and include autoload.php
:
require_once('/path/to/SwaggerClient-php/vendor/autoload.php');
Tests
To run the unit tests:
composer install
./vendor/bin/phpunit
Getting Started
Please follow the installation procedure and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api_key $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('apikey', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apikey', 'Bearer'); // Configure HTTP basic authorization: basic $config = Swagger\Client\Configuration::getDefaultConfiguration() ->setUsername('YOUR_USERNAME') ->setPassword('YOUR_PASSWORD'); $apiInstance = new Swagger\Client\Api\AggregationsApi( // 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(), $config ); $source = "source_example"; // string | Each source represents a different catalog of datasets you'll be able to query. There are 2 sources available: * catalog: the catalog of datasets on your portal * opendatasoft: Opendatasoft's repository of public datasets, also available at [data.opendatasoft.com](https://data.opendatasoft.com/page/home/) $select = "select_example"; // string | A select expression can be used to add, remove or change fields to return. An expression can be: - a wildcard ('*'): return all fields - a field name: return only this field - an include/exclude function. Include (resp exclude) all field matching include/exclude expression. This expression can contain wildcard. For example: include(spa*) will return all fields begining with 'spa' - a complex expression: return the result of this expression. A label can be set for this expression, in that case, field will be named with this label. For instance: 'size * 2 as bigger_size' will return a new field named bigger_size and containing the double of size field value. $group_by = "group_by_example"; // string | A group by expression defines a grouping function for an aggregation. It can be: - a field name: group result by each value of this field - a range function: group result by range - a date function: group result by date It is possible to specify a custom name with the 'as name' notation. For instance: group_by='city_field as city'. $where = array("where_example"); // string[] | An array of filters. A filter is a text expression performing a simple full-text search that can also include logical operations (NOT, AND, OR...) as well as lots of other functions, thus performing more complex and more precise searches. Read [the query language reference](https://docs.opendatasoft.com/api/explore/v2.html#where-clause) for more details. try { $result = $apiInstance->aggregateDatasets($source, $select, $group_by, $where); print_r($result); } catch (Exception $e) { echo 'Exception when calling AggregationsApi->aggregateDatasets: ', $e->getMessage(), PHP_EOL; } ?>
Documentation for API Endpoints
All URIs are relative to https://public.opendatasoft.com/api/v2
Class | Method | HTTP request | Description |
---|---|---|---|
AggregationsApi | aggregateDatasets | GET /{source}/aggregates | |
AggregationsApi | aggregateRecords | GET /{source}/datasets/{dataset_id}/aggregates | |
CatalogApi | aggregateDatasets | GET /{source}/aggregates | |
CatalogApi | getDatasets | GET /{source}/datasets | |
CatalogApi | getDatasetsFacets | GET /{source}/facets | |
CatalogApi | getSource | GET /{source} | |
DatasetApi | aggregateRecords | GET /{source}/datasets/{dataset_id}/aggregates | |
DatasetApi | downloadDatasetAttachement | GET /{source}/datasets/{dataset_id}/attachments/{attachment_id} | |
DatasetApi | downloadDatasetSnapshot | GET /{source}/datasets/{dataset_id}/snapshots/{snapshot_id} | |
DatasetApi | getDataset | GET /{source}/datasets/{dataset_id} | |
DatasetApi | getDatasetAttachements | GET /{source}/datasets/{dataset_id}/attachments | |
DatasetApi | getDatasetFile | GET /{source}/datasets/{dataset_id}/files/{file_id} | |
DatasetApi | getDatasetReuse | GET /{source}/datasets/{dataset_id}/reuses/{reuse_id} | |
DatasetApi | getDatasetReuses | GET /{source}/datasets/{dataset_id}/reuses | |
DatasetApi | getDatasetSnapshots | GET /{source}/datasets/{dataset_id}/snapshots | |
DatasetApi | getRecord | GET /{source}/datasets/{dataset_id}/records/{record_id} | |
DatasetApi | getRecords | GET /{source}/datasets/{dataset_id}/records | |
DatasetApi | getRecordsFacets | GET /{source}/datasets/{dataset_id}/facets | |
DatasetApi | sendDatasetFeedback | PUT /{source}/datasets/{dataset_id}/feedback | |
ExportCatalogApi | exportDatasetsCSV | GET /{source}/exports/csv | |
ExportCatalogApi | exportDatasetsJson | GET /{source}/exports/json | |
ExportCatalogApi | exportDatasetsRDF | GET /{source}/exports/rdf | |
ExportCatalogApi | exportDatasetsRSS | GET /{source}/exports/rss | |
ExportCatalogApi | exportDatasetsTTL | GET /{source}/exports/ttl | |
ExportCatalogApi | exportDatasetsXLS | GET /{source}/exports/xls | |
ExportDatasetApi | exportRecordsCSV | GET /{source}/datasets/{dataset_id}/exports/csv | |
ExportDatasetApi | exportRecordsGEOJSON | GET /{source}/datasets/{dataset_id}/exports/geojson | |
ExportDatasetApi | exportRecordsICAL | GET /{source}/datasets/{dataset_id}/exports/ical | |
ExportDatasetApi | exportRecordsJSON | GET /{source}/datasets/{dataset_id}/exports/json | |
ExportDatasetApi | exportRecordsOV2 | GET /{source}/datasets/{dataset_id}/exports/ov2 | |
ExportDatasetApi | exportRecordsSHP | GET /{source}/datasets/{dataset_id}/exports/shp | |
ExportDatasetApi | exportRecordsXLS | GET /{source}/datasets/{dataset_id}/exports/xls | |
FacetApi | getDatasetsFacets | GET /{source}/facets | |
FacetApi | getRecordsFacets | GET /{source}/datasets/{dataset_id}/facets | |
MetadataApi | getMetadataTemplate | GET /{source}/metadata_templates/{metadata_template_type}/{metadata_template_name} | |
MetadataApi | getMetadataTemplatesType | GET /{source}/metadata_templates/{metadata_template_type} | |
MetadataApi | getMetadataTemplatesTypes | GET /{source}/metadata_templates | |
OdsApi | aggregateDatasets | GET /{source}/aggregates | |
OdsApi | aggregateRecords | GET /{source}/datasets/{dataset_id}/aggregates | |
OdsApi | downloadDatasetAttachement | GET /{source}/datasets/{dataset_id}/attachments/{attachment_id} | |
OdsApi | downloadDatasetSnapshot | GET /{source}/datasets/{dataset_id}/snapshots/{snapshot_id} | |
OdsApi | exportDatasetsCSV | GET /{source}/exports/csv | |
OdsApi | exportDatasetsJson | GET /{source}/exports/json | |
OdsApi | exportDatasetsRDF | GET /{source}/exports/rdf | |
OdsApi | exportDatasetsRSS | GET /{source}/exports/rss | |
OdsApi | exportDatasetsTTL | GET /{source}/exports/ttl | |
OdsApi | exportDatasetsXLS | GET /{source}/exports/xls | |
OdsApi | exportRecordsCSV | GET /{source}/datasets/{dataset_id}/exports/csv | |
OdsApi | exportRecordsGEOJSON | GET /{source}/datasets/{dataset_id}/exports/geojson | |
OdsApi | exportRecordsICAL | GET /{source}/datasets/{dataset_id}/exports/ical | |
OdsApi | exportRecordsJSON | GET /{source}/datasets/{dataset_id}/exports/json | |
OdsApi | exportRecordsOV2 | GET /{source}/datasets/{dataset_id}/exports/ov2 | |
OdsApi | exportRecordsSHP | GET /{source}/datasets/{dataset_id}/exports/shp | |
OdsApi | exportRecordsXLS | GET /{source}/datasets/{dataset_id}/exports/xls | |
OdsApi | getDataset | GET /{source}/datasets/{dataset_id} | |
OdsApi | getDatasetAttachements | GET /{source}/datasets/{dataset_id}/attachments | |
OdsApi | getDatasetFile | GET /{source}/datasets/{dataset_id}/files/{file_id} | |
OdsApi | getDatasetReuse | GET /{source}/datasets/{dataset_id}/reuses/{reuse_id} | |
OdsApi | getDatasetReuses | GET /{source}/datasets/{dataset_id}/reuses | |
OdsApi | getDatasetSnapshots | GET /{source}/datasets/{dataset_id}/snapshots | |
OdsApi | getDatasets | GET /{source}/datasets | |
OdsApi | getDatasetsFacets | GET /{source}/facets | |
OdsApi | getMetadataTemplate | GET /{source}/metadata_templates/{metadata_template_type}/{metadata_template_name} | |
OdsApi | getMetadataTemplatesType | GET /{source}/metadata_templates/{metadata_template_type} | |
OdsApi | getMetadataTemplatesTypes | GET /{source}/metadata_templates | |
OdsApi | getPage | GET /pages/{slug} | |
OdsApi | getPages | GET /pages | |
OdsApi | getRecord | GET /{source}/datasets/{dataset_id}/records/{record_id} | |
OdsApi | getRecords | GET /{source}/datasets/{dataset_id}/records | |
OdsApi | getRecordsFacets | GET /{source}/datasets/{dataset_id}/facets | |
OdsApi | getRoot | GET / | |
OdsApi | getSource | GET /{source} | |
OdsApi | sendDatasetFeedback | PUT /{source}/datasets/{dataset_id}/feedback | |
PageApi | getPage | GET /pages/{slug} | |
PageApi | getPages | GET /pages | |
RootApi | getRoot | GET / |
Documentation For Models
- Aggregation
- Attachment
- Dataset
- DatasetFields
- Datasets
- FacetEnumeration
- FacetValueEnumeration
- Feedback
- InlineResponse200
- InlineResponse2001
- Link
- Links
- MetadataTemplate
- Page
- PageTitle
- QueryString
- Record
- Records
- Reuse
- ReuseUser
- Snapshot
- Timezone
Documentation For Authorization
api_key
- Type: API key
- API key parameter name: apikey
- Location: URL query string
basic
- Type: HTTP basic authentication