I want to fetch 20 records/request for envelope information using Rest Recipes.
My requirement is:
When 20 records are dumped to database, I want hit another batch which will fetch me records from 21 to 40 then in the third call from 41 to 60 and so on...
I have used code below, but not getting any idea, how to get information like paging. // call the Login() API which sets the user's baseUrl and returns their accountId
string accountId = loginApi(USER_NAME, PASSWORD);
// Set the Start Date (to limit the results returned)
DateTime fromDate = new DateTime(2016, 09, 15);
string fromDateStr = fromDate.ToString("o");
DateTime toDate = new DateTime(2016, 09, 16);
string toDateStr = toDate.ToString("o");
// set a filter for the envelopes we want returned using the
// fromDate and count properties
// Here I want to use paging like functionality.
EnvelopesApi.ListStatusChangesOptions options = new EnvelopesApi.ListStatusChangesOptions()
{
count = "20",// How to increase this counter for next request?
fromDate = fromDateStr,
toDate = toDateStr
};
EnvelopesApi envelopesApi = new EnvelopesApi();
EnvelopesInformation envelopes = envelopesApi.ListStatusChanges(accountId, options);
What are you trying to solve? DocuSign has a call that allows you to get a list of envelope IDs over a date/time/status range. There wouldn't be a specific number or limit to what is returned in this scenario, but I don't understand why you want to limit it to 20 (as your example states).
Related
I'm trying to delete a single row with the Google Sheets API in C#, and I can't get it to work. Fetching and updating rows work as intended.
Here's my code (inspired from C# Google Sheets API - Delete Row and the Java documentation):
var request = new Request
{
DeleteDimension = new DeleteDimensionRequest
{
Range = new DimensionRange
{
SheetId = 0,
Dimension = "ROWS",
StartIndex = 21,
EndIndex = 21
}
}
};
var deleteRequest = new BatchUpdateSpreadsheetRequest {Requests = new List<Request> {request}};
// First way: create a batch update request from scratch then execute it
var responseFirstWay = new SpreadsheetsResource.BatchUpdateRequest(MY_SHEETS_SERVICE, deleteRequest, MY_SPREADSHEET_ID).Execute();
// Second way: create a batch update request from the existing SheetsService then execute it
var responseSecondWay = MY_SHEETS_SERVICE.Spreadsheets.BatchUpdate(deleteRequest, MY_SPREADSHEET_ID).Execute();
I've tried with various indexes, but it doesn't seem to change anything (in my example above I've put 21, with all rows up to 30 filled with data). I find a bit weird to have a SheetId set to zero, but that's the gid parameter I have when visiting Google Sheets.
No matter how I create my BatchUpdateRequest, the response is empty after I execute it.
According to the documentation for DimensionRange the indexes are half-open meaning the start-index is inclusive, and the end-index is exclusive.
You should change your EndIndex to 22 to delete the 21st row.
For existing daily schedule on which I am adding holiday calendar for particular dates for which trigger should not be fired,
Below code is for adding calendar to schedule,
ISchedulerFactory sf = new StdSchedulerFactory(config);
Instance = sf.GetScheduler();
HolidayCalendar cal = new HolidayCalendar();
cal.AddExcludedDate(new DateTime(2017, 11, 24));
cal.AddExcludedDate(new DateTime(2017, 11, 25));
Instance.AddCalendar("Cal", cal, false,true);
Now, I am associating this existing calendar with trigger,
var trigger1 = Instance.GetTriggersOfJob(new JobKey(jc.Name)).First().GetTriggerBuilder().ModifiedByCalendar("Cal").Build();
At last I am printing all the dates on which trigger will be fired,
while (startTimeUTC < DateTime.Parse("11-21-2017").AddDays(8))
{
var nextFireTime = trigger1.GetFireTimeAfter(startTimeUTC);
Console.WriteLine(" : " + nextFireTime);
if (nextFireTime == null) break;
startTimeUTC = (DateTimeOffset)nextFireTime;
}
But in output I am getting dates 24-11-2017 and 25-11-2017 along with other dates. As I have added dates 24-11-2017 and 25-11-2017 as holiday it should not be returned by GetFireTimeAfter() method.
Anything I am missing?
The method GetFireTimeAfter does not check if the returned fire time matches an excluded date from the trigger associated calendar.
An alternate method you can use to list the real fire times, while taking into account a given calendar, is:
var fireTimes = TriggerUtils.ComputeFireTimes((IOperableTrigger)trigger1, cal, 30);
I would like to retrieve all singed envelope details with the given date range. As of now, I can retrieve maximum 100 record’s details. I need to fetch all envelope which just completed during the given time interval.
I used the below code to retrieve all signed contract details. This can return maximum 100 envelope details but my case it may be more than that (How I can retrieve all envelope details in a given date range).
Is Docu Sign allow only 100 envelope details per request?
string accountId = loginApi(username, password);
//===========================================================
// Step 2: List Envelopes (using filters)
//===========================================================
// This example gets statuses of all envelopes in your account going back 1 full month...
DateTime fromDate = DateTime.UtcNow;
fromDate = fromDate.AddDays(-4);
string fromDateStr = fromDate.ToString("o");
// set a filter for the envelopes we want returned using the fromDate and count properties
var options = new EnvelopesApi.ListStatusChangesOptions()
{
count = "100",
fromDate = fromDateStr
};
Instead of passing the count property, pass fromDate and toDate properties.
// set a filter for the envelopes we want returned using the fromDate and count properties
var options = new EnvelopesApi.ListStatusChangesOptions()
{
fromDate = "6/16/2017",
toDate = "6/20/2017"
};
// |EnvelopesApi| contains methods related to envelopes and envelope recipients
var envelopesApi = new EnvelopesApi();
var envelopes = envelopesApi.ListStatusChanges(accountId, options);
See this answer for more information.
If you don't put count then all records will be fetched. Also please check - https://docs.docusign.com/esign/restapi/Envelopes/Envelopes/listStatusChanges/
for available query parameters which you can pass in the call to get the list of records.
How to get all items and transactions made by the seller on eBay for all time. I can successfully receive all transaction details for the past 10 days using the following code:
// Getting sold items
var durationSpecifiedeBaySellingCall = new GetMyeBaySellingCall(apiContext)
{
SoldList = new ItemListCustomizationType
{
DurationInDays = 10,
DurationInDaysSpecified = true,
Include = true
},
DetailLevelList = new DetailLevelCodeTypeCollection
{
DetailLevelCodeType.ReturnAll
}
};
durationSpecifiedeBaySellingCall.Execute();
but I'm not able to receive all transactions for the past 10 years, for example, when replace the value of DurationInDays with 3650 instead of 10. durationSpecifiedeBaySellingCall.SoldListReturn is null. How can I properly get the list of all user transactions?
It looks like you are using the GetMyeBaySelling API call, the documentation states that you can only pull a Max of 60 Days.
eBay Documentation GetMyeBaySelling
This is the code I have:
ISalesOrderQuery salesOrdersQueryRq = requestMsgSet.AppendSalesOrderQueryRq();
salesOrdersQueryRq.IncludeLineItems.SetValue(true);
IMsgSetResponse responseMsgSet = sessionManager.DoRequests(requestMsgSet);
IResponse response = responseMsgSet.ResponseList.GetAt(0);
ISalesOrderRetList salesOrderRetList = (ISalesOrderRetList)response.Detail;
the code above get all sales orders but i just need get sales orders from "date" to "date" or the sales order has SO number = "SOnumber", any suggestions?
You can set a TxnFilter when doing queries to limit the response. Each transaction type has different filters that can be set, though a lot use similar filters. The OSR shows which filters are available for each transaction type: https://developer-static.intuit.com/qbSDK-current/Common/newOSR/index.html
ISalesOrderQuery salesOrdersQueryRq = reqeustMsgSet.AppendSalesOrderQueryRq();
salesOrderQueryRq.IncludeLineItems.SetValue(true);
// Use these lines for date range filter
salesOrdersQueryRq.ORTxnNoAccountQuery.TxnFilterNoAccount.ORDateRangeFilter.TxnDateRangeFilter.ORTxnDateRangeFilter.TxnDateFilter.FromTxnDate.SetValue(fromDate);
salesOrdersQueryRq.ORTxnNoAccountQuery.TxnFilterNoAccount.ORDateRangeFilter.TxnDateRangeFilter.ORTxnDateRangeFilter.TxnDateFilter.ToTxnDate.SetValue(toDate);
// Use these lines for reference number query
salesOrdersQueryRq.ORTxnNoAccountQuery.RefNumberList.Add(soNumber);
IMsgSetResponse responseMsgSet = SessionManager.DoRequests(requestMsgSet);