BulkData GetCarveData Method
Retrieves data from the carve for a date range not to exceed a total of 48 hours. This returns the table’s columns to create a table in your database and any records created or updated in the time range and table requested. To use this method the organization must have access to the carve and the API user must have permissions to the carve data.
Parameters
Name | Data Type | Is Required |
---|---|---|
OrgID | Long | Required |
Description | The organization’s ID number. | |
TableName | String | Required |
Description | The name of the table you wish to retrieve from the carve data. See the GetCarveTableList method for a list of available tables. | |
BeginDate | DateTime | Required |
Description | The beginning date of the date range for which to pull the list of new accounts. This date cannot be more then 96 hours in the past. | |
EndDate | DateTime | Optional |
Description | The end date of the date range for which to pull the list of new accounts. This will default to SYSDATE if left undefined. | |
SiteID | Long | Required |
Description | The site’s ID number. This can be found using the GetSiteList method. |
Returned Parameters
Name | Data Type |
---|---|
Table Elements List | Collection |
Description | This is the list of columns within the table requested. See GetCarveTableList for additional details. |
Table Data | Collection |
Description | The data that is within the requested carve table. See GetCarveTableList for additional details. |
Example
We’ll assume you’ve got a web reference, let’s name it BulkData, in your Visual Studio project. At this point we need to our objects. We’ll need the standard service object, a user request object and a data request object. We can define and create those like this:
// Create request objects
BulkData.LookupUser_Request user_request = new BulkData.LookupUser_Request();
BulkData.BulkDataSoapClient service = new BulkData.BulkDataSoapClient();
BulkData.GetCarveData_Request request = new BulkData.GetCarveData_Request();
Here’s my sample code of the Request and user objects.
// request
user_request.Username = "user";
user_request.Password = "pass";
user_request.Channel = 999;
request.OrgID = 123546;
request.BeginDate = DateTime.Today.AddDays(-1);
request.EndDate = DateTime.Today;
Finally we can call the method and pass across the login object and the request object to retrieve our data. It’s a good idea to do this in a Try Catch block.
// Call the method that will load the response object
try
{
System.Data.DataTable response;
response = service.GetCarveData(user_request, request);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
Note that if something goes wrong the service will respond with an exception. You’ll want to take a look at that message returned in that exception so it can be debugged.
For a full list of methods, see BulkData Methods.