python outlook calendar_Outlook日历API Python

我正在尝试使用API从Outlook日历中检索事件。我只想检索今天之后的事件。我使用以下代码(基本上是微软教程中的剪切粘贴):def make_api_call(method, url, token, user_email, payload = None, parameters = None):

# Send these headers with all API calls

headers = { 'User-Agent' : 'python_tutorial/1.0',

'Authorization' : 'Bearer {0}'.format(token),

'Accept' : 'application/json',

'X-AnchorMailbox' : user_email }

# Use these headers to instrument calls. Makes it easier

# to correlate requests and responses in case of problems

# and is a recommended best practice.

request_id = str(uuid.uuid4())

instrumentation = { 'client-request-id' : request_id,

'return-client-request-id' : 'true' }

headers.update(instrumentation)

response = None

if (method.upper() == 'GET'):

response = requests.get(url, headers = headers, params = parameters)

print response.url

elif (method.upper() == 'DELETE'):

response = requests.delete(url, headers = headers, params = parameters)

elif (method.upper() == 'PATCH'):

headers.update({ 'Content-Type' : 'application/json' })

response = requests.patch(url, headers = headers, data = json.dumps(payload), params = parameters)

elif (method.upper() == 'POST'):

headers.update({ 'Content-Type' : 'application/json' })

response = requests.post(url, headers = headers, data = json.dumps(payload), params = parameters)

return response

此函数从以下位置调用:

^{pr2}$

它只返回日历中的前10个条目,而不是从今天开始的条目。如何取回特定日期的条目?在

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值