1 | <?php |
||
27 | class Pinterest extends AbstractService |
||
28 | { |
||
29 | /** |
||
30 | * Defined scopes - More scopes are listed here: |
||
31 | * https://developers.pinterest.com/docs/api/overview/ |
||
32 | */ |
||
33 | const SCOPE_READ_PUBLIC = 'read_public'; // read a user’s Pins, boards and likes |
||
34 | const SCOPE_WRITE_PUBLIC = 'write_public'; // write Pins, boards, likes |
||
35 | const SCOPE_READ_RELATIONSHIPS = 'read_relationships'; // read a user’s follows (boards, users, interests) |
||
36 | const SCOPE_WRITE_RELATIONSHIPS = 'write_relationships'; // follow boards, users and interests |
||
37 | |||
38 | public function __construct( |
||
39 | CredentialsInterface $credentials, |
||
40 | ClientInterface $httpClient, |
||
41 | TokenStorageInterface $storage, |
||
42 | $scopes = array(), |
||
43 | UriInterface $baseApiUri = null |
||
44 | ) { |
||
45 | parent::__construct( |
||
46 | $credentials, |
||
47 | $httpClient, |
||
48 | $storage, |
||
49 | $scopes, |
||
50 | $baseApiUri, |
||
51 | true |
||
52 | ); |
||
53 | |||
54 | if (null === $baseApiUri) { |
||
55 | $this->baseApiUri = new Uri('https://api.pinterest.com/'); |
||
56 | } |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | public function getAuthorizationEndpoint() |
||
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | public function getAccessTokenEndpoint() |
||
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | */ |
||
78 | protected function getAuthorizationMethod() |
||
82 | |||
83 | /** |
||
84 | * {@inheritdoc} |
||
85 | */ |
||
86 | protected function parseAccessTokenResponse($responseBody) |
||
117 | } |
||
118 |