-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathInstagram.php
57 lines (47 loc) · 1.05 KB
/
Instagram.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
namespace kotchuprik\authclient;
use yii\authclient\OAuth2;
class Instagram extends OAuth2
{
/**
* @inheritdoc
*/
public $authUrl = 'https://api.instagram.com/oauth/authorize';
/**
* @inheritdoc
*/
public $tokenUrl = 'https://api.instagram.com/oauth/access_token';
/**
* @inheritdoc
*/
public $apiBaseUrl = 'https://api.instagram.com/v1';
/**
* @inheritdoc
*/
protected function initUserAttributes()
{
$response = $this->api('users/self', 'GET');
return $response['data'];
}
/**
* @inheritdoc
*/
protected function apiInternal($accessToken, $url, $method, array $params, array $headers)
{
return $this->sendRequest($method, $url . '?access_token=' . $accessToken->getToken(), $params, $headers);
}
/**
* @inheritdoc
*/
protected function defaultName()
{
return 'instagram';
}
/**
* @inheritdoc
*/
protected function defaultTitle()
{
return 'Instagram';
}
}