diff --git a/Changelog b/Changelog index 4f49093f2..870790fd7 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2018-06-04 DariusIII + * Chg: Add API V2 help page * Chg: Complete v2 api, add related transformers and routes * Chg: Update phpunit, whoops and php-parser packages * Fix: Fix links in XML diff --git a/app/Http/Controllers/ApiHelpController.php b/app/Http/Controllers/ApiHelpController.php index 15f669eec..620cab182 100644 --- a/app/Http/Controllers/ApiHelpController.php +++ b/app/Http/Controllers/ApiHelpController.php @@ -34,4 +34,28 @@ class ApiHelpController extends BasePageController ); $this->pagerender(); } + + /** + * @throws \Exception + */ + public function apiv2() + { + $this->setPrefs(); + $title = 'Api V2 Help'; + $meta_title = 'Api V2 Help Topics'; + $meta_keywords = 'view,nzb,api,details,help,json,rss,atom'; + $meta_description = 'View description of the site Nzb version 2 Api.'; + + $content = $this->smarty->fetch('apiv2desc.tpl'); + $this->smarty->assign( + [ + 'content' => $content, + 'title' => $title, + 'meta_title' => $meta_title, + 'meta_keywords' => $meta_keywords, + 'meta_description' => $meta_description, + ] + ); + $this->pagerender(); + } } diff --git a/resources/views/themes/Gentele/basepage.tpl b/resources/views/themes/Gentele/basepage.tpl index 7a4c1c088..98722098d 100755 --- a/resources/views/themes/Gentele/basepage.tpl +++ b/resources/views/themes/Gentele/basepage.tpl @@ -116,6 +116,8 @@ Feeds
  • API
  • +
  • + API V2
  • +

    {$title}

    +

    Here lives the documentation for the api v2 for accessing nzb and index data. Api functions can be called by providing an api token.

    +
    + {if $loggedin=="true"} +

    API Credentials

    +

    Your credentials should be provided as &api_token={$userdata.api_token} +

    + {/if} +
    +

    Available Functions

    +
    +
    Capabilities capabilities
    +
    Reports the capabilities of the server. Includes information about the server name, available search + categories and version number of the nntmux being used.
    Capabilities do not require any + credentials in order to be retrieved. +
    +
    +
    Search search&id=linux +
    +
    Returns a list of nzbs matching a query. You can also filter by site category by including a comma separated + list of categories as follows search&cat={$catClass::GAME_ROOT} + ,{$catClass::MOVIE_ROOT}. Include &extended=1 to return extended information in the search + results. +
    +
    +
    TV ?t=tvsearch&q=law and order&season=7&ep=12 +
    +
    Returns a list of nzbs matching a query, category, tvrageid, season or episode. + You can also filter by site category by including a comma separated list of categories as follows: + ?t=tvsearch&cat={$catClass::GAME_ROOT} + ,{$catClass::MOVIE_ROOT}. + Include &extended=1 to return extended information in the + search results. +
    +
    + You can also supply the following parameters to do site specfic ID searches: + &rid=25056 (TVRage) &tvdbid=153021 (TVDB) &traktid=1393 (Trakt) &tvmazeid=73 (TVMaze) &imdbid=1520211 + (IMDB) &tmdbid=1402 (TMDB). +
    +
    +
    Movies ?t=movie&imdbid=1418646 +
    +
    Returns a list of nzbs matching a query, an imdbid and optionally a category. Filter by + site category by including a comma separated list of categories as follows ?t=movie&imdbid=1418646&cat={$catClass::MOVIE_SD} + ,{$catClass::MOVIE_HD}. Include &extended=1 + to return extended information in the search results. +
    +
    +
    Details details&id=9ca52909ba9b9e5e6758d815fef4ecda +
    +
    Returns detailed information about an nzb.
    +
    +
    Get getnzb&id=9ca52909ba9b9e5e6758d815fef4ecda +
    +
    Downloads the nzb file associated with an Id.
    +
    +
    +

    Output Format

    +

    All information is returned in JSON format

    + diff --git a/routes/web.php b/routes/web.php index 023a36576..de0c82962 100644 --- a/routes/web.php +++ b/routes/web.php @@ -66,6 +66,7 @@ Route::post('rss', 'RssController@rss'); Route::get('profile', 'ProfileController@show'); Route::get('apihelp', 'ApiHelpController@index'); +Route::get('apiv2help', 'ApiHelpController@apiv2'); Route::get('logout', 'Auth\LoginController@logout')->name('logout');