Class: Infopark::Crm::Attachment

Inherits:
Core::Resource
  • Object
show all
Defined in:
lib/crm_connector/attachment.rb

Defined Under Namespace

Classes: Permission

Class Method Summary collapse

Class Method Details

.download_url(attachment_id, activity_id) ⇒ String

Generates a temporary download URL for the given attachment.

Examples:

url = Infopark::Crm::Attachment.download_url("c972c011b52ba671b68b16db961b82e7", "ff30a81adaaae7bd5a7066c350530c41")

Parameters:

  • attachment_id (String)

    An attachment ID taken from the attachments field inside the comments section of an activity.

  • activity_id (String)

    The activity ID the attachment belongs to

Returns:

  • (String)

See Also:

WebCRM Rest Url:

  • GET /api/attachments/download_url


30
31
32
# File 'lib/crm_connector/attachment.rb', line 30

def self.download_url(attachment_id, activity_id)
  get(:download_url, :attachment_id => attachment_id, :activity_id => activity_id)
end

.upload_permissionPermission

Generates a temporary Amazon S3 URL for uploading a file to S3.

Examples:

permission = Infopark::Crm::Attachment.upload_permission

Returns:

See Also:

WebCRM Rest Url:

  • GET /api/attachments/upload_permission


16
17
18
19
# File 'lib/crm_connector/attachment.rb', line 16

def self.upload_permission
  perm = get(:upload_permission)
  Permission.new(perm["url"], perm["fields"], perm["upload_id"])
end