PHPackages                             schibsted-tech-polska/php-sndapi - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. schibsted-tech-polska/php-sndapi

AbandonedArchivedLibrary[API Development](/categories/api)

schibsted-tech-polska/php-sndapi
================================

SND API v2 client

1.0.0(9y ago)12.7k2[1 issues](https://github.com/Schibsted-Tech-Polska/php-sndapi/issues)MITPHPPHP &gt;=5.5.0

Since May 6Pushed 9y ago15 watchersCompare

[ Source](https://github.com/Schibsted-Tech-Polska/php-sndapi)[ Packagist](https://packagist.org/packages/schibsted-tech-polska/php-sndapi)[ Docs](https://github.com/Schibsted-Tech-Polska/php-sndapi)[ RSS](/packages/schibsted-tech-polska-php-sndapi/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (9)Versions (9)Used By (0)

SND API Client
==============

[](#snd-api-client)

[![Build Status](https://camo.githubusercontent.com/d6de3b84ba86385e593fedf19edd57199aa57bb7ed23ef29cac02d790e0e1136/68747470733a2f2f7472617669732d63692e6f72672f5363686962737465642d546563682d506f6c736b612f7068702d736e646170692e737667)](https://travis-ci.org/Schibsted-Tech-Polska/php-sndapi)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/76402e222b556e564fd370b3a2173f4d5ccb5bbe382e18ea58fbdd6943cb5854/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f5363686962737465642d546563682d506f6c736b612f7068702d736e646170692f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Schibsted-Tech-Polska/php-sndapi/?branch=master)

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:

```
bin/sndapi-console
```

Console usage requires three parameters:

```
Options:
 --key (-s)            SND API key
 --secret (-s)         SND API secret
 --publicationId (-p)  SND API publication id (common, sa, fvn, bt, ap)
```

Requirements
------------

[](#requirements)

- php &gt;= 5.5
- composer
- node &amp; npm

Installation
------------

[](#installation)

In order to add the library to your project just run:

```
composer require "Schibsted-Tech-Polska/php-sndapi"
```

Development
-----------

[](#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
----

[](#news)

The library uses v2 snd news api described [here](http://developers.snd.no/doc/news/). Authentication requires valid API secret, every API method also requires publicationId. Publication ID is one of the following:

- common
- ap
- bt
- fvn
- sa

### Usage

[](#usage)

Initialize the library with

```
