API Documentation
|
where {orgGroupId}
is the ID of an organisation.
POST
- adds new Cocoon Data user accounts 1 in bulk from a CSV file to an organisation (specified by orgGroupId
).This API endpoint adds new Cocoon Data user accounts 1 in bulk from a CSV file to an organisation (specified by orgGroupId
).
1 If a Cocoon Data user account is not already registered on the Cocoon Data Platform, then making this request automatically creates this user account.
This API endpoint supports requests utilizing Cocoon Data user accounts with the following roles (as described in the Organisation Administrator's Guide) and conditions:
{orgGroupId}
in the request's URL.The Cocoon Data Platform's resources available to a Cocoon Data user meeting the criteria above is determined by the access token submitted in the header of requests to this endpoint.
The appropriate access token as the Bearer
token:
Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE0NjcwMTY2NjYsInVzZXJfbmFtZSI6ImFsZXgub...
The following header is also required in the request to allow multi-part (including binary) form data elements to be uploaded through the request:
Content-Type: multipart/form-data
Note: It is also worth appending to this header a
boundary
parameter, whose string value is used to demarcate each multi-part form data element of the request (i.e. this string is not used for any other purpose throughout the entire request).
For example, to use the following string to demarcate each multi-part form data element:
-----------------------------12345678901234567890123456
assign this string value to theboundary
parameter, which in turn is appended to theContent-Type: multipart/form-data
header, such that this header will be:
Content-Type: multipart/form-data; boundary=-----------------------------12345678901234567890123456
The following required parameter must be sent in the body of the POST request, as an individual multi-part form data element:
If the request succeeded, then an HTTP response status 200 OK
is returned.
For successful requests only, a JSON-formatted response containing the following members is also returned:
true
) or not (false
) any of the user accounts specified in the CSV file were successfully imported into the organisation specified by {orgGroupId}
in the URL. server.userimportjob.imported.
This I18N code could include the substring plural
, single
or none
. plural
, this array contains a sub-array whose values are the argument usernumber, followed by the number of users who were successfully imported into the organisation. server.userimportjob.
This I18N code could include one of these substrings: invaliduserrole.exclusionviolation
invaliduserrole.cannotdowngrade
invaliduserrole.toofewroles
invaliduserrole.toomanyroles
invaliduserrole.invalidrole
invaliduserrole.missing
invaliduserrole.unsupported
invaliduserrole.mappingerror
invaliduserrole.badcsvformat
invaliduserrole.savefailed
formaterrors
formaterrors.validatedrowcontent
bizlogicerrors
defaultplan.missing
orgquotaexceeded
createuser.failed
invaliduserrole.exclusionviolation
- this array contains a sub-array whose values are the argument exclusionViolations. invaliduserrole.cannotdowngrade
- this array contains a sub-array whose values are the arguments originalrole and downgraderole, whose respective values are strings representing the role the user originally had in this organisation, followed by the new (i.e. downgraded) role being applied to this user. invaliduserrole.toofewroles
- this array contains a sub-array whose values are the argument min, followed by the minimum number of roles that must to be applied to the user. invaliduserrole.toomanyroles
- this array contains a sub-array whose values are the argument max, followed by the maximum number of roles that can to be applied to the user. invaliduserrole.missing
- this array contains a sub-array whose values are the argument useremail, followed by the email address of the user to be imported into the organisation, who did not have a role specified in the CSV file. invaliduserrole.unsupported
- this array contains a sub-array whose values are the arguments rolename and useremail, whose respective values are strings representing the unsupported role for the user (represented by their email address) in the CSV file. invaliduserrole.mappingerror
- this array contains a sub-array whose values are the arguments role and email, whose respective values are strings representing role being applied to the user (represented by their email address) in the CSV file. defaultplan.missing
- this array contains a sub-array whose values are the argument orgGrpName, followed by the name of the organisation which does yet not have a default plan configured. createuser.failed
- this array contains a sub-array whose values are the argument useremail, followed by the email address of the user which the Cocoon Data Platform failed to create for an unknown reason.