Retrieve the entire contents of a large data export. When an API call results in too much data to return in a single call, the call provides a GUID that can be referenced to download the entire results. Simply call this function, providing the GUID, and the data will be returned as an attachment. Note that the file contents will be in CSV format instead of JSON.
Get
/API/Rest/Utility/GetFile
fileNameGuid
(none)
Invalid file name
Database error
Unknown error
A data stream of the contents of the API call.
Get the large results from a previous API call.
using System;
using System.Net.Http;
string url = "https://example.com/API/Rest/Utility/GetFile?AccountName=acme&login=ApiUser&fileNameGuid=4bd7fcc4-f295-475a-9761-1c1de981841d";
// Reuse HttpClient for multiple requests in production code.
using (var client = new HttpClient())
using (var request = new HttpRequestMessage(HttpMethod.Get, url))
{
request.Headers.Add("Password", "YOUR_PASSWORD");
using (HttpResponseMessage response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}
require "open-uri"
open("https://example.com/API/Rest/Utility/GetFile?AccountName=acme&login=ApiUser&fileNameGuid=b831e9b7-c09b-46f7-a214-81e89489d0b3&password=YOUR_PASSWORD") do |data|
File.open("Sample.txt", "wb") do |file|
file.write(data.read)
end
end
import requests
url = "https://example.com/API/Rest/Utility/GetFile?accountName=acme&login=ApiUSer&fileNameGuid=e17e3916-08d2-4ea3-a345-eb7307638fb7"
headers = {'Password':'YOUR_PASSWORD'}
resp = requests.get(url, headers=headers)
if resp.status_code == 200:
with open('c:/temp/PythonDownload.txt', 'wb') as f:
f.write(resp.content)
https://example.com/API/Rest/Utility/GetFile?AccountName=acme&login=ApiUser&fileNameGuid=4bd7fcc4-f295-475a-9761-1c1de981841d&password=YOUR_PASSWORD