Setup | User Method
Allows adding or modifying the user in your database. Authorized user must have ManageUsers privilege to call this method.
Parameters
- user’s email. Can be either email address as is or take the form of "Name" <email>. If user account does not exist it is created. In this case, account’s first and last names properties will be pre-filled from name part, if present.
- role
- The role to assign. Pass empty string (e.g. role= ) to disable user.
- defaultSet
- 1 to include user in default user set. 0 otherwise.
- external
- 1 if the user is external user.
- invite
- 1 to send default invitation letter, 0 to skip sending. Default is 0.
Request
GET https://www.teamdesk.net/secure/api/v2/{appid}/setup/user.{json|xml}?parameters
Response (JSON)
{
// 201 - created, 200 - updated
"status": 201,
// authorization ticket for invitation email
"ticket": "5c98ad47-c6ca-437d-8c2f-cb2f929c54b8"
}
Response (XML)
<Response>
<status>201</status>
<ticket>5c98ad47-c6ca-437d-8c2f-cb2f929c54b8</ticket>
</Response>
Sending a Custom User Invitation Letter
To send a custom invitation letter, set the invite parameter to 0 and construct the invitation URL based on the ticket property from the response.
If there is no ticket property in the response, then the user already exists, and you should include a direct link to the database in your invitation letter:
https://www.teamdesk.net/secure/db/{appid}/default.aspx
Otherwise, include the authentication URL:
https://www.teamdesk.net/secure/auth.aspx?uid={ticket}&dbid={appid}
When the user opens this URL, the system will ask them to complete registration by creating a password, setting their locale and time zone, and then redirect them to the database.