Пример #1
0
<?php

/**
 * @file
 * Example: GET Section
 */
require '../../src/PublisherAPI.php';
use ChapterThree\AppleNewsAPI;
$api_key_id = "";
$api_key_secret = "";
$endpoint = "https://endpoint_url";
$PublisherAPI = new PublisherAPI($api_key_id, $api_key_secret, $endpoint);
// Fetches information about a single section.
$response = $PublisherAPI->Get('/sections/{section_id}', ['section_id' => '[SECTION_ID]']);
Пример #2
0
<?php

/**
 * @file
 * Example: GET Channel
 */
require '../../src/PublisherAPI.php';
use ChapterThree\AppleNewsAPI;
$api_key_id = "";
$api_key_secret = "";
$endpoint = "https://endpoint_url";
$PublisherAPI = new PublisherAPI($api_key_id, $api_key_secret, $endpoint);
// Fetches information about a channel.
$response = $PublisherAPI->Get('/channels/{channel_id}', ['channel_id' => '[CHANNEL_ID]']);
Пример #3
0
<?php

/**
 * @file
 * Example: Get article
 */
require '../../src/PublisherAPI.php';
use ChapterThree\AppleNewsAPI;
$api_key_id = "";
$api_key_secret = "";
$endpoint = "https://endpoint_url";
$PublisherAPI = new PublisherAPI($api_key_id, $api_key_secret, $endpoint);
// Fetches an article.
$response = $PublisherAPI->Get('/articles/{article_id}', ['article_id' => '[ARTICLE_ID]']);