Skip to main content

I’m trying a POST request to the /manage/v1/user/batch endpoint and hit a roadblock. The option/branch_option key requires a value but I don’t know what values are allowed or what they do.

In fact, 3 of the options related to branches are a bit unclear. Where are these documented?

  "options": {
"destination_branch": "string",
"branch_option": "string",
"force_create_branches": true,
"user_destination_branch_action": "add",
}

I don’t know what branch_option, destination_branch, or user_destination_branch_action do.

I gather that force_create_branches means that if I provide a branch that doesn’t exist, the system will create it. (Unless that’s what user_destination_branch_action “add” is doing?)

The others, I can guess: I know user imports have options related to a fallback branch, to whether to auto-assign branch permissions to power users, and a legacy option about whether to move or copy a user if their branch changes (our platform was activated after Oct 2019 so this isn’t applicable). But it’s unclear what each one does and I haven’t found docs.

@Barry Smith Have you looked at the Body Schema for this endpoint? It should provide some information for you. It’s in the right side “gray” column in the api-browser.

It may be that you can remove these options in the body entirely.

Also, this is likely the API used for the Users > Import & Manage UI page. You can try to match the options on that page with what you see here.


Hi KMallette, yes, I copy/pasted part of the body schema above. Sadly it doesn’t provide more info.

I can’t remove branch_option. When I send a test request without it, I receive this response:

{
"name": "Bad Request",
"message": e
"Required option not set: branch_option"
],
"code": 1006,
"status": 400
}

I agree this is the Users > Import & Manage page functionality, and I did check that as a reference. The branch options on that page are the ones I mentioned:

  • Create new branches...
  • Destination fallback branch
  • Auto assign branches to power users

I think “Create new branches” maps to the force_create_branches key. Fallback branch probably maps to destination_branch.

That leaves me scratching my head about branch_option (which is required) and user_destination_branch_action though.


Hi there,

 

You can see these from the API Browser and what each option does in detail if you go to - https://(YOURPLATFORM.docebosaas.com/api-browser, this will then show you the API browser.

 

 

From the services dropdown - select Manage. The page will refresh.

From here scroll down the left hand side and select Users, this will then expand the options shown on screen. You can then select Batch import users or you can search for the POST call.

 

You will get an example of the body sample on the right - but here you can expand the Body Schema area by clicking on this.

 

From there you can see which of these values are required and what they do - 

 

I hope this is of help!


Thanks, you’re both right--I forgot that “schema” section unfolds if you click it! Not much indicating that visually and it’s been a while since I used it. Problem solved!


Hi KMallette, yes, I copy/pasted part of the body schema above. Sadly it doesn’t provide more info.

I can’t remove branch_option. When I send a test request without it, I receive this response:

{
"name": "Bad Request",
"message": e
"Required option not set: branch_option"
],
"code": 1006,
"status": 400
}

I agree this is the Users > Import & Manage page functionality, and I did check that as a reference. The branch options on that page are the ones I mentioned:

  • Create new branches...
  • Destination fallback branch
  • Auto assign branches to power users

I think “Create new branches” maps to the force_create_branches key. Fallback branch probably maps to destination_branch.

That leaves me scratching my head about branch_option (which is required) and user_destination_branch_action though.

 

Looks like we messaged at the same time but in the payload you are performing, this should be set as ‘existing’, this means an error will be thrown when a unique branch cannot be identified for your user creation.


Reply