Download the PHP package xzsoftware/wykopsdk without Composer
On this page you can find all versions of the php package xzsoftware/wykopsdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package wykopsdk
WykopSDK - Software Development Kit for Wykop API v2
WykopSDK is a PHP Software Development Kit for Wykop, makes it easy to develop PHP apps for Wykop.
- Simple class to handle requests with reasonable groups.
- Handle all the magic for you.
- Fully object oriented!
- Throws exceptions on issues.
- Abstracts away the API, allowing you to write proper application code.
Installing
The recommended way to install is through Composer.
Next, run the Composer command to install the latest stable version:
After installing, you need to require Composer's autoloader:
You can then later update wykopSDK using composer:
Usage
Starting point is allways to create new SDK instance. It requires yours Wykop App Key and Secret -> you can get them here.
You can also create an new app. Remember to check all needed permissions
Auth
If you want to do anything you need to start from user authentication. First of all user needs to connect via application connect link.
The other option is to access connection via USER_APP_KEY, that user needs to pass from his settings so this is more 'closed' option for power users
Usage
Any endpoint group you can see on docs is handled by specific sdk group, represented in table below:
Group | Handles |
---|---|
$sdk->addLink() | AddLink |
$sdk->auth() | Authentication |
$sdk->entries() | Entries |
$sdk->hits() | Hits |
$sdk->links() | Links |
$sdk->myWykop() | MyWykop |
$sdk->notifications() | Notifications |
$sdk->privateMessages() | PM |
$sdk->profiles() | Profiles |
$sdk->search() | Search |
$sdk->settings() | Settings |
$sdk->suggest() | Suggest |
$sdk->tags() | Tags |
Group can have sub group of endpoint handling specific stuff i.e. $sdk->links()->related()
Endpoint methods usualy accept specific request object as parameter that is needed to handle api call.
Few endpoints break that rule accepting one of few objects extending specific abstract (voting),
or accept simple value like string or int (when no other param is possible and that one is mandatory).
All request objects can accept needed params via constructor. Non mandatory params can be modified via setters. i.e
IMPORTANT
Each request object has public methods:
There is no need to set these two params. SDK client will handle it for you!