All URIs are relative to https://api.sportmonks.com, except if the operation defines another base path.
Method | HTTP request | Description |
---|---|---|
all() | GET /{version}/core/types | All |
getById() | GET /{version}/core/types/{typeId} | By ID |
all($version): \Sportmonks\Model\TypesAllResponse
All
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$sportmonks = new \Sportmonks\Client(
version: "v3",
sport: "football",
apiKey: "AUTHORIZATION",
);
$version = "v3"; // The version of the API.
try {
$result = $sportmonks->types->all(
version: $version
);
print_r($result->$getData());
print_r($result->$getPagination());
print_r($result->$getSubscription());
print_r($result->$getRateLimit());
print_r($result->$getTimezone());
} catch (\Exception $e) {
echo 'Exception when calling TypesApi->all: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
version | string | The version of the API. | [optional] |
\Sportmonks\Model\TypesAllResponse
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getById($type_id, $version): \Sportmonks\Model\TypesGetByIdResponse
By ID
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$sportmonks = new \Sportmonks\Client(
version: "v3",
sport: "football",
apiKey: "AUTHORIZATION",
);
$type_id = 1; // The ID of the type you want to retrieve
$version = "v3"; // The version of the API.
try {
$result = $sportmonks->types->getById(
type_id: $type_id,
version: $version
);
print_r($result->$getData());
print_r($result->$getSubscription());
print_r($result->$getRateLimit());
print_r($result->$getTimezone());
} catch (\Exception $e) {
echo 'Exception when calling TypesApi->getById: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
type_id | int | The ID of the type you want to retrieve | |
version | string | The version of the API. | [optional] |
\Sportmonks\Model\TypesGetByIdResponse
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]