General developer forum

API core_cohort_add_cohort_members parameters

 
Picture of ole norli
API core_cohort_add_cohort_members parameters
 

Hello

I am trying to add members to a cohort.


Does anyone know what is wrong with this request?


post to URI: 

...?moodlewsrestformat=json&wstoken=secret!&wsfunction=core_cohort_add_cohort_members


with Parameters:

 {

"members": [

{

"cohorttype": {

"type": "id",

"value": 169

},

"usertype": {

"type": "id",

"value": 1811

}

}

]

}


Response:

{

    "exception": "invalid_parameter_exception",

    "errorcode": "invalidparameter",

    "message": "Ugyldig parameterverdi oppdaget."

}


Thanks alot!

 
Average of ratings: -
Picture of ole norli
Svar: API core_cohort_add_cohort_members parameters
 


Params:

{"members":[{"cohorttype":{"type":"id","value":"169"},"usertype":{"type":"id","value":1811}}]}

 
Average of ratings: -
Picture of ole norli
Svar: API core_cohort_add_cohort_members parameters
 

found solution... has to post as form data! 

 
Average of ratings: -