Using ShareFile's API I would like to create a "Client User" but the existing documentation is not quite detailed enough to make the task straight-forward.
Please provide an example HTTP request and response that demonstrates the usage of the "Create Client User" endpoint.
Prior to issuing the request you will need to make sure the associated account has been set up and you have obtained an oauth2 token. If you log in with the ShareFile account and visit the documentation an oauth2 token that you can use will be displayed at the top of the page.
From there you need construct your request. Here is an example request with some details redacted using asterisks to protect the innocent:
POST /sf/v3/Users HTTP/1.1
Host: **********.sf-api.com
Authorization: Bearer **********
Content-Type: application/json
Cache-Control: no-cache
{"Preferences": {"CanResetPassword": true, "CanViewMySettings": true}, "FirstName": "Billy", "LastName": "Bobby", "Company": "Bobby's World", "Password": "**********", "Email": "**********", "DefaultZone": {"Id": "**********"}}
And here is an example response body:
{
"Email": "************",
"Username": "************",
"TotalSharedFiles": 0,
"Id": "************",
"Contacted": 0,
"FirstName": "Billy",
"ReferredBy": "************",
"IsConfirmed": false,
"LastName": "Bobby",
"Company": "Bobby's World",
"FullNameShort": "B. Bobby",
"DateCreated": "2017-02-13T22:19:07.92Z",
"odata.metadata": "https://************.sf-api.com/sf/v3/$metadata#Users/ShareFile.Api.Models.User@Element",
"url": "https://************.sf-api.com/sf/v3/Users(************)",
"Domain": "************",
"FullName": "Billy Bobby",
"odata.type": "ShareFile.Api.Models.User",
"Roles":
["Client", "CanChangePassword", "CanManageMySettings"],
"Emails": ["************"]
}
Along with the response body there will be a number of headers that may be useful depending upon your situation. In particular, pay attention to the Set-Cookie headers SFAPI_AuthID and SFAPI_SRVNAME. According to the documentation these values can be preserved by your client and used to ease the load on the ShareFile API servers for subsequent API calls.