- Introduction
- Computers
- Software
- Printers
- Other Assets
- Audit
- Contracts
- Vendors
- Risks
- Incidents
- Solutions
- Users
API - Users
Getting a list of all users
This request returns a summary of all users available in the account.
Request
GET "https://app.samanage.com/users.xml"
curl --digest -u "username:password" -H "Accept: application/vnd.samanage.v1+xml" -X GET "https://app.samanage.com/users.xml"
Response
<users>
<user>
<email>xx@xx.com</email>
<first-name>xx</first-name>
<id>1581</id>
<last-login>2010-01-10T12:16:37Z</last-login>
<last-name>yy</last-name>
<phone></phone>
</user>
<user>
<email>zz@zz.com</email>
<first-name>zz</first-name>
<id>1518</id>
<last-login>2010-01-10T19:04:13Z</last-login>
<last-name>zz</last-name>
<phone nil="true"></phone>
</user>
Creating a user
The following request will create a new user in the account. When a new user is created an activation email is sent to the user's email requesting that he actives his new account and select a password.
POST "https://app.samanage.com/users.xml"
curl --digest -u "username:password" -d @stuff_to_update.xml -H "Content-Type:text/xml" -X POST "https://app.samanage.com/users.xml"
or
curl --digest -u "username:password" -d "<user><email>a@d.com</email><first-name>a</first-name><last-name>b</last-name><phone>1234567890</phone><roles><helpdesk_user>1</helpdesk_user></roles></user>" -H "Content-Type:text/xml" -X POST "https://app.samanage.com/users.xml"
@stuff_to_update is an XML file with the properties you wish to update:
<user>
<first-name>a</first-name>
<last-name>b</last-name>
<email>a@d.com</email>
<phone>1234567890</phone>
<roles>
<helpdesk_user>1</helpdesk_user>
</roles>
</user>
Updating a user
The following request will update user properties for a specific ticket.
PUT "https://app.samanage.com/users.xml"
curl --digest -u "username:password" -d @stuff_to_update.xml -H "Content-Type:text/xml" -X PUT "https://app.samanage.com/users/1518.xml"
or
curl --digest -u "username:password" -d "<user><email>a@d.com</email><first-name>a</first-name><last-name>b</last-name><phone>1234567890</phone></user>" -H "Content-Type:text/xml" -X PUT "https://app.samanage.com/users/1518.xml"
@stuff_to_update is an XML file with the properties you wish to update:
<user>
<email>abc@dec.com</email>
</user>
The following properties can be updated:
first-name
last-name
email
phone



