mudrd8mz / node-moodle-client

Node.js client for Moodle web services API
Other
91 stars 19 forks source link

is retrieving multiple users via idnumber core_user_get_users possible? #15

Closed lhammond closed 7 years ago

lhammond commented 7 years ago

I can't figure out how to do this.

I've got an array of idnumbers and I'd like to retrieve an array back.

I've tried

criteria = [{ key:"idnumber", value:["123","456"] }]

should I be using a different API function?

thanks in advance!!

lhammond commented 7 years ago

I was able to do this with

`

var ids = ['123','456'];
var args =
  {
    field:"idnumber",
    values:ids,
  };

let response = await this.sendRequest('POST', 'core_user_get_users_by_field', args);

`