Download the PHP package schibsted-tech-polska/php-sndapi without Composer
On this page you can find all versions of the php package schibsted-tech-polska/php-sndapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download schibsted-tech-polska/php-sndapi
More information about schibsted-tech-polska/php-sndapi
Files in schibsted-tech-polska/php-sndapi
Package php-sndapi
Short Description SND API v2 client
License MIT
Homepage https://github.com/Schibsted-Tech-Polska/php-sndapi
Informations about the package php-sndapi
SND API Client
This is a packagist-friendly SND API client built by Stavanger Aftenblad's team. The API uses application/json content type with UTF-8 charset. Each method returns result of json_decode
run on result. This is not configurable yet, however we plan to introduce entity hydrators (along with entities) in near future.
Client provides console access to the API:
Console usage requires three parameters:
Requirements
- php >= 5.5
- composer
- node & npm
Installation
In order to add the library to your project just run:
Development
Feel free to develop new parts of the library, but have in mind that it's fully tested with PHP Unit and you should use pull requests in order to merge your code.
News
The library uses v2 snd news api described here. Authentication requires valid API secret, every API method also requires publicationId. Publication ID is one of the following:
- common
- ap
- bt
- fvn
- sa
Usage
Initialize the library with
Methods
getServiceDocument
Returns service document.
http://developers.snd.no/doc/news/documentation/publication.
Console:
getImageVersions
$newsClient->getImageVersions(); sh bin/sndapi-console news:image:versions [-s|--secret="..."] [-p|--publicationId="..."]
getSectionsList
Returns sections list.
http://developers.snd.no/doc/news/documentation/section#listsections
Console:
getSubsectionsList
Returns subsections list.
http://developers.snd.no/doc/news/documentation/section#listsections
getSectionByUniqueName
Finds a section using its unique name.
http://developers.snd.no/doc/news/documentation/section#getsection
Console:
getSectionById
Similar to previous one, but finds a section using its id.
http://developers.snd.no/doc/news/documentation/section#getsection
Console:
getArticlesBySectionId
Finds a list of articles using section id or section's unique name.
http://developers.snd.no/doc/news/documentation/article#listarticles
Parameters
Numeric parameters
- areaLimit
- offset
- limit
Boolean values
- includeSubsections
- homeSectionOnly
Console:
getArticle
Retrieves one article, alias to searchByInstance but with article provided as contentType.
http://developers.snd.no/doc/news/documentation/article#getarticle
Console:
searchByInstance
Returns search result of a specified contentId and contentType.
http://developers.snd.no/doc/news/documentation/search#byinstance
Console:
searchByCollection
Returns search results of provided content ids.
http://developers.snd.no/doc/news/documentation/search#bycollection
Console:
Not implemented yet:
searchResource
http://developers.snd.no/doc/news/documentation/search#searchres
searchByTags
http://developers.snd.no/doc/news/documentation/search#bytags
searchByQuery
http://developers.snd.no/doc/news/documentation/search#byquery
All versions of php-sndapi with dependencies
psr/log Version 1.0.*
symfony/console Version ^2.3|^3.0
soapbox/laravel-formatter Version 2.x
guzzlehttp/guzzle Version ^5.0