...
Code Block | ||||
---|---|---|---|---|
| ||||
rule get_access_token { select when oauth response if(not authorized) then { http:post(dropbox_base_url+"/oauth/access_token") with body = {} and headers = {"Authorization" : create_oauth_header_value(keys:dropbox('app_key'), keys:dropbox('app_secret'), ent:request_token, ent:request_token_secret) } and autoraise = "access_token" } } |
Like the rule that gets the request token above, this rule POSTs to the Dropbox access endpoint and automatically raises an event to process the response. The primary difference is that we create the Authorization
header value with the request token and secret that we stored in the last section to generate a request with a correctly formatted Authorization
header. We give the automatically raised even the label access_token
so that we can select it in the processing rule.
...