Dropbox Forms API v3 contains several API calls for authentication and workflows. Here are examples of these API requests in Ruby. These examples use the HTTParty request library.
For more information on these endpoints, please refer to the API Documentation.
Get Auth Token
response = HTTParty.get('https://api.helloworks.com/v3/token/[API_KEY_ID]',
headers: {
"Authorization" => "Bearer [API KEY],
"cache-control" => "no-cache"
}
)
token = response["data"]["token"]
Create Workflow Instance
request = HTTParty.post("https://api.helloworks.com/v3/workflow_instances",
headers: {
"Authorization" => "Bearer [AUTH TOKEN]",
"Content-Type" => "application/x-www-form-urlencoded"
},
body: {
"workflow_id" => "fons6pkRW8qabcde",
"participants[signer][type]" => "email",
"participants[signer][value]" => "helloworks@example.com,
"participants[signer][full_name]" => "HelloWorks Signer",
"callback_url" => "https://www.example.com"
}
)
Get Workflow Instance
request = HTTParty.get("https://api.helloworks.com/v3/workflow_instances/[WORKFLOW INSTANCE ID]",
headers: {
"Authorization" => "Bearer [AUTH TOKEN]",
"Content-Type" => "application/x-www-form-urlencoded"
}
)
Get Workflow Instance Audit Trail
file = HTTParty.get("https://api.helloworks.com/v3/workflow_instances/[WORKFLOW INSTANCE ID]/audit_trail",
headers: {
"Authorization" => "Bearer [AUTH TOKEN]",
"Content-Type" => "application/x-www-form-urlencoded"
}
)
File.open("Helloworks/audit_trail.pdf", "wb+") { |f| f.write(file) }
Get Workflow Instance Documents
file = HTTParty.get("https://api.helloworks.com/v3/workflow_instances/[WORKFLOW INSTANCE ID]/documents/[DOCUMENT ID]",
headers: {
"Authorization" => "Bearer [AUTH TOKEN]",
"Content-Type" => "application/x-www-form-urlencoded"
}
)
File.open("Helloworks/document.pdf", "wb+") { |f| f.write(file) }
Comments
0 comments
Article is closed for comments.