Calls
User
create
10 min
this call creates a user, which is equivalent to a user registering in your project this call would apply to creating a parent or an individual; you would use create child to create a child in a family system the arguments that would be included in the doc are described below basic parameters 216 unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type doc parameters true 179 unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type examples create a new user this is an example which would create a new user in your organization the key things to note are that username , password , main email , org name , first name , and last name are all supplied while clogin id is false altogether, this is the equivalent of an end user registering and answering the yes/no question call curl x post "https //www regpack com/reg/api2/users/" \\ h "content type application/json" \\ h "accept application/json" \\ h "api id 15263" \\ h "api user api admin\@regpacks com" \\ h "api token cd2e514f 7gab 3cde 62fg 51abcd4e7362" \\ d '{ "action" "create", "group id" 100909072, "clogin id" false, "doc" { "username" "jim hall\@regpacks com", "password" "dont just play something sit there!", "org name" "jim hall trio", "main email" "jim hall\@regpacks com", "first name" "jim", "last name" "hall" } }import requests import json users endpoint = https //www regpack com/reg/api2/users/ current time = str(round(time time())) headers = { "content type" "application/json", "accept" "application/json", "api id" "15263", "api user" "api admin\@regpacks com", "api token" "cd2e514f 7gab 3cde 62fg 51abcd4e7362", } payload = { "action" "create", "group id" 100909072, "clogin id" false, "doc" { "username" "jim hall\@regpacks com", "password" "don't just play something sit there!", "org name" "jim hall trio", "main email" "jim hall\@regpacks com", "first name" "jim", "last name" "hall" } } create new user json = json dumps(payload) create new user response = requests post(url=users endpoint, data=create new user json, headers=headers, timeout=10) response { "msg" "user registered ", "system action" \[ "user registered" ], "success" true, "user info" { "clogin id" "102715741", "group id" "100909072", "connected to" "102715741" }, "meta info" { "u name" "jim hall", "total forms" "2", "completed forms" "0", "total user forms" "2", "total completed user forms" "0", "total user mandatory forms" "2", "total completed user mandatory forms" "0", "total order" "0 00", "total paid" "0 00", "total balance" "0 00", "status id" "0", "status name" null, "status color" null, "application date" "dec 8th 2021 17 20", "application date raw" "2021 12 08 17 20 08", "u comments" "0", "group id" "100909072", "uid" "4085257", "clogin id" "102715741", "excluded" "0", "connected to" "102715741", "total user tags" "0", "user tag ids" null, "total non excluded children" "0", "star" "0", "admin initials" null, "admin color" null, "assigned admin id" null } } add an existing user to a project this is an example of creating a user who exists in a previous project because clogin id is present, the system will pull username , password , main email , org name , first name , and last name whether they are provided or not (if the fields exist) what this means is that any values you provide will overwrite the previous values if clogin id cannot be found within your organization, the system will create a new user and return a new clogin id the system will disregard username and password if clogin id is provided and will not overwrite them with the values you provide in the doc note that in a family system, only an existing parent can be created, and all child users will be assigned a new clogin id call curl x post "https //www regpack com/reg/api2/users/" \\ h "content type application/json" \\ h "accept application/json" \\ h "api id 15263" \\ h "api user api admin\@regpacks com" \\ h "api token cd2e514f 7gab 3cde 62fg 51abcd4e7362" \\ d '{ "action" "create", "group id" 100909072, "clogin id" 102670540, "doc" { "username" "miles davis quintet\@regpacks com", "password" "stop playing the butter notes!", "org name" "miles davis quintet", "main email" "miles davis\@regpacks com", "first name" "miles", "last name" "davis", "your instrument" "trumpet" } }import requests import json users endpoint = https //www regpack com/reg/api2/users/ headers = { "content type" "application/json", "accept" "application/json", "api id" "15263", "api user" "api admin\@regpacks com", "api token" "cd2e514f 7gab 3cde 62fg 51abcd4e7362", } payload = { "action" "create", "group id" 100909072, "clogin id" 102670540, "doc" { "username" "miles davis quintet\@regpacks com", "password" "stop playing the butter notes!", "org name" "miles davis quintet", "main email" "miles davis\@regpacks com", "first name" "miles", "last name" "davis", "your instrument" "trumpet" } } create existing user json = json dumps(payload) create existing user response = requests post(url=users endpoint, data=create existing user json, headers=headers, timeout=10) response { "msg" "user registered ", "system action" \[ "user registered" ], "success" true, "user info" { "clogin id" "102670540", "group id" "100909072", "connected to" "102670540" }, "meta info" { "u name" "miles davis", "total forms" "2", "completed forms" "0", "total user forms" "2", "total completed user forms" "0", "total user mandatory forms" "2", "total completed user mandatory forms" "0", "total order" "0 00", "total paid" "0 00", "total balance" "0 00", "status id" "0", "status name" null, "status color" null, "application date" "dec 8th 2021 17 20", "application date raw" "2021 12 08 17 20 08", "u comments" "0", "group id" "100909072", "uid" "4085258", "clogin id" "102670540", "excluded" "0", "connected to" "102670540", "total user tags" "0", "user tag ids" null, "total non excluded children" "0", "star" "0", "admin initials" null, "admin color" null, "assigned admin id" null } } triggers when you create a user, the "user account created" trigger will fire this trigger is the essential mechanism that causes the user to have their forms added to their profile that said, it is possible that other actions in the system are triggered, and these can potentially have unanticipated consequences if you would like to limit these second order effects, it is advised that you include the following parameters / this disables emails from sending as a result of triggers / disable email sending\ true / while this prevents all forms from submitting, which often triggers actions to occur / submit forms\ false user account porting it is important to note that, if you are creating a user in a project that was copied from a previous project and that user is also both present and not archived in that previous project , then it will port over all of the user's data any fields you provide answers for in the docs will then overwrite that data as an example, if roger registers in "color con v", picks "blue" as his favorite color, and then you create him in "color con vi" with {"favorite color" "green"} , then it will overwrite his answer in the new "color con vi" project; otherwise, his favorite color will show as blue data cannot be overwritten with empty strings, so the correct way to prevent data from porting would be to archive the user in the original project (from which the new project was copied) this will prevent any fields from porting over except for the special user fields (such as first name , last name , etc )

