TrakIT API‎ > ‎User‎ > ‎

Create User

The below API is used to create new User profile


Request: POST

Signature: /api/mobile/CreateUser?Token={Login_Token}&IsExternal={Boolean_Value}

Body:

{
"UserID":"UNIQUE USER ID",
"FirstName":"USER FIRST NAME",
"LastName":"USER LASTNAME",
"Email":"UNIQUE USER EMAIl ADDRESS",
"Location":"COUNTRY NAME",
"Role":"INTERNAL USER ROLE",
"Type":"EXTERNAL USER TYPE"
}

Response:

{
    "Code": 1,
    "Info": "User created successfully",
    "RowsAffected": 1,
    "Scalar": null,
    "Identity": 0,
    "RetInfo": null
}



CASE 1: When creating Internal user profile

Sample: /api/mobile/CreateUser?Token=VomYEMiECFFyAQ3==&IsExternal=false


Body: 

{
"UserID":"TOM1",
"FirstName":"TOM",
"LastName":"Masivoh",
"Email":"tom@gmail.com",
"Location":"KENYA",
"Role":"Region Admin"
}



CASE 2: When creating External user profile

Sample: /api/mobile/CreateUser?Token=VomYEMiECFFyAQ3==&IsExternal=true


Body: 

{
"UserID":"TOM2",
"FirstName":"TOM",
"LastName":"Masivoh",
"Email":"tom@yahoo.com",
"Location":"UG",
"Type":"Customer"
}



Things to know about this API:

  1. Token - You can use Login API to get token displayed under Info

  2. Location - You can use Get Country List API to get countries code and name displayed under GeoCode and GeoName

  3. Role / Type - You can use Get Role list API to get list of user roles displayed under RoleName
Comments