Get Response Date with get_responses - surveymonkey

We know we can query for responses between dates using get_respondent_list, however, how can we retrieve the actual response date that corresponds to when the survey was taken? Is this exposed through the API?

When you call get_respondent_list you can request the date_start and date_modified fields. These contain when the survey response was started and when it was last modified by the user, i.e. when they finished the survey or last updated it. You can't get any more detailed information than that (e.g. a full list of dates that the survey response was updated by the user).

Related

Create an automatic status change for room booking in Spreadshee

Trying to set up a Google Sheet that can automatically determine request status based on previous request.
So the flow start with Zapier pushing information to this sheet and specific row
Data Entry Sheet
*The data here will be replaced every time there is a new booking request so the number of cell will always be the same.
The approval system that is needed use the "first come first serve" rule where as long as there is no previous request that match the time within the request, google sheet can directly says it's approved, otherwise it is rejected.
The problem is we need to know if there is already another approved request that is submitted before the request that we want to check. This is the sheet we use to track all previous request
Sheet of Previous Request
Is there any way we can compare the data from "New Request" Sheet to all of previous request in "Reservation" Sheet?
Also another question, can we add all the the request that came in into the list of previous request?
Thank You!
Basically I haven't tried any combinations of command but I have try using filter or array individually but it doesn't work.
This is a new project so there is no previous result I can show but the expected result is all the request will have their request status filled so Zapier can return that request status to it's requestor.

Slack API - User details last updated date

I am using https://api.slack.com/methods/users.lookupByEmail Slack Web API to get user details. Does the 'updated' property in the response represent the last updated date, if so what format is it in? Or is there any other way to get last updated date of user details/profile.
Yes, updated property in the response represent the last updated date.
It is in epoch time,
you can find more details about epoch time here:
https://www.epochconverter.com/
you can also get the same data by using users.info api method:
https://api.slack.com/methods/users.info
Thank you #Suyash Gaur I tried it and it works. Marking this as the answer.

How to find all 'retweet with comments' for a particular Tweet using API?

I want to get all the 'retweets with comments' of a tweet.
Here are few things I noticed with twitter api
Retweets with comments are treated as tweets. The retweet count does not increase if you add a comment, also the twitter message is "XYZ quoted you instead retweeted you'
You clearly can't use this API endpoint https://dev.twitter.com/rest/reference/post/statuses/retweet/:id
Is there a way to find all the 'tweet/retweet with comment' if you can supply the original Tweet/Id?
So you're referring to Quoted Tweets (retweet with comments). There is no official method for that from the REST API yet, however, there are couple of ways to do it.
Since all quoted tweets contain the short url to the original one,
you can still use in_reply_to_status_id and filter by short url of the original tweet
Search for tweets that contain the field quoted_status_id this can be done either through REST or STREAMING API.
quoted_status_id: This field only surfaces when the Tweet is a quote Tweet. This field contains the integer value Tweet ID of the quoted Tweet.
This isn't easy to accomplish. Here's the brute-force API method to find Quote Tweets.
Take your tweet id, it'll be something like 750176081987014657.
GET search/tweets
Use the Twitter API and search for the tweet.
https://dev.twitter.com/rest/reference/get/search/tweets
The GET request will look something like this:
https://api.twitter.com/1.1/search/tweets.json?q=750176081987014657&count=100
The q "query" argument is the tweet id. I've set the result count argument to the maximum (100).
Authorization
Of course with the Twitter API there's a whole bunch of tricky Authorization header work you have to do as well in order to complete the GET request. That's documented elsewhere and is beyond the scope of this answer.
Results and Conclusion
When you have the JSON results of this GET request, focus on the statuses collection. For each tweet in the collection (otherwise known as a "status"), check if it contains a quoted_status_id field. If it does, and the field value matches your tweet id, the tweet is a quote tweet. If it does not, it is simply a retweet with no added comment. You will also have to deal with iterating through the pagination of results if there are more than 100. That's done by looking for a search_metadata.next_results field and retrieving the next GET query string from it, which will be provided for you.

Twitter API and operator

I want to make a simple Twitter API get using JSON. The idea is to get only the posts from a known corporation (say BigCorporation) sent to the main corporation (#BigCorporation). The idea is to just get the main annoncements and filter out anytime the BigCoporation answer a question from a follower (i.e. BigCoporation tweets: #someguy we are anwering your question)
So Tweets from:BigCoporation with the #BigCorporation
I came up with this API get but I seem to get both #BigCorporation or from:BigCorporation tweets. I want only the Tweets that are #BigCorp AND from:BigCorp
http://search.twitter.com/search.json?q=#BigCorporation&q=from:BigCorporation&result_type=mixed
Your search query is malformed.
It should be:
http://search.twitter.com/search.json?q=#edent%20from:edent&result_type=mixed
That will show you all the tweets I have sent which contains the string "#edent"
You can use this URL :
https://api.twitter.com/1/statuses/user_timeline.json?screen_name=BigCorporation&exclude_replies=true
The REST method GET https://api.twitter.com/1/statuses/user_timeline.json returns the most recent tweets (20 by default) of a user whose username (here BigCorporation) is in the parameter screen_name. When set to true (or t or 1), the exclude_replies parameter excludes the tweets that you want to avoid ("#someguy we are anwering your question").
You can visit this page on the Twitter API website for further details.

How do I get the date a text message was sent to my Twilio number?

I try to get and analyse data from text with the Twilio API. With their example, I can get the phone number from the text is sent, but I would like to get the datetime and the body of the message.
For the phone nmber you just have to use that:
$phone = $_REQUEST['From'];
It works also for To and Body but I tried with DateSent and it's not working.
$date = $_REQUEST['DateSent'];
Do you have an idea about what could be the word to get it?
According to the Twilio Docs the date is not sent as a parameter. However, you can use the Rest API to retrieve the SMS using the $_REQUEST['SmsSid'], and the returned data will contain a DateCreated.
Note: As John commented, unless you really need the 'official' timestamp, it's essentially the current time. Also note that if you try to query the API for a message that just came in, it may not have propagated, so you may not not get the data you're requesting.
If there's some use case where you can't just use the current timestamp, that would be interesting.

Resources