User

  • 15.5
This article is may not be up to date with the latest stable release of M4.

Description

The User endpoint provides the API consumer with access to methods pertaining to user and related data objects. The endpoint allows consumers to load user data, add new users, and update users.

Methods

URL base/Mapcom/User/Specification
Action GET
Description Returns a data dictionary that details the available web service methods related to the User endpoint.
Parameters None
 Returns  A JSON object with method descriptions
Sample Return Object
[
    {
        "HttpAction": "Get",
        "MethodName": "GetUser",
        "Description": "Returns the record for a single user given the passed in ID value (see Path).",
        "Path": "/User/GetUser/25032"
    },
    {
        "HttpAction": "Post",
        "MethodName": "GetUserByUserID",
        "Description": "Returns the record for a single user given the passed in User ID value.",
        "Format": {
            "UserId": "userid"
        }
    },
    {
        "HttpAction": "Post",
        "MethodName": "AddUser",
        "Description": "Method allows for the adding of a user. The newly created user object is returned.",
        "Format": {
            "TechName": "tech name",
            "UserID": "user id",
            "Role": 1,
            "Email": "email@domain.com",
            "Phone": "8047431860",
            "SecondaryEmail": "email@domain.com",
            "DeletedUser": false
        }
    },
    {
        "HttpAction": "Post",
        "MethodName": "UpdateUser",
        "Description": "Method allows for the updating of a user. The updated user object is returned.",
        "Format": {
            "ID": 358,
            "TechName": "tech name",
            "UserID": "user id",
            "Role": 1,
            "Email": "email@domain.com",
            "Phone": "8047431860",
            "SecondaryEmail": "email@domain.com",
            "TextEmail": null,
            "InventoryRole": null,
            "DeletedUser": false
        }
    }
]
URL base/Mapcom/User/AddUser
Action POST
Description Adds the specified user object and returns a the newly created user object.
Parameters
Name Required? Type Description
TechName Yes String The full name of the user.
UserID Yes String The user name of the user.
Role Yes Integer
Email Yes String The email of the user.
Phone Yes String The phone number of the user.
SecondaryEmail No Time The secondary email of the user.
DeletedUser No Boolean The deleted status of the user.
Sample JSON Package
{
     "TechName": "tech name",
     "UserID": "user id",
     "Role": 1,
     "Email": "email@domain.com",
     "Phone": "8047431860",
     "SecondaryEmail": "email@domain.com",
     "DeletedUser": false
}
Returns A JSON User data object
Sample Return Object
{
     "ID": 358,
     "TechName": "tech name",
     "UserID": "user id",
     "Role": 1,
     "TechID": 358,
     "Email": "email@domain.com",
     "Phone": "8047431860 ",
     "SecondaryEmail": "email@domain.com",
     "TextEmail": null,
     "InventoryRole": null,
     "DeletedUser": false
}
Business Rules
Any violations of these business rules result in an appropriate error message being returned to the API consumer.
  • UserID: must be unique
URL base/Mapcom/User/GetUser/ID
Action GET
Description Returns a User object when given an ID of a valid user in the M4 database.
Parameters
Name Required? Type Description
ID Yes Integer An integer value representing the ID of a user in the M4 database.
Returns A JSON User data object
Sample Return Object
{
     "ID": 358,
     "TechName": "tech name",
     "UserID": "user id",
     "Role": 1,
     "TechID": 358,
     "Email": "email@domain.com",
     "Phone": "8047431860 ",
     "SecondaryEmail": "email@domain.com",
     "TextEmail": null,
     "InventoryRole": null,
     "DeletedUser": false
}
URL base/Mapcom/User/UpdateUser
Action POST
Description Updates the specified user object and returns the user object.
Parameters
Name Required? Type Description
ID Yes Integer The ID for which this user belongs to.
TechName Yes String The full name of the user.
UserID Yes String The user name of the user.
Role Yes Integer
Email Yes String The email of the user.
Phone Yes String The phone number of the user.
SecondaryEmail No Time The secondary email of the user.
DeletedUser No Boolean The deleted status of the user.
Sample JSON Package
{
     "ID": 358,
     "TechName": "tech name",
     "UserID": "user id",
     "Role": 1,
     "Email": "email@domain.com",
     "Phone": "8047431860 ",
     "SecondaryEmail": "email@domain.com",
     "DeletedUser": false
}
Returns A JSON User data object
Sample Return Object
{
     "ID": 358,
     "TechName": "tech name",
     "UserID": "user id",
     "Role": 1,
     "TechID": 358,
     "Email": "email@domain.com",
     "Phone": "8047431860 ",
     "SecondaryEmail": "email@domain.com",
     "TextEmail": null,
     "InventoryRole": null,
     "DeletedUser": false
}
Business Rules
Any violations of these business rules result in an appropriate error message being returned to the API consumer.
  • UserID: must be unique

Was this article helpful?

Related Articles