Class: PipedrivePUT::Activity
- Inherits:
-
Object
- Object
- PipedrivePUT::Activity
- Includes:
- PipedrivePUT
- Defined in:
- lib/PipedrivePUT/activity.rb
Constant Summary
Constants included from PipedrivePUT
Instance Attribute Summary
Attributes included from PipedrivePUT
Class Method Summary collapse
-
.addActivity(subject, type, options = {}) ⇒ Object
subject (required) (string) Subject of the activity done (optional) (enumerated) Whether the activity is done or not.
-
.getActivity(user_id) ⇒ Object
—————————————– Gets activites of a specific user———————————————————-.
-
.getOrgActivities(org_id) ⇒ Object
—————————————– Gets activites of a specific organization————————————————.
Methods included from PipedrivePUT
Class Method Details
.addActivity(subject, type, options = {}) ⇒ Object
subject (required) (string) Subject of the activity
done (optional) (enumerated) Whether the activity is done or not. 0 = Not done, 1 = Done
type (required) (string) Type of the activity. (call, meeting, task, deadline, email, lunch)
due_date (optional) (date) Due date of the activity. Format: YYYY-MM-DD
due_time (optional) (time) Due time of the activity in UTC. Format: HH:MM
duration (optional) (time) Duration of the activity. Format: HH:MM
user_id (optional) (number) ID of the user whom the activity will be assigned to. If omitted, the activity will be assigned to the user.
deal_id (optional) (number) ID of the deal this activity will be associated with person_id (optional) (number) ID of the person this activity will be associated with org_id (optional) (number) ID of the organization this activity will be associated with note (optional) (string) Note of the activity (HTML format)
33 34 35 36 37 38 39 40 |
# File 'lib/PipedrivePUT/activity.rb', line 33 def self.addActivity(subject, type, = {}) url = "https://api.pipedrive.com/v1/activities?api_token=#{@@key}" ['subject'] = subject ['type'] = type HTTParty.post(url, body: .to_json, headers: {'Content-type' => 'application/json'}) end |
.getActivity(user_id) ⇒ Object
—————————————– Gets activites of a specific user———————————————————-
6 7 8 9 10 |
# File 'lib/PipedrivePUT/activity.rb', line 6 def self.getActivity(user_id) base = "https://api.pipedrive.com/v1/activities?user_id=#{user_id}&api_token=#{@@key}" content = open(base).read JSON.parse(content) end |
.getOrgActivities(org_id) ⇒ Object
—————————————– Gets activites of a specific organization————————————————
15 16 17 18 19 |
# File 'lib/PipedrivePUT/activity.rb', line 15 def self.getOrgActivities(org_id) base = "https://api.pipedrive.com/v1/organizations/#{org_id}/activities?start=0&api_token=#{@@key}" content = open(base).read JSON.parse(content) end |