Search code examples
apidesire2learnvalence

Query Parameter Use in Valence


I was trying to retrieve an assessment using Valence however an unsure about how to attach the Query Parameters

Assessment API

I've tried attaching it as data in the ajax call, as well as GET parameters in the URL.

$.ajax({
'd2l/api/le/1.0/61399/assessment',
    {
        method:'GET',
        headers: {
            'X-Csrf-Token': localStorage['XSRF.Token']
        },
        data: {
            assessmentType: 'Rubric',
            objectType: 'Dropbox',
            objectId: 559230,
            userId:97197
        }
    }
}).done(function(data){console.log(data););

Am I going about it wrong somewhere? There is a typo in the API for the first parameter -assessmentType vs asssessmentType.... but I'm assuming it is supposed to be spelled the correct way.

Thanks in advance for your assistance :)


Solution

  • Everywhere I've gotten GET parameters to work in the API have been on the url:

    d2l/api/le/1.0/61399/assessment?assessmentType=Rubric&objectType=Dropbox&objectId=559230&userId=97197

    but I tried this on my system with one of my own rubrics on a dropbox assignment and I get nothing back. The API docs do say that this is an unstable route, so that may be a problem.