微定时是一个基于微信的定时提醒服务,为适应广大程序员小伙伴们的接入需求,微定时开放了动态创建提醒的接口,希望把提醒也做成一种服务,即RaaS(Reminder as a Service),这样当一个系统需要定时提醒功能的时候,就可以直接集成微定时而不需要从头开发一个完整的定时提醒系统。
微定时
time
desc
http://wecron.betacat.io/reminds/api/
每一个对提醒的操作均需在 HTTP 请求头部增加一个 Authorization 字段,其值为认证凭证的字符串,示例如下:
Authorization: Token <my_secret_token>
认证凭证目前是手动生成的,有需求的小伙伴可以通过邮箱与我取得联系:
POST /reminds/api/ Authorization: Token <my_secret_token> Content-Type: application/json { "time": <remind_time>, "title": <title>, "desc": <description>, "defer": <defer>, “external_url”: <external_url> }
<remind_time>
<title>
<description>
<defer>
-60
60
<external_url>
http://www.huodongxing.com/event/4406039677700
<access_token>
HTTP/1.1 200 OK Content-Type: application/json { "title": <title>, "time": <remind_time>, "owner": { "nickname": <owner_name>, "headimgurl": <owner_avatar_url> }, "id": <remind_id>, "defer": <defer>, "desc": <description>, "participate_qrcode": <participate_qrcode_url>, "post_url": <post_url> }
<owner_name>
<owner_avatar_url>
<remind_id>
<participate_qrcode_url>
<post_url>
curl -H "Content-Type: application/json" -H 'Authorization: Token <my_secret_token>' -X POST -d '{"time":1514297534431,"desc":"我是测试提醒","title":"测试一下","defer": -60,"external_url": "https://www.baidu.com/s?wd=wecron"}' http://wecron.betacat.io/reminds/api/
HTTP/1.1 200 OK Content-Type: application/json { "title": "测试一下", "time": 1514297534431, "owner": { "nickname": "awk", "headimgurl": "http://wx.qlogo.cn/mmopen/PoLd0uGbcFiacCQXjyibsQoBiaxm4t0icricq90yfyBHvgueupXFnzhdqMM9DtEZnCTq00UCkAqvgWBTp5ricqb69UicsQKjN6VfOYJ/0" }, "id": "fa14853c329a4d21901c72c0e7ff1867", "defer": -60, "desc": "我是测试提醒", "external_url": "https://www.baidu.com/s?wd=wecron", "participate_qrcode": "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=gQGC8DwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAybzIyZ2NWMTE5Ul8xMDAwMGcwN2gAAgRQVUJaAwQAAAAA", "post_url": "http://wecron.betacat.io/reminds/api/fa14853c329a4d21901c72c0e7ff1869/share_post/" }
提醒即服务 - Reminder as a Service
微定时
是一个基于微信的定时提醒服务,为适应广大程序员小伙伴们的接入需求,微定时
开放了动态创建提醒的接口,希望把提醒也做成一种服务,即RaaS(Reminder as a Service),这样当一个系统需要定时提醒功能的时候,就可以直接集成微定时
而不需要从头开发一个完整的定时提醒系统。应用场景
微定时
提供的接口,获取订阅二维码或者海报,让参与者扫码后就能订阅提醒。优势
在没有提供time
字段的情况下,微定时
能自动提取desc
字段中的时间信息,转化成提醒时间。REST请求
请求地址
认证授权
每一个对提醒的操作均需在 HTTP 请求头部增加一个 Authorization 字段,其值为认证凭证的字符串,示例如下:
Authorization: Token <my_secret_token>
认证凭证目前是手动生成的,有需求的小伙伴可以通过邮箱与我取得联系:
请求格式
<remind_time>
<title>
<description>
<defer>
-60
代表提前1小时,60
代表延后1小时提醒<external_url>
微定时
弹出的提醒时跳转的页面,例如:http://www.huodongxing.com/event/4406039677700
REST响应
HTTP响应状态码
<access_token>
是否正确响应格式
<remind_time>
<title>
<owner_name>
<access_token>
所标志的用户名<owner_avatar_url>
<access_token>
所标志的用户的头像url<remind_id>
<description>
<defer>
<participate_qrcode_url>
<post_url>
示例
请求示例 - curl
响应示例