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?