Skip to content

Commit

Permalink
Merge pull request #32 from cronofy/add-to-calendar-availability
Browse files Browse the repository at this point in the history
Add availability to add to calendar
  • Loading branch information
Haziba authored Apr 21, 2017
2 parents 8b05e57 + aeb0f86 commit 63953c5
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions cronofy.php
Original file line number Diff line number Diff line change
Expand Up @@ -513,12 +513,45 @@ public function add_to_calendar($params)
"start" => "2017-01-01T12:00:00Z",
"end" => "2017-01-01T15:00:00Z"
)
availability: An object holding the event's availability information
for example: array(
"participants" => array(
array(
"members" => array(
array(
"sub" => "acc_567236000909002"
"calendar_ids" => array("cal_n23kjnwrw2_jsdfjksn234")
)
),
"required" => "all"
)
),
"required_duration" => array(
"minutes" => 60
),
"available_periods" => array(
array(
"start" => "2017-01-01T09:00:00Z",
"end" => "2017-01-01T17:00:00Z"
)
)
)
target_calendars: An object holding the calendars for the event to be inserted into
for example: array(
array(
"sub" => "acc_567236000909002",
"calendar_id" => "cal_n23kjnwrw2_jsdfjksn234"
)
)
*/

$postfields = array(
"client_id" => $this->client_id,
"client_secret" => $this->client_secret,
"oauth" => $params["oauth"],
"event" => $params["event"],
"availability" => $params["availability"],
"target_calendars" => $params["target_calendars"],
);

return $this->http_post("/" . self::API_VERSION . "/add_to_calendar", $postfields);
Expand Down

0 comments on commit 63953c5

Please sign in to comment.