frontapp
frontapp copied to clipboard
Empty body for attachments
When using the download_attachment method for an image, the response body does not contain the image content.
When I drop down and use HTTP directly, the response.ready_body invocation returns the binary data correctly but it doesn't seem to make it up into the frontapp gem's response.
I've monkey patched my API client wrapper with the following code in order to support this:
def download_attachment(attachment_id)
url = URI("https://api2.frontapp.com/download/#{attachment_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Accept"] = 'application/json'
request["Authorization"] = "Bearer #{api_token}"
response = http.request(request)
response
end