When making calls to the List Signature Requests or List Templates endpoints, a maximum of 100 objects are returned per page. In order to gather data from every signature request or template listed, you could loop through each page of the response.
To do so, set a variable equal to the {"list_info"[‘num_pages’] value and starting with page = 1, increment until the total number of pages.
Example in Ruby:
All_requests = []
page = 1
while page < list_info[‘num_pages’] + 1
requests = client.get_signature_requests(page_size: 100, page: page)
all_requests << requests.data["signature_requests"]
page += 1
end
Example in PHP:
$client = new HelloSign\Client($api_key);
$pages = $client->getSignatureRequests()->getNumPages();
fopen('all_signature_requests.log', "w");
$page = 1;
$signature_requests = fopen('all_signature_requests.log', "a");
while ($page <= $pages) {
$siganture_requests_object = print_r($client->getSignatureRequests($page), 1);
fwrite($signature_requests, $siganture_requests_object);
$page++;
}
Example in cURL:
This may help if you want to code the http requests without using one of our SDKs. This adds some additional parameters - page_size, a date range, and test_mode:false:
curl -X GET \
'https://api.hellosign.com/v3/signature_request/list?page_size=100+query=from:%7B2017-10-01+TO+2017-10-31%7D+AND+test_mode:false' \
-u 'APIKEYHERE:'
Comments
0 comments
Article is closed for comments.