Calls
User
login
5min
login allows you to seamlessly push your users through various projects the idea is that each time you log a user into the front end of a project, you use login when called, a token is created, and that token expires after the user is logged in successfully because tokens are assigned on a per project basis a user may be logged in simultaneously to multiple projects at once, and so each new project requires a new login token basic parameters name type required description action string true login clogin id integer true this is a central login id which identifies a single user between any projects within your organization group id integer true this designates which project the action should be applied towards doc array true doc should be an empty array example 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" "login", "group id" 100909072, "clogin id" 102670540, "doc" {} }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" "login", "group id" 100909072, "clogin id" 102670540, "doc" {} } login json = json dumps(payload) login response = requests post(url=users endpoint, data=login json, headers=headers, timeout=10) response { "msg" "user logged in", "system action" \[ "user registered" ], "user token" "5a9e6ca9 9d86 4c68 8944 a6b8e2c20320", "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" "1", "star" "0", "admin initials" null, "admin color" null, "assigned admin id" null } } motivating use cases adding an admin in regpack if you log in to the back end of the system and go to the admin management page, as soon as you click "invite admin," you are actually calling create and login we use the api to create the admin in an internal system we use for admin billing the key thing to notice is that you are still logged in as an admin while you are simultaneously logged in to our billing system; each login instance had its corresponding token pushing data from an outside application to a project imagine your other application has a user who just generated some information, and you'd like to then push that user into regpack to make the payment assuming you have some way to look up clogin id for the user who starts in the other application, you would first use update in order to update any information you might need to update, and then use login to log the user in to the regpack project from there, they would have complete information (from update ) and would be logged in to the project (from login ), where they could proceed to make their payment additionally, you could combine this with other calls such as add product in order to make sure their cart is correct prior to completing payment