如何从EnvelopesAPI.ListStatusChanges获取其他结果 [英] How Do I Get Additional Results from EnvelopesAPI.ListStatusChanges
问题描述
我正在尝试练习防御性编程。遵循文档中的建议,我想使用api进行轮询,该api在上次轮询前3分钟传入一个值。考虑到,我可以得到一个小于TotalSetSize的ResultSetSize,我想从下一个结果开始请求下一个结果集。
I'm trying to practice defensive programming. Following the advice from the documentation, I want to poll using the api passing in a value 3 minutes before the last time I polled. Considering, I could get a ResultSetSize less than the TotalSetSize, I'd like to ask for the next set of results starting at the next result.
因此,作为示例,我要求执行以下操作(使用REST API资源管理器):
So, as an example, I request the following (using the REST API explorer):
GET https://demo.docusign.net/restapi/v2/accounts/#####/envelopes?count=2&from_date=2017-01-01&from_to_status=changed HTTP/1.1
(请注意计数= 2)
这将返回:
Object
resultSetSize: "2"
totalSetSize: "8"
startPosition: "0"
endPosition: "1"
nextUri: "/accounts/#####/envelopes?start_position=2&count=2&from_date=1%2f1%2f2017+12%3a00%3a00+AM&from_to_status=changed"
previousUri: ""
envelopes: Array [2]
好的,很好如我所料现在,我想获得结果的第二个页面。我将start_position添加为2,对吗? (由于结束位置为1,所以我希望返回startPosition 2和endPosition 3。)
Ok, great, exactly as I expect. Now, I want to get the second "page" of results. I add a start_position of 2, right? (Since the end position is 1, I'd expect to get startPosition 2 and endPosition 3 to be returned.)
GET https://demo.docusign.net/restapi/v2/accounts/#####/envelopes?count=2&from_date=2017-01-01&from_to_status=changed&start_position=2 HTTP/1.1
没有骰子... 400错误的请求:
No dice... 400 Bad Request:
Object
errorCode: "INVALID_REQUEST_PARAMETER"
message: "The request contained at least one invalid parameter. Query parameter 'count' was not a positive integer."
count参数是一个正整数...
The count parameter is a positive integer...
请,有人告诉我我做错了。我想一次请求尽可能多的通过,如果有更多请求,我想重复直到所有信封都被取回,但是这个计数错误令人担忧。
Please, someone tell me what I'm doing wrong. I would like to just request as many as they can pass at a time, and if there are more, I'd like to repeat until all envelopes have been retrieved, but that "count" error is concerning.
推荐答案
来自文档
开始位置参数仅供DocuSign使用。
start_position parameter is reserved for DocuSign use only.
listStatusChanges api不支持分页。
Looks like pagination is not supported with the listStatusChanges api.
这篇关于如何从EnvelopesAPI.ListStatusChanges获取其他结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!