Module: DevinApi::Endpoints::Attachment

Defined in:
lib/devin_api/endpoints/attachment.rb

Overview

Attachment endpoints for the Devin API

Instance Method Summary collapse

Instance Method Details

#upload_file(file) ⇒ String

Upload a file for Devin to work with during sessions

Parameters:

  • file (File) —

    File object to upload

Returns:

  • (String) —

    URL where the uploaded file can be accessed

See Also:



12
13
14
15
16
# File 'lib/devin_api/endpoints/attachment.rb', line 12

def upload_file(file)
  payload = { file: Faraday::UploadIO.new(file.path, 'application/octet-stream', File.basename(file.path)) }

  connection.post('/v1/attachments', payload).body
end