Get survey respondent list after a specific date - surveymonkey

I have a small question regarding the use of survey monkey api. I am using C# for my development. Is there any way that I can query a respondent list so that I can get all the respondents after a specific date. I can actually get all the list of respondents and compare with the startModifiedDate but I am trying to pass the query to the api so that I get only the required data. Is there any way to do this?
Thank you,
Rakesh Vankadaru

There is a 'start_date' parameter you can include in the API request, to filter the set of respondents to only those created after that date:
https://developer.surveymonkey.com/mashery/get_respondent_list

As Ryan mentioned in his comment, you can use start_date to limit the respondents you get to all those who started answering a survey after a certain date & time. It's important to note that using start_date just limits the list to when the response was started. If the respondent hasn't completed the survey when you check for responses, there could still be more responses coming. It's also possible to configure your collector so that users can edit their answers. In either case, the start_date for the respondent won't change.
A better option is to use date_modified since that will change each time new questions are answered or existing answers are updated. That method is demonstrated here.

Related

How to get the Twitter follower count of a user on a given date, or at the time of a tweet?

I have access to Twitter API for Academic Research, and I'd like to get the follower count on a given date of a user, or at the time of a tweet.
The doc mentions that "This fields parameter enables you to select which specific user fields will deliver in each returned Tweet.", so I assumed that by adding public_metrics to the users.field, the number of followers can be seen in each returned Tweet, however, in each returned Tweet, I can only see user_id. https://developer.twitter.com/en/docs/twitter-api/tweets/search/api-reference.
Is it even possible to achieve what I want with Twitter API for Academic Research? Is there any other approach to make it?
Thank you so much.
You cannot get the follower count on a specific date; it will always be the count at the time you make the API call.
You may need to add expansions to your API call in order to receive the values you are trying to pull out.

Get latest record for each user with ODATA

Due to the PowerShell methods of getting mailbox statistics from Office365 taking about 2 seconds per mailbox, I am working on getting the data from Office 365 Reporting web service, which takes only a few seconds for each 2000 mailboxes.
The problem I'm running into is that the stats are updated periodically and some historical data is kept, so there are numerous records for each user. I only want to get the latest record for each user, but I haven't been able to find a way to do that. The closest I've come is to use $filter=Date ge DateTime'2016-03-10T00:00:00' where the date is concatenated to a couple of days ago. Theoretically, if I sort by Date desc I should get the latest records first, and if there is a user that has a record for 3/10 and 3/11, the 3/11 record would get pulled first, which would work for me. But regardless of how I do the sort it seems to come back with the older records first.
Ideally, I would like to be able to set criteria so that it only returns the latest record for each mailbox, but I can't seem to figure out or find how to do that. The closest I've been able to come is to just start running queries filtered on specific dates, walking the date back a day on each query.
If I can get the latest records to be returned first, I would be able to work with that because I can just discard a record if I've already received a later one.
https://reports.office365.com/ecp/reportingwebservice/reporting.svc/MailboxUsageDetail/
?DelegatedOrg=nnn.onmicrosoft.com&$select=Date,WindowsLiveID,CurrentMailboxSize
&$filter=Date ge DateTime'2016-03-08T00:00:00'&$orderby=Date desc
So the questions are:
Is there a way to specify criteria so that only the latest record for each user is returned?
Is there a way to get it to order by Date descending--what am I doing wrong with the $orderby?
Thanks!
You can use $top=1 to get latest record by applying $orderby on date (desc). $filter and $skip may not require in this case.
https://reports.office365.com/ecp/reportingwebservice/reporting.svc/MailboxUsageDetail/?DelegatedOrg=nnn.onmicrosoft.com&$select=Date,WindowsLiveID,CurrentMailboxSize&$orderby=Date desc&$top=1
Your query looks fine, here is an another example from Odata sample service to get employee detail with most recent birth date.
http://services.odata.org/V4/Northwind/Northwind.svc/Employees?$select=EmployeeID,FirstName,LastName,BirthDate&$orderby=BirthDate%20desc&$top=1

Is there a way to find the deleted transactions by list Id?

My goal is to find the deleted transactions during a period of the time for a list of jobs. The period of the time can be different from job to job. I am currently using TxnDeletedQueryRq but the request only provides filter on date range. I tried to look into other requests, but no luck so far. I am wondering if anyone knows a way to achieve this.
Thank you.
The only way that I can think of would be to create an audit trail report and parse for the state "Deleted". This allows you to set an entity filter for the name, plus you could set the modified date range an the report period to maybe help narrow down the information you would need to parse:
IGeneralDetailReportQuery report = MsgRequest.AppendGeneralDetailReportQueryRq();
report.DisplayReport.SetValue(false);
report.GeneralDetailReportType.SetValue(ENGeneralDetailReportType.gdrtAuditTrail);
report.ReportEntityFilter.ORReportEntityFilter.FullNameList.Add("Customer");
report.ORReportPeriod.ReportPeriod.FromReportDate.SetValue(fromDate);
report.ORReportPeriod.ReportPeriod.ToReportDate.SetValue(toDate);
report.ORReportModifiedDate.ReportModifiedDateRangeFilter.FromReportModifiedDate.SetValue(fromModDate);
report.ORReportModifiedDate.ReportModifiedDateRangeFilter.ToReportModifiedDate.SetValue(toModDate);

Need a specific operation to be performed on Fogbugz api

I need to get some very specific information from the FogBugz API. Although I can spend time with the API documentation but I was just wondering if folks here had experience with it and might offer some help.
I need this information - for a given date range and a given person I want to know how much time he spent on the tickets.
So, we use the 'working on' feature a lot and I think we can get this info using this feature somehow. Not sure.
So what command/query should I be looking at?
Any suggestions/pointers would be helpful!
Thanks a bunch!
The FogBugz XML API can get you what you're looking for via the listIntervals command in the Time Tracking section:
cmd=listIntervals - returns all TimeIntervals for a user. Any of the optional arguments serve to filter the results.
Arguments
ixPerson (optional) - Specifies which user's intervals should be returned. If omitted, list intervals for the logged on user. If set
to 1, list intervals for all users. Note that you must be an
administrator to see time interval information for users other than
the logged on user.
ixBug (optional) - Specifies that only intervals associated with this bug should be returned.
dtStart, dtEnd (optional) - If dtStart and/or dtEnd are supplied, listIntervals will return intervals whose start date falls
between dtStart and dtEnd.
So the query you'd be using would look something like this:
[your FogBugz url]/api.asp?token=[your XML API token]&cmd=listIntervals&ixPerson=[ixPerson you're interested in]&dtStart=[start date]&dtEnd=[end date]
For future reference, there is a FogBugz-specific Q&A site: http://fogbugz.stackexchange.com

Find WorkItems that were assigned to X in the last 30 days

I'm trying to find all WorkItems that were assigned to a person X in the last 30 days.
The big problem I have is the "in the last 30 days"-part.
I thought about using the "ever" or "asof" keywords, but couldn't find a good answer yet.. something like WHERE [Assigned To] = 'X' AND (([Assigned To] != 'X') asof '<30daysago>').
But this is still not a bulletproof solution.
Any better ideas?
Thanks & kind regards
Simon
It appears that this is not possible using just WIQL, but you can get close.
The keyword #Today will give you today's date, then just subtract your range from it. The EVER keyword applied to [Status]='AssignedTo' and a comparison against a date 30 days in the past to [StateChangeDate] is what you'll need to accomplish this.
As close as you can get with WIQL and existing fields:
This says, from all revisions (status changes) return records where the user 'X' has ever been AssignedTo and the State has changed in the last 30 days. This will basically give you a slightly fuzzy picture of what your User has been working on in the last month.
WHERE [Microsoft.VSTS.Common.StateChangeDate] >= #today - 30
AND [System.AssignedTo] EVER 'Bennett Aaron'
ORDER BY [System.State]
Add the missing field:
You could add a custom field called AssignedDate that is captured during the New->AssignedTo workflow transition that you create in the Work Item Definition XML. You can accomplish this using the Team Foundation Server Power Tools extension to Visual Studio. This would give you exactly what you need as well as additional reporting options going forward.
TFS API
I cannot help you with this one, but I believe you could query using the TFS API.
A couple of quick gotchas I've experienced to save you time on ASOF and EVER:
AsOf won't help you by itself with this as it does not support a range of dates. It allows you to query as if it were another date. In other words, if you forgot to capture the results of a query yesterday, you can use an AsOf query to get the results that you would have gotten had it run yesterday. What I understand is that you want to query a basic date range.
EVER might not work as you expect against dates as I believe it uses the exact value of the field (timestamp portion of the date field would be included) it tests with. Just make sure the EVER keyword is used against the status field rather than a date.

Resources