1

I am calling the Moodle API (core_user_get_users) and trying to retrieve the user's first name and last name fields. According to the API's source code, the firstname and lastname fields are VALUE_OPTIONAL. I am not sure whether these fields are something you configure through a CFG file on the server, something the calling method can pass as a parameter to indicate which additional fields you are wanting back, or if it's something you set in the Moodle website. I have found a number of other people (1 & 2) with the same issue but no explanation as to how to affect the change.

How do you configure optional fields to be returned by the Moodle API?

Flea
  • 1,490
  • 2
  • 19
  • 43
  • Instead of adding the user to its own group, assigning it to the Manager group now brings back the optional fields. It's unclear as to where to make the change to the permissions of the non-system group to also get back the appropriate fields. – Flea Jun 25 '18 at 19:37

1 Answers1

1

Additional fields in the response through api are transmitted if the user whose token you are using has the right to receive this information.

walkmanyd
  • 11
  • 1