Best Answer

Issues with API: PUT /manage/v1/user/{userid}

  • 16 December 2021
  • 3 replies
  • 532 views

Userlevel 7
Badge +1

FYI, I have just opened a case with Docebo support about the following issue.

 

Since at least two hours (3 pm CET) I’m observing that our user management script, which is using PUT /manage/v1/user/ API to update some user fields, is only receiving error 400 responses with the message:

{
  "name": "Bad Request",
  "message": {
    "field": "email",
    "message": "You haven't filled in some mandatory fields"
  },
  "code": 1002,
  "status": 400
}

However, users which we are willing to update already exist and have their email addresses set.

There are no outages mentioned on the Docebo status page (we’re in the US data center), and the last time when the API did work, was at about 9:30 am CET today (we didn’t use it between 9:30 am and 3 pm).

icon

Best answer by alekwo 17 December 2021, 12:04

View original

3 replies

Userlevel 2
Badge

This may or may not be related, but are you using the parameter ```userid```, at all? Because when we were developing our API connection, we discovered that even though this says `userid`, it's actually the string of username! 

Still, this doesn’t answer the question of it working 3 hours ago and not working now...

Userlevel 7
Badge +1

Hi @dominyza thanks for the suggestion.
We have this script in production since over a year, so the code is already well tested and proven. 

And no, we are only updating the branch (select_orgchart) and a few values in additional_fields. The userid is part of the URL and here it is the internal Docebo numeric identifier.

Userlevel 7
Badge +1

As per the https://www.docebo.com/product-updates/ page, there was an update affecting the API implemented in this week (yesterday), however, the description of the change only mentions that username will have to be the same as the email address, while it seems that this introduced a bug in the way the API is checking required data when making an update. Now, for some strange reason Docebo made the email field required with every update, even if the email already has a correct value and doesn’t need to be updated. 

 

So instead of calling:

PUT manage/v1/user/12345

{"additional_fields":{"7":"4","14":"false"},"select_orgchart":1}

as of yesterday (and until Docebo will fix it) you have to always add the email to the body of the update:

PUT manage/v1/user/12345

{"email": "user@mailinator.com","additional_fields":{"7":"4","14":"false"},"select_orgchart":1}

 

Still waiting for support to respond with an ETA for a fix.

Reply