Module: Workflows

Included in:
CRM
Defined in:
lib/user/crm/workflows.rb

Instance Method Summary collapse

Instance Method Details

#create_workflow(data) ⇒ Object

Create workflow.

Create a workflow with data.

Parameters

data

(Hash) – Data to be submitted.

Example

data = {
  title: 'New Workflow',
  object_type: 'deals'
}
@data = @mints_user.create_workflow(data.to_json)
[View source]

53
54
55
# File 'lib/user/crm/workflows.rb', line 53

def create_workflow(data)
  @client.raw('post', '/crm/workflows/', nil, data)
end

#get_workflow(id, options = nil) ⇒ Object

Get workflow.

Get a workflow.

Parameters

id

(Integer) – Workflow id.

options

(Hash) – List of Resource Collection Options shown above can be used as parameter.

First Example

@data = @mints_user.get_workflow(1)

Second Example

options = { fields: 'id, title' }
@data = @mints_user.get_workflow(1, options)
[View source]

37
38
39
# File 'lib/user/crm/workflows.rb', line 37

def get_workflow(id, options = nil)
  @client.raw('get', "/crm/workflows/#{id}", options)
end

#get_workflows(options = nil) ⇒ Object

Get workflows.

Get a collection of workflows.

Parameters

options

(Hash) – List of Resource Collection Options shown above can be used as parameter.

First Example

@data = @mints_user.get_workflows

Second Example

options = { sort: 'title', fields: 'title' }
@data = @mints_user.get_workflows(options)
[View source]

20
21
22
# File 'lib/user/crm/workflows.rb', line 20

def get_workflows(options = nil)
  @client.raw('get', '/crm/workflows', options)
end

#update_workflow(id, data) ⇒ Object

Update workflow.

Update a workflow info.

Parameters

id

(Integer) – Workflow id.

data

(Hash) – Data to be submitted.

Example

data = {
  title: 'New Workflow Modified'
}
@data = @mints_user.update_workflow(7, data)
[View source]

69
70
71
# File 'lib/user/crm/workflows.rb', line 69

def update_workflow(id, data)
  @client.raw('put', "/crm/workflows/#{id}", nil, correct_json(data))
end