[Loris-dev] LORIS jason API for CANDIDATE creation - leading to incorrect PROJECT entry

Xavier Lecours Boucher, Mr xavier.lecoursboucher at mcgill.ca
Mon Jul 17 11:59:32 EDT 2017


Hi,


The API version in 17.0.5 does not implement PUT nor PATCH request at the candidate level. The good thing about that is that you are free to implement it the way you want.

Here is an basic example : https://github.com/aces/Loris/compare/17.1-dev...xlecours:candidate_patch?expand=1

that allow to update any field of the candidate table provided in a object of the form {Candidate: { field1: value1, field2...}}


`curl -H "Authorization: Bearer $token" http://localhost/api/v0.0.2/candidates/273164 -X PATCH -d '{"Candidate": {"DoB": "1992-07-02", "EDC": "1992-07-01"}}'`


** Please not that this is not really secure since it allow to replace ANY fields in the candidate table.


On a side note, in 17.1 the project name will be attach right after the candidate creation; see https://github.com/aces/Loris/pull/2863/files#diff-27f79abaa4a78d1688dcfce2eca6eadaR161


<https://github.com/aces/Loris/pull/2863/files#diff-27f79abaa4a78d1688dcfce2eca6eadaR161>

I am hopping this helps.


Thank you for your interest in LORIS. Feel free to ask any other question.


Regards,

- Xavier L.


________________________________
From: loris-dev-bounces at bic.mni.mcgill.ca <loris-dev-bounces at bic.mni.mcgill.ca> on behalf of István Ákos Mórocz <istvan.morocz at mcgill.ca>
Sent: July 14, 2017 2:42 PM
To: loris-dev
Cc: Jordan Stirling; Haz-Edine Assemlal
Subject: [Loris-dev] LORIS jason API for CANDIDATE creation - leading to incorrect PROJECT entry

dear LORIS developers,

we try to insert new CANDIDATES into LORIS via its API, either with
jason scripts or jason strings included in the curl call.  example:

cat /var/www/IPMSA/Loris/newCand.json

{
     "Candidate" : {
         "Project" : "BRAVO",
         "PSCID"   : "xSVwx1At",
         "EDC"     : "1971-01-01",
         "DoB"     : "1981-01-01",
         "Gender"  : "Female"
     }
}

the problem is that nor in the LORIS GUI nor in the mySQL database is
our Project entry 'BRAVO' found.  it simply defaults to ProjectID 1.

is there a way to adjust this PROJECT at a later stage via the LORIS
API and jason PUT calls ?  we also intend to adjust the same way many
other fields such as SUBPROJECT (or COHORT) and more.

specs : LORIS 17.0.5 on mini-Ubuntu/Xenial 16.04 VM and VirtualBox

thanks for looking into this, bye, pisti


   ,-*~'`^`'~*-,._.,-*~'`^`'~*-,._
  '
:        http://noisis.com
  `    istvan.morocz at noisis.com
  :        +1-514-927-1169
  :    istvan.morocz at mcgill.ca
  :  http://cafe.spl.harvard.edu
[http://cafe.spl.harvard.edu/img/fig.dyscalculia_paper_040913.model3D_animated.gif]<http://cafe.spl.harvard.edu/>

Laboratory for Cognition And Functional Evidence<http://cafe.spl.harvard.edu/>
cafe.spl.harvard.edu
Laboratory for Cognition And Functional Evidence Home | Contact Us | Credits. About CAFE Mission; Projects; Collaborations; fMRI Facilities


  ,    http://www.pistikem.org
pistikém.org pistikem.org<http://www.pistikem.org/>
www.pistikem.org
photography photographie fenykep fénykép fotografie fotografia pisti pistikem pistikém istvan akos morocz István Ákos Mórocz boston harvard montreal montréal


:       pistikem at gmail.com
  .
   `~*-,._.,-*~'`^`'~*-,._.,-*~'`"
_______________________________________________
Loris-dev mailing list
Loris-dev at bic.mni.mcgill.ca
http://www.bic.mni.mcgill.ca/mailman/listinfo/loris-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.bic.mni.mcgill.ca/pipermail/loris-dev/attachments/20170717/7eef8f13/attachment.html>


More information about the Loris-dev mailing list