transform

POSTALL,CRU/createNewUserAccount

IN THIS PAGE

Arguments

useridCharacter

UserId

passwordCharacter

Password for the new user account

rolesCharacter

Comma delimited list of roles for the new user in the account the user is added to

displaynameCharacter

Display name for the user

Returns

resultJSON Object

Returns an object with these properties:

errorboolean

true if there was an error

errorTextstring
resultobject
rowsAddedToTransFormUsersTable
rowsAddedToTransFormRolesTable
rowsAddedToTransFormAccountmembershipTable

Description

Create a new TransForm User account. The user is automatically added to the TransForm account associated with the API key.

You can optionally specify a list of roles for the user in this account. If you do not specify any roles a default role of 'user' is used.

You can optionally specify the Display Name for the user. If a Display Name is not specified the userId (i.e. email address) is used.

CURL 

CURL --insecure -H "apikey:Your_api_key" -H "content-type: application/json" -H "accept: application/json" -d "{"""userid""":value_of_userid,"""password""":value_of_password,"""roles""":value_of_roles,"""displayname""":value_of_displayname}" "https://transform.alphasoftware.com/transformAPIVersion1.a5svc/createNewUserAccount"

Node 

var request = require('request')
var path = 'https://transform.alphasoftware.com/transformAPIVersion1.a5svc/createNewUserAccount';
var data = {"userid": "value_of_userid","password": "value_of_password","roles": "value_of_roles","displayname": "value_of_displayname"};
var dataJSON = JSON.stringify(data)
request.post(
	{
		headers: {apikey: "Your_api_key"},   
		url: path, 
		form: dataJSON}, 
		function(err,httpResponse,body){
			if(err) console.log(err)
			console.log(body)
	}
)

Xbasic 

dim apikey as c = "Your_api_key"
dim postdata as c
postdata = <<%txt%
{
    "userid": "value_of_userid",
    "password": "value_of_password",
    "roles": "value_of_roles",
    "displayname": "value_of_displayname"
}

%txt%

dim url as c = "/createNewUserAccount"
dim pr as p
pr = a5dialogHelper_transformAPIQuery(url,postdata,apikey)
if pr.error = .f. then
	dim result as c 
	result = pr.result
else
	dim errorText as c 
	errorText = pr.errorText
end if