user3781135
user3781135

Reputation: 13

AtTask User Creation

Does anyone have a example of creating a AtTask user using Invoke-RestMethod? Have tried the following Invoke-WebRequest "https://company.attask-ondemand.com/attask/api/[email protected]&firstName=user&lastName=name&password=Pa$$w0rd&sessionID=jjsaduu298901283123j" -Method post which returns bad request... Thanks in advance!

Upvotes: 1

Views: 416

Answers (2)

Craig
Craig

Reputation: 326

Creating and setting up a user in AtTask is effectively a three step process.

Step 1: Create the user. This is pretty straight forward. Set the First and Last name, e-mail and any group ID, job role. No password yet.

Step 2: Call the named action "assignUserToken". This will return an array with the token value under 'result'

Step 3: Now call another named action, "completeUserRegistration". You will need to pass it the ID, First Name, Last Name, Password to set, and the Token.

That's it, you are done. Regarding step 3, I have no idea why you need to pass the first and last name in again when you are passing the ID, but it doesn't seem to work without it.

Upvotes: 1

Jim Young
Jim Young

Reputation: 169

Place the new user information in a json array in a field named updates. Specify the method you are doing. in this case: &method=post. Then you need to pass the session id or the admin's username and password. I changed your above url to what it needs to look like.

"https://company.attask-ondemand.com/attask/api/user?updates={ emailAddr:[email protected],firstName:user,lastName:name,password:Pa$$w0rd}&method=post&sessionID=jjsaduu298901283123j

or

"https://company.attask-ondemand.com/attask/api/user?updates={ emailAddr:[email protected],firstName:user,lastName:name,password:Pa$$w0rd}&method=post&username=admin_email&password=admin_password

Let me know if that does not work.

Upvotes: 0

Related Questions