rails-pinterest 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -1
- data/Gemfile.lock +1 -1
- data/README.md +23 -0
- data/lib/pinterest/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1fc96a443db45b6ac15f51c8152b6e87145b1c6dacb58d5b465b2d8a69f8b82
|
4
|
+
data.tar.gz: 6ea256a6db07492035e6e622f4cb7e5617792ef3963ec7a1e452a9406a7279ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12bad857ab4b1aec512620322dc720c0e04243537279cad50c5be6242208c2aa3a264ef0ac82cbd87892da2f5276a7d7993f501d0fdac397718e0a0a580653a8
|
7
|
+
data.tar.gz: 8c3a3ac50db6366fa37df5d5aacff6d8e556aa6545bbb7350c650ceb7096efa8999869427c7798773b7022cb559183f230167490330d4c6422d473ea2f355db7
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -176,6 +176,29 @@ response = client.pins.create_pin(parameters: parameters)
|
|
176
176
|
|
177
177
|
### Oauth
|
178
178
|
|
179
|
+
How to get exchange your authorization code for an access token [(step 3)](https://developers.pinterest.com/docs/getting-started/authentication/)
|
180
|
+
```ruby
|
181
|
+
# https://developers.pinterest.com/docs/getting-started/authentication/
|
182
|
+
|
183
|
+
# POST /oauth/tokens to exchange authorization code for access token
|
184
|
+
|
185
|
+
# 1. Build the client
|
186
|
+
client = Pinterest::Client.new(access_token: "fake-token-because-you-dont-have-this-yet", client_id: "client-id" , secret_key: "secret-key")
|
187
|
+
|
188
|
+
# 2. Build parameters
|
189
|
+
parameters = {
|
190
|
+
'grant_type' => 'authorization_code', # Required from Pinterest
|
191
|
+
'code' => params[:code].to_s, # Replace with the actual authorization code
|
192
|
+
'redirect_uri' => "your-redirect-uri"
|
193
|
+
}
|
194
|
+
|
195
|
+
# 3. Get the access token
|
196
|
+
response = client.oauth.retrieve_oauth_token(parameters: parameters)
|
197
|
+
puts response
|
198
|
+
# { "access_token": "{an access token string prefixed with 'pina'}", "refresh_token": "{a refresh token string prefixed with 'pinr'}", "response_type": "authorization_code", ..
|
199
|
+
|
200
|
+
```
|
201
|
+
|
179
202
|
How to refresh your access tokens
|
180
203
|
|
181
204
|
```ruby
|
data/lib/pinterest/version.rb
CHANGED