Edit User
The Edit User API allows the admin to edit a particular user. This includes changing their name, contact information, activity status, and locale. An admin can also reset a user’s password through this API request, though they cannot change the automatically-assigned expiration date of the new password.
Version 2.0 Call https://integration.shopatron.com/api/usermgmt/v1/user/{userID} Supported Formats JSON HTTP Method PUT Schema https://integration.shopatron.com/api/usermgmt/v1/schema/user.json
Note that the core URL may be different from the standard production environment, depending on the configuration.
The .json address above can be used to access the schema within Postman. An example use of the User Management API follows below, or view the schema or the sample Postman collection .
Example
In this example, the user being edited will be assigned the following properties:
The user’s first name is being changed to “TEST Test” The user’s phone number is being set to 0000000000
Required Parameters
The following parameters are required for all instances of this call:
Parameter Type Description firstName string The first name of the user. The maximum length is 50. lastName string The last name of the user. The maximum length is 50. active Integer Whether the user is active or not. email string The email of the user. The maximum length is 70. locale enum The Internet Engineering Task Force code for the user’s locale (e.g. en-US or fr-CA).
Optional Parameters
A number of additional variables can also be edited:
Parameter Type Description allowedCatalogs array Array of catalogIDs (which are integers) that this user is associated with. password string The password of the customer. The minimum length is 5 and the maximum length is 48. phone string The phone number of the user. The minimum length is 6 and the maximum length is 20.
Note that Customer objects include read-only parameters. These parameters may be returned as part of customer data, but they cannot be edited after initial user creation. These read-only variables include:
userID username retailerID manufacturerID fulfillerID catalogID groupID groupName passwordExpires lastLogin admin
The Full Request
This is the entire request that will edit a user. When making this PUT call, a new key must be added to the header. The key is called “Shopatron-User-ID” and the value is the appropriate User ID.
{
"firstName": "TEST Test",
"lastName": "Test",
"active": 1,
"email": "support@shopatron.com",
"locale": "en-US"
}
The Full Response
The API returns a description of the user that was edited.
{
"userID": 12121,
"username": "test_test",
"firstName": "TEST Test",
"lastName": "Test",
"email": "support@shopatron.com",
"phone": "0000000000",
"active": 1,
"passwordExpires": "2020-08-04T04:04:41+00:00",
"lastLogin": "2009-09-14T12:14:40-07:00",
"groupID": 2,
"groupName": "Manufacturer Admin",
"manufacturerID": 010,
"fulfillerID": 10101,
"locale": "en-US",
"admin": 0
}