Skip to content

Latest commit

 

History

History
131 lines (92 loc) · 3.02 KB

TypesApi.md

File metadata and controls

131 lines (92 loc) · 3.02 KB

Sportmonks\TypesApi

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()

all($version): \Sportmonks\Model\TypesAllResponse

All

Example

<?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;
}

Parameters

Name Type Description Notes
version string The version of the API. [optional]

Return type

\Sportmonks\Model\TypesAllResponse

Authorization

apikeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getById()

getById($type_id, $version): \Sportmonks\Model\TypesGetByIdResponse

By ID

Example

<?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;
}

Parameters

Name Type Description Notes
type_id int The ID of the type you want to retrieve
version string The version of the API. [optional]

Return type

\Sportmonks\Model\TypesGetByIdResponse

Authorization

apikeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]