[Loris-dev] Instruments API

Xavier Lecours Boucher, Mr xavier.lecoursboucher at mcgill.ca
Wed Dec 5 10:03:10 EST 2018


Hi Ali,


HTTP 500 are returned on server errors. More info about the cause should be available in your server apache error.log

I notice that the instrument values part of the filled_form use the question and answers label instead of the keys.


Could you try with :


filled_form = {
    'Meta': {
        'Instrument': InstrumentName,
        'Visit': VisitLabel,
        'Candidate': CandID,
        'DDE': boolean
    },
    InstrumentName: {
        "first_test": "a"
    }
}

where the InstrumentName object's key is the question name instead of the question label and the value is the enum key instead of the label.
Please let us know of the results.

- Xavier

________________________________
From: Ali Aarefi <aliaarefi1997 at gmail.com>
Sent: December 4, 2018 3:12 PM
To: Xavier Lecours Boucher, Mr
Cc: loris-dev at bic.mni.mcgill.ca
Subject: Re: [Loris-dev] Instruments API

Hello,

I tried that script with InstrumentName = "ft".
The result was a response with code 500.

Thanks for your quick response,

- Ali

On Tue, Dec 4, 2018, 9:49 PM Xavier Lecours Boucher, Mr <xavier.lecoursboucher at mcgill.ca<mailto:xavier.lecoursboucher at mcgill.ca> wrote:


Hello,

>From what I can see, the instrument name in the linst file is "ft"

Can you try the same script with InstrumentName=ft ?

When I send a PUT request to an non existant instrument name, I also receive a 405

Thank you

- Xavier Lecours

________________________________
From: loris-dev-bounces at bic.mni.mcgill.ca<mailto:loris-dev-bounces at bic.mni.mcgill.ca> <loris-dev-bounces at bic.mni.mcgill.ca<mailto:loris-dev-bounces at bic.mni.mcgill.ca>> on behalf of Ali Aarefi <aliaarefi1997 at gmail.com<mailto:aliaarefi1997 at gmail.com>>
Sent: December 4, 2018 8:57 AM
To: loris-dev at bic.mni.mcgill.ca<mailto:loris-dev at bic.mni.mcgill.ca>
Subject: [Loris-dev] Instruments API

Hello

Dear LORIS dev. team,

I'm trying to develop a script that automatically insert some information to specifically created instrument instance using restful API.(based on github doc<https://github.com/aces/Loris/blob/master/docs/API/LorisRESTAPI.md>, other doc<https://alisterdev.github.io/Loris/api/>)

I did use APIs of LORIS for authentication, candidate creation, time point creation and getting candidate and project information successfully. But now, I cannot use "3.3. The candidate instrument data<https://github.com/aces/Loris/blob/master/docs/API/LorisRESTAPI.md#33-the-candidate-instrument-data>" API (put request).

The related part of python script file and its outputs(within the .py file) is attached.
Also the used .linst file is attached.

Is there any solution to automatically fill an instrument form in loris?
Is it possible to write a script that reads from an Excel file and put those into LORIS previously-built instruments using API?

Best Regards,

Ali
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.bic.mni.mcgill.ca/pipermail/loris-dev/attachments/20181205/e6287867/attachment-0001.html>


More information about the Loris-dev mailing list