Skip to main content

Hello everyone!

I’m trying to assign a user their manager via API, but I get a response 200 (success) with the following message:

{

 "data": {

  "success": true,

  "user_id": 13115,

  "message": "Cannot assign manager to the user"

 },

 "version": "1.0.0",

 "_links": _]

}

Why can I not assign the manager?

My uncertainty is in the request structure:

"manager": {
    "__manager_type_id__": 0
  }

Should I set that “__manager_type_id__” as the manager’s ID? As a text (in quotes) or as a number? (both ways are not working, otherwise I would not be writing here 🙂 )

Can anybody advise? Thanks in advance.

Best,

Mauro

Mauro,

Hopefully you found the answer to this issue already since I’m responding 8 months after you posted it.  If not, or for others who experience the same issue, it’s a little confusing, but here’s what you do.

The Docebo API is expecting an object.  The correct response looks like this:

 

"manager": {
    "1": “12345”
  }

This assumes that the manager_type_id is “1”, which is the Direct Manager option configured by default in the portal.  The 1 is a string, therefore it must be enclosed in “1”.  Next, after the colon, manager_id(“12345”) of the user who is the user’s manager.  Again, it needs to be in quotes.  

Using this process you can assign a single user to multiple managers at the same time, like this:

"manager": {
    "1": “12345”,
    "2": “54321”,
  }

I hope this helps!

Michael

 


Reply