8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/fullscriptapi/authentication_endpoints/create_an_oauth_token.rb', line 8
def create_an_oauth_token(grant)
raise unless client_id && secret && redirect_uri
response = Excon.post("#{get_server}/api/oauth/token",
headers: {
"Content-Type": "application/json"
},
body: {
grant_type: "authorization_code",
client_id: client_id,
client_secret: secret,
code: grant,
redirect_uri: redirect_uri
}.to_json
)
body = JSON.parse(response.body)
use_token(body["oauth"])
body
end
|