# Angus 的事件插件 📅

**URL:** https://meta.discourse.org/t/angus-events-plugin/69776
**Category:** Plugin
**Created:** [2017年九月11日 02:44 UTC](https://meta.discourse.org/t/angus-events-plugin/69776 "2017-09-11T02:44:59Z")
**Posts on this page:** 1
**Showing post:** 28

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2017年十月18日 10:56 UTC](https://meta.discourse.org/t/angus-events-plugin/69776/28 "2017-10-18T10:56:00Z")

</div>

> [@supernaturally](#):
>
> is it possible to use the Discourse RESTful API to update posts/threads that are using your plugin-in

It is now 🙂

[https://github.com/angusmcleod/discourse-events/commit/33ba86f66e22afaab30dd64eb0e51e45f17860c9](https://github.com/angusmcleod/discourse-events/commit/33ba86f66e22afaab30dd64eb0e51e45f17860c9)

To add a date and time when creating a topic, pass a JSON `event` string with `start` and `end` set as datetimes in ISO 8601 format.

Example request:

```plaintext
curl -X POST \
  https://your_site/posts \
  -H 'cache-control: no-cache' \
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
  -F api_key=your_key \
  -F api_username=your_username \
  -F 'title=Posting an event from the API :robot:' \
  -F 'raw=Boogey on down to funky town.' \
  -F category=Events \
  -F 'event={ "start": "2017-10-18T10:08:08Z", "end": "2017-10-18T11:08:08Z" }'

```

Result:  
[https://discourse.angusmcleod.com.au/t/posting-an-event-from-the-api-robot/79/1](https://discourse.angusmcleod.com.au/t/posting-an-event-from-the-api-robot/79/1)

**Note** : I’m not sure if it’s possible to pass custom parameters to methods available in the `disocurse_api` gem. @blake?

---

_[View the full topic](https://meta.discourse.org/t/angus-events-plugin/69776)._
