rails-pinterest 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '097b2ce4d2ec083c16dde219ab02d002612ed44147f0ea1ba7efbca852fd619f'
4
- data.tar.gz: 4997ffce4d401df22dcd418437d75d0156bafa0b89568906a62b46b348286a71
3
+ metadata.gz: c1fc96a443db45b6ac15f51c8152b6e87145b1c6dacb58d5b465b2d8a69f8b82
4
+ data.tar.gz: 6ea256a6db07492035e6e622f4cb7e5617792ef3963ec7a1e452a9406a7279ef
5
5
  SHA512:
6
- metadata.gz: '009d70127767d9823c65f25f88bb5a2c4aff755edcd3b0a750f2160efb79724053ec20d168cfe0643963b034610b07400ba1dd52c5e1e6242b052e5758fc3721'
7
- data.tar.gz: ec8e20194ed18c512c3ed412d94e571b382608cfcbe72a87f2b0e9a93233481d2a322b618f22768957fe068107de5631cd9c48a2f00c5545747f50e6ce1e8382
6
+ metadata.gz: 12bad857ab4b1aec512620322dc720c0e04243537279cad50c5be6242208c2aa3a264ef0ac82cbd87892da2f5276a7d7993f501d0fdac397718e0a0a580653a8
7
+ data.tar.gz: 8c3a3ac50db6366fa37df5d5aacff6d8e556aa6545bbb7350c650ceb7096efa8999869427c7798773b7022cb559183f230167490330d4c6422d473ea2f355db7
data/CHANGELOG.md CHANGED
@@ -11,4 +11,7 @@
11
11
  - Re-release to rubygems
12
12
 
13
13
  ## [0.1.2] - 2023-12-2
14
- - Added oauth refresh token endpoint.
14
+ - Added oauth refresh token endpoint.
15
+
16
+ ## [0.1.3] - 2023-12-2
17
+ - Add to ReadMe how to get access token from a authorization token
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails-pinterest (0.1.2)
4
+ rails-pinterest (0.1.3)
5
5
  faraday (>= 1)
6
6
  faraday-multipart (>= 1)
7
7
 
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
@@ -1,3 +1,3 @@
1
1
  module Pinterest
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-pinterest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Donald Lee