Skip to main content
Answer

Create user in different branch through API

  • October 3, 2022
  • 4 replies
  • 543 views

How to create user in particular branch through API

POST /manage/v1/user

The setting 

"orgchart": {
"__branch_id__": 8
},

in payload does not work. The user always is created in root branch. The only way to change branch is from UI.

Best answer by John

Here is an example snippet for creating a user, while also assigning them to a branch location at the same time, using the manage/v1/user endpoint. The formatting should follow similar to this:

"select_orgchart":{"35":2},

This explanation from the API-Browser description of the Org Chart field shows this:

 

4 replies

John
Docebian
Forum|alt.badge.img+3
  • Docebian
  • Answer
  • October 10, 2022

Here is an example snippet for creating a user, while also assigning them to a branch location at the same time, using the manage/v1/user endpoint. The formatting should follow similar to this:

"select_orgchart":{"35":2},

This explanation from the API-Browser description of the Org Chart field shows this:

 


Bfarkas
Hero III
Forum|alt.badge.img+6
  • Hero III
  • October 10, 2022

Get very comfortable with the queries for the branch structure :)

I keep a cheat sheet of these for my easy reference, but have to update when new branches get created (use a webhook to be notified and given the info for the new branch)


  • Author
  • Contributor II
  • October 10, 2022

@John , It’s really trick in payload. I did not see the description there. Thank you!


John
Docebian
Forum|alt.badge.img+3
  • Docebian
  • October 10, 2022

You are welcome @liza2022! Thanks for being patient while you awaited a reply (and thanks for marking Best Answer)!