List query

Retrieves individual records from the data set.

Query URL/MQL Client Command

MQL Client Command

select columnname, columnname,… from tablename where columname=value order by columname desc limit offset value

Query URL

https://api.medallia.com/yourcompany?user=username&pass=password&query=select+columnname%2C+columnname%2C... +from+tablename+where+columnname%3Dvalue+order+by+columnname+asc|desc+limit+<num>+offset+<num>+value&out

Parameters

select
Selects the value described by the remainder of the query terms.
columname
Any of the columns available in the system.
tablename
Any of the tables available in the system.
where
Filters the results. See Filtering.
value
A value corresponding to the datatype of the preceding columnname.
order by
Sorts the results. See Sorting and limiting.
asc|desc
Ascending (ASC) or descending (DEC) order
limit
Limits results. See Sorting and limiting.
offset
Used together with limit to page through a data set.

Counting the number of records returned from a list query

Just select the special count(*) value rather than a set of columns:

select count(*) from survey

For larger queries: "offset" command parameter

 

List queries can return a limit of 10,000 records (a query returning any more than that will result in an error). In order to gather more records than that, you'll need to paginate the results by making multiple queries with offset 0, 10000, 20000, etc. and adding a limit 10000 clause to each query. In addition, a select count(*) query should be used at the outset to determine the number of paginated calls necessary.

Sample request and response

Sample MQL Client Command

select fullname, responsedate, socialmedia_dealerrater_overall_experience, feedback_e2e_how_likely_are_you_to_recommen, bp_b2b_continue_scale, comments from survey where has_comment=1 order by responsedate desc limit 3 offset 3

Sample Query URL (OAuth)

https://api.medallia.com/data/v0/mql?output=json&version=1&query=select+fullname%2C+responsedate%2C+socialmedia_dealerrater_overall_experience%2C+feedback_e2e_how_likely_are_you_to_recommen%2C+bp_b2b_continue_scale%2C+comments+from+survey+where+has_comment%3D1+order+by+responsedate+desc+limit+3+offset+3

Sample Query Result (JSON)

{
    "query": {
        "resultCode": 0,
        "columns": [
            "fullname",
            "responsedate",
            "socialmedia_dealerrater_overall_experience",
            "feedback_e2e_how_likely_are_you_to_recommen",
            "bp_b2b_continue_scale",
            "comments"
        ],
        "table": [
            [
                "Simmons, Frances",
                "2019-11-20",
                "",
                "",
                "",
                "YOUR WEB SIGHT IS OUTSTANDING.  EASY TO USE AND FIND ITEM NEEDED.  EXTRA EASY TO CHECK OUT AND KNOW WHEN THE ITEMS ARE EXPECTED TO BE DELIVERED.    WISH ALL LAB SUPPLIERS SITES WERE AS GREAT AS YOURS!!"
            ],
            [
                "Willis, Benjamin",
                "2019-11-20",
                "",
                "",
                "",
                "DESCRIPTIONS! Boy, you are lacking on those. Many times it is difficult to see what is the difference between certain products. Sometime there even are non - just packaging or color is different or some other irrelevant things but it effects the pricing huge. E.g. 13-622-269: specification are for 1.2ml but descriptions talks about 2ml. What is the right volume now? Also a search to a product brings up irrelevant items. A search for to find methanol e.g. brings up that the item is methanol free. E.g. lack of description here in the chemically resistant markers 22-026-700. It states resistant to most histology chemicals - but actually after we purchased it, it is not resistant to Ethanol! Dont generalize. Tell us what it is resistant to and what not."
            ],
            [
                "Kelley, Annie",
                "2019-11-20",
                "",
                "",
                "",
                "Website specs are off on a bunch of products. EX. 08-549-17B it says that the capacity is both 25ML and 20ML. It is not the only item we have had issues with the specs. I am not sure why the specs of the new website are so off. It is stressful to not trust the specs given and double check every single time."
            ]
        ]
    }
}