Skip to content

Commit

Permalink
Add validateAccessToken endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklaw5 committed Apr 26, 2017
1 parent b0b4c01 commit 39a461c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Api/Root.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace TwitchApi\Api;

trait Root
{
/**
* Check if an access token is valid
*
* @param string accessToken
* @return array|json
*/
public function validateAccessToken($accessToken)
{
return $this->get('', [], $accessToken);
}
}
2 changes: 2 additions & 0 deletions src/TwitchApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use TwitchApi\Api\Communities;
use TwitchApi\Api\Games;
use TwitchApi\Api\Ingests;
use TwitchApi\Api\Root;
use TwitchApi\Api\Search;
use TwitchApi\Api\Streams;
use TwitchApi\Api\Teams;
Expand All @@ -33,6 +34,7 @@ class TwitchApi extends TwitchRequest
use Communities;
use Games;
use Ingests;
use Root;
use Search;
use Streams;
use Teams;
Expand Down

0 comments on commit 39a461c

Please sign in to comment.