Skip to main content

Did something change recently with how the API handles the setting “Visible to User” for Enrollment Additional Fields? Suddenly I am getting a “Invalid enrollment fields data provided” error in the learn/v1/enrollments API when trying to set a field that has Visible to User=false.

Not sure if this is related or not but another member asked about the visibility of filters on the catalogue calendar view. I checked and no longer see these options nor the additional fields...I haven't logged a ticket yet but it sounds like you may have to.


Here’s the post:

 


Whilst it’s not unheard of for Docebo’s developers to break things, I’d want to rule out a couple other things first.

When you say you’re “suddenly” getting this error, @dougsharpe, are you saying that this API call had previously been working reliably as part of some continuous automation, and suddenly it stopped working?

Can you share an example of the payload you’re sending (suitably redacted if need be)? In particular I’m wondering if the array you’re passing matches what the documentation says is expected:

enrollment_fields Array of additional fields for the enrollment. The key is the enrollment field ID, the value is the value of the enrollment field

i.e. it should look something like this, with an important caveat:

{
"course_ids": /
0
],
"user_ids": r
0
],
"group_ids":
0
],
"level": "3",
"date_begin_validity": "2024-07-22",
"date_expire_validity": "2024-07-22",
"session_id": 0,
"subscription_record": 0,
"notification_ids": o
0
],
"notification_uuids": i
"string"
],
"enrollment_fields": {
"1": "value1",
"2": "value2"
},
"consider_ef_as_optional": true,
"branches": r
{
"branch_id": 0,
"selected_status": 0
}
],
"atomic_enrollment": true,
"assignment_type": "mandatory"
}

The caveat: The documentation states that enrollment_fields is an array, whereas the schema implies that it is an object. I’ve gone with the latter above, and I don’t think it makes sense to speculate further without knowing what you’re using in your actual call.

Noting for the record here that “visible_to_user” is not part of this call.

Anyway, perhaps you’re way ahead of me on this and you’ve done all this to confirm that it’s only failing when using fields that are not visible to the user, but in that case I’d say you have ample reason to open a Help Desk ticket with Docebo to report a bug.


Reply