PHP code example of schibsted-tech-polska / php-sndapi

1. Go to this page and download the library: Download schibsted-tech-polska/php-sndapi library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

schibsted-tech-polska / php-sndapi example snippets




use Stp\SndApi\News\Client as NewsClient;

const API_KEY = 'mnbvcxzlkjhgfdsapoiuytrew';
const API_SECRET = 'qwertyuiopasdfghjklzxcvbn';
const PUBLICATION_ID = 'sa';

$newsClient = new NewsClient(API_KEY, API_SECRET, PUBLICATION_ID);



$newsClient->getServiceDocument();



$newsClient->getSectionsList();



$newsClient->getSubsectionsList(217);



$newsClient->getSectionByUniqueName('nyheter');



$newsClient->getSectionById(217);



$newsClient->getArticlesBySectionId(
	217, 
	'desked', 
	[
		'limit' => 50
	]
);



$newsClient->getArticle(3687148);



$newsClient->searchByInstance(3687148, 'article');



$newsClient->searchByInstance([123456, 789012]);
sh
composer