Survey Monkey Api - Get label text for response choice_id [duplicate] - surveymonkey

This question already has answers here:
How to get text response in survey monkey via API
(2 answers)
Closed 7 months ago.
I'm grabbing survey responses using "/surveys/" . $id . "/responses/bulk". For multiple choice questions, how do I include the label text for a response? Only choice_id is given. I've looked in the document and can't seem to find a clue.
Thanks!
Dylan

Use the following API endpoint pattern to fetch all the information on the question, including the selects:
https://api.surveymonkey.com/v3/surveys/{survey_id}/pages/{page_id}/questions/{question_id}

Related

GET or POST? Openapi 3.0.0 to retrieve element with complex set of conditions [duplicate]

This question already has answers here:
Design RESTful query API with a long list of query parameters [closed]
(4 answers)
How to send a huge parameter list to a GET request
(3 answers)
Rest POST VS GET if payload is huge
(5 answers)
How to desing RESTful advanced search/filter
(1 answer)
Closed 6 months ago.
I'm trying to design a (simple?) REST API using openapi3.0 and the Swagger tools (and sort of new to this, I should add).
One of the endpoints will retrieve a set of items (from a database of several thousand items) based on one or more 'filters', or set of conditions.
path:
/item/filter:
get:
Here is my first doubt: I have to pass a (potentially large) set of conditions to my query.
For example:
[
{"propertyName":"height","queryType":"EqualOrGreaterThan","targetvalue":"1200"},
{"propertyName":"color","queryType":"Equal","targetvalue":"green"},
{"propertyName":"weigth","queryType":"LessThan","targetvalue":"1.2"}
]
Does using the GET method imply that everything will be encoded into the URL itself? How will OAS/Swagger know that my URLs won't get too long? Or is this some parameter that I can tweak in the codegen part?
Alternatively, I could use the POST method, but wouldn't this be a betrayal of good API design, as this query would not be modifying the status of the system/database?
Also, GET or POST method aside, I will still need to model the complex query. Should I go with defining a 'filter' schema and have my request define an array of items with the 'filter' schema? Or am I missing a better API design strategy for a case like this?
Also, what about the backend? Will the format of the data the server receives be the same regardless of POST/GET and, above all, regardless of the programming language used for the backend? (.NET, Python Flask, Java, PHP,...)?
During tutorials it looks easy, but I'm sort of confused right now.

IMPORTXML can't fetch from Yahoo Finance if there is a point in in the ticker [duplicate]

This question already has answers here:
Scraping data to Google Sheets from a website that uses JavaScript
(2 answers)
Closed last month.
Basically the title: I can fetch data from Yahoo Finance for ASML ticker by
=IMPORTXML("https://finance.yahoo.com/quote/ASML/", "//*[#id=""quote-header-info""]/div[3]/div[1]/div/span[1]")
but it doesn't work if there a point/dot "." in the ticker:
=IMPORTXML("https://finance.yahoo.com/quote/ASML.AS/", "//*[#id=""quote-header-info""]/div[3]/div[1]/div/span[1]")
returning the infamous
#N/A
error. I would appreciate it if you could help me know what is the problem and how I can resolve it.
P.S.1 Please note that the above URLs are both valid pointing towards different stocks.
P.S.2. I wrote a relevant post here.
P.S.3. The same issue was also identified by this post.
I do not know why all tickers with dots are not returning properly, but you can try using Apps Script as alternative via UrlFetchApp.fetch and use this custom function I created.
Script:
function customImportXML(link) {
var regex = /span class="Trsdu\(0.3s\) Fw\(b\) Fz\(36px\) Mb\(-4px\) D\(ib\)"[^>]*>([^<]*)</g;
return regex.exec(UrlFetchApp.fetch(link).getContentText())[1];
}
I used the class as identifier as the data-reactid is not permanent.

How to get value of object dynamically using a string [duplicate]

This question already has answers here:
Calling a Method From a String With the Method's Name in Ruby
(4 answers)
Closed 3 years ago.
I have a table of scores that need processing at certain points. I am trying to avoid having walls of repetitive code so I am trying to get the values dynamically just by sending in the metric value but I cannot seem to get the syntax right and wasn't even sure how to properly search for this.
A typical value I need is something like this
s = score.total_weighted_strategic_values_score
All of these have the same structure to the name but one part changes based on the metric, so I have been trying something like this
s = score.total_weighted_"#{metric}"_score
Where metric is equal to a string strategic_values or whatever the metric is named.
This throws a syntax error, however, and I cannot find anything else to try. any help would be greatly appreciated, thanks!
You need to use public_send:
s = score.public_send("total_weighted_#{metric}_score")
Some more reading on it:
http://vaidehijoshi.github.io/blog/2015/05/05/metaprogramming-dynamic-methods-using-public-send/

Check variable exists in current url in classic asp [duplicate]

This question already has answers here:
How to check if a POST submitted field exists in VBScript?
(4 answers)
Closed 5 years ago.
Is there a way to check if a variable exists on the current page in asp? i.e.
For the url: https://stackoverflow.com/?question=something
I'd like to check if the ?question variable exists.
<%Request.ServerVariables("Query_String")%> would give question=something but I just want to know if the current url contains ?question. I don't care what the actual value is as long as it exists.
Ask the Request collection:
HasParam = Request("question").Count > 0

How To Get An Unique ID? [duplicate]

This question already has answers here:
Closed 12 years ago.
How can i get an unique id from one of installed hardwares? Something like h.d.d serial or motherboard, ....?
Thanks
Check this URL : http://www.diskserialnumber.com/
http://www.diskserialnumber.com/get-disk-serial
Better one:
http://www.codeproject.com/KB/cs/hard_disk_serialno.aspx
We use http://www.magsys.co.uk/delphi/magwmi.asp and are very happy with it.

Resources