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

István Ákos Mórocz istvan.morocz at mcgill.ca
Tue Jul 18 10:23:29 EDT 2017


i meant of course 'POST' - and not 'PUSH', sorry about that... 
here again our example :

    curl -i -H "Authorization: Bearer ABCDEFGHUJKLMNOP" -H "Content-type:application/json" -X POST -d @newCand.json http://192.168.49.10/api/v0.0.2/candidates/


- or did you want to say that in LORIS 16.0.5 all three POST/PUSH/PUT
jason curl API requests will not work ?


bye, pisti


On Mon, 17 Jul 2017, István Ákos Mórocz wrote:

> thanks for your note, Xavier - we
> will have a look at your links !
>
> on the other hand i should have said
> PUSH (and not PUT) as this is the
> command included - like here in our
> example curl call :
>
>    curl -i -H "Authorization: Bearer ABCDEFGHUJKLMNOP" -H 
> "Content-type:application/json" -X POST -d @newCand.json 
> http://192.168.49.10/api/v0.0.2/candidates/
>
> so, with PUSH it seems to work
> partially but as said below it's the
> PROJECT field that doesn't get
> updated as expected.
>
> thanks much, bye, pisti
>
>
> On Mon, 17 Jul 2017, Xavier Lecours Boucher, Mr wrote:
>
>> 
>> 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
>> 
>> 
>> 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
>> [fig.dyscalculia_paper_040913.model3D_animated.gif]
>> Laboratory for Cognition And Functional Evidence
>> 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
>> 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
>> 
>> 
>
>  ,-*~'`^`'~*-,._.,-*~'`^`'~*-,._
> '
> :        http://noisis.com
> `    istvan.morocz at noisis.com
> :        +1-514-927-1169
> :    istvan.morocz at mcgill.ca
> :  http://cafe.spl.harvard.edu
> ,    http://www.pistikem.org
> :       pistikem at gmail.com
> .
>  `~*-,._.,-*~'`^`'~*-,._.,-*~'`"

   ,-*~'`^`'~*-,._.,-*~'`^`'~*-,._
  '
:        http://noisis.com
  `    istvan.morocz at noisis.com
  :        +1-514-927-1169
  :    istvan.morocz at mcgill.ca
  :  http://cafe.spl.harvard.edu
  ,    http://www.pistikem.org
:       pistikem at gmail.com
  .
   `~*-,._.,-*~'`^`'~*-,._.,-*~'`"


More information about the Loris-dev mailing list