Retrieve 'DOCSIGN' signed envelope list through API c# - c#

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.

Related

How to filter AppInsights custom metrics with REST API

I am trying to use REST API for retrieving AppInsights custom metrics and use a filter in the query.
The code to create the metric:
var telemetry = new MetricTelemetry();
telemetry.Context.InstrumentationKey = instrumentationKey;
telemetry.Name = FacebookFupMetricName;
telemetry.Value = amount;
telemetry.Timestamp = DateTime.Now;
telemetry.Properties["agencyCode"] = agencyCode;
telemetry.Properties["accountCode"] = accountCode;
telemetry.Properties["category"] = category;
telemetry.Properties["action"] = action;
var client = new TelemetryClient();
client.TrackMetric(telemetry);
client.Flush();
The metric is created in Azure when run this code.
Now I would like to use REST API for retrieving metrics and use a filter in the query. When I use a filter
category eq 'cat001'
the query ends with an error
The following dimensions are not valid in the filter clause for this metric: category
The query url is:
https://dev.applicationinsights.io/apiexplorer/metrics?appId=<appId>&apiKey=<apiKey>&metricId=customMetrics%2FFacebookFupAction&timespan=P1D&aggregation=sum&filter=category%20eq%20%27cat001%27
The question is, is it possible to filter custom metrics with dimensions?
In the filter field, you should use customDimensions/category eq 'cat001'.
The generated url is in this format:
`https://dev.applicationinsights.io/apiexplorer/metrics?appId=<appId>&apiKey=<apiKey>&metricId=customMetrics%2FFacebookFupMetricName&aggregation=sum&filter=customDimensions%2Fcategory%20eq%20'cat001'`
The screenshot as below:

C# issue with setting array value for sending request to a web service

in my code I'm creating a ValuationRequest object to send to a web service and return a bunch of diary slots.
One of the fields ValuationType is an array of SearchType[] which can either be .sales or .lettings and defaults to sales if not specified
request = new ValuationRequest
{
ValuationType = new SearchType[] { SearchType.lettings },
Postcode = model.Postcode,
FromDate = DateTime.Now.AddHours(24),
ToDate = DateTime.Now.AddDays(14)
};
The above code is being sent to the web service and bringing back sales valuations.
How can I debug this and check why the ValuationType setting is being ignored? I've tried stuff like
Debug.WriteLine(request.ValuationType.ToString());
and
Debug.WriteLine(request.ValuationType.GetValue());
but don't get anything useful returned. I need ValuationType to be set to lettings.
any help at all is apprecaited
You can use linq Aggregate operator
Example:
var debugstr= request.ValuationType.Select(vt=>vt.ToString()).Aggregate( (s1,s2) => s1+ "," s2);

How to use Next and previous Uri in Docusign using Rest Recipes

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).

How to get the Sales Orders search by date or SO number using QBFC

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);

Display all elements in array from a response

Ok I have a confusing question (I think) in regards to request and response values.
I created a request to search for Customers within a database based on the company name. Here is the code:
//Search through customers
public void ArrangeRequest()
{
_request = new CustomerSearchRequest();
_request.Company = "NewCustomers Inc";
}
Here is customer info before it is requested and given values:
//Customer Info
_request.Customer = new CustomerInfo
{
Company = "NewCustomers Inc. ",
CustStatus = Status,
CustID = custid,
Fax = "(855) 555-6956",
Phone = "(568) 895-6954",
ProviderId = 56958,
TechContact = _techcontact,
TimeZoneInfoID = "Central Standard Time",
};
This request works and when I debug I get the message that 52 customers were found. Now, each of those customers has a unique customer ID that was created when they were. When I debug I am able to see all the information for the customers including their customer ID. My problem is I am trying to output all those values to a text file. The problem is the customer ID's are in an array with all the other information in: CustomerInfo[]. Now I am able to output each individual value in the array by saying CustomerInfo[1] or CustomerInfo[2], but I want to be able to make the search and output all the values in the array without having to call each individual value.
I want this so that if I wanted to search for another company and it has 1000 results then I won't have to call each one obviously.
edited based on OPs comments:
foreach(var customer in _response.Customers)
{
Console.WriteLine(customer.CustID);
}

Categories

Resources