To Add / Edit User

Author: Salman Pathan 317 views

Purpose:

Add new user or Edit existing users in Jodo

Use Case:

When new user is created in CRM / Business application, it is pushed to Jodo using this API

User Input Parameters:

NodeM/OData type sizeValueDescription
methodMTextaddEditUserUnique Command for JSON Request. (This method value will not be changed)
apikeyMTexttest_orgUnique key assigned to an organisation. (This API key will change per client organisation)
actionMTextaddAction type (1=Add &2=Edit)
usernameMTextavhanuserUsername can be alphanumeric
userimageOTextc2c_clicktocall_201601051003844.jpgImage of the user
loginidMTextuser12@avhan.comEmail ID of user (need valid email ID) For Edit this field cannot be changed Non-Editable field
usertypeMTextuserSelect particular usertype while creating user (User types like user, Admin, Dealer, Stores etc.)
mediadetailsMText(150)[{“media”:”Voice In”},{“media”:”Email Out”}]Media details (Media details like VoiceIn, VoiceOut, EmailIn, EmailOut, social, etc.)
newpasswordOText12d73bbb7bdf501be4b6595271eac123Enter user new password (MD5 encrypted value)
confirmpasswordOText12d73bbb7bdf501be4b6595271eac123Enter user confirm password (MD5 encrypted value). This field is mandatory when new password parameter is passed

Output Parameters:

NodeValueDescription
methodaddEditUserUnique Command for JSON Response
revisionno1Functionality revision no
status3Refer the status parameter table
statusdescsuccessstatus parameter description
userid136New user creation id (whenever new user is created dynamic user ID will be generated)
resdatetime2018-11-12 14:00:05Date and Time of the response. (Date format: YYYY-MM-DD hh:mm:ss)

User type:

Type
Super Admin
Administrator
Supervisor
Team Leader
User
Quality
Barge-In
MIS

Media type:

Type
Email In
Email Out
SMS In
SMS Out
Chat
Voice In
Voice Out
Social-Twitter
Social-Facebook
Video

Contact ID Info :

Table: contact_types

Type
Home Number
Mobile Number
Personal Number
Office Phone
Office Fax
Skype
Facebook
Personal Email
Official Email

JSON Add User Request Format

				
					{
"method":"addEditUser",
"apikey":"test_org",
"action":"add",
"userimage":"c2c_clicktocall_201601051003844.jpg",
"username":"Batman12",
"loginid":"Batman12@avhan.com",
"usertype":"user",
"newpassword":"ecc4208a7778c1d76e7e89c5253128c5",
"confirmpassword":"ecc4208a7778c1d76e7e89c5253128c5",
"mediadetails":[{"media":"Email In"},{"media":"Email Out"}],
"customercode":100783,
"groups":["Avhan_group","Batman_group"],
"gender":"Male",
"dob":"1990-11-13",
"doj":"2014-11-13 ",
"address":"Postal colony, chembur"
"country":"India",
"state":"Maharashtra",
"city":"Chembur",
"language":[
{"languageid":"1","language":"English"},
{"languageid":"2","language":"Hindi"}
],
"contactdetails":[
{"contactid":"facebook","contacttype":"testdemo987@avhan.com"},
{"contactid":"mobile number","contacttype":"8465982541"}
],
"skilldetails":[
{"skillname":"language","skilldetail":"hindi","proficiencyvalue":"4"},
{"skillname":"product","skilldetail":"old","proficiencyvalue":"4"}
],
"reqdatetime":"2018-11-12 14:00:05"
}
				
			

JSON Add User Response format

				
					{
"method":”addUser”,
"userid":124,
"revisionno":1,
"status":3,
"statusdesc":"success",
"resdatetime":"2018-11-12 14:00:05"
}
				
			

JSON Add User Failed Response format

				
					{
"method":”addUser”,
"revisionno":1,
"status":5,
"statusdesc":"fail",
"resdatetime":"2018-11-12 14:00:05"
}				
			

JSON Edit User Request Format

				
					{
"method":"addEditUser",
"apikey":"test_org",
"action":"edit",
"userimage":"c2c_clicktocall_201601051003844.jpg",
"username":"Batman12",
"loginid":"Batman12@avhan.com",
"usertype":"user",
"newpassword":"ecc4208a7778c1d76e7e89c5253128c5",
"confirmpassword":"ecc4208a7778c1d76e7e89c5253128c5",
"mediadetails":[{"media":"Email In"},{"media":"Email Out"}],
"customercode":100783,
"groups":["Avhan_group","Batman_group"],
"gender":"Male",
"dob":"1990-11-13",
"doj":"2014-11-13 ",
"address":"Postal colony, chembur"
"country":"India",
"state":"Maharashtra",
"city":"Chembur",
"language":[
{"languageid":"1","language":"English"},
{"languageid":"2","language":"Hindi"}
],
"contactdetails":[
{"contactid":"facebook","contacttype":"testdemo987@avhan.com"},
{"contactid":"mobile number","contacttype":"8465982541"}
],
"skilldetails":[
{"skillname":"language","skilldetail":"hindi","proficiencyvalue":"4"},
{"skillname":"product","skilldetail":"old","proficiencyvalue":"4"}
],
"reqdatetime":"2018-11-12 14:00:05"
}				
			

JSON Edit User Response format

				
					{
"method":”addEditUser”,
"userid":136,
"revisionno":1,
"status":3,
"statusdesc":"success",
"resdatetime":"2018-11-12 14:00:05"
}				
			

Status Code Information

StatusStatus Description
401action not found
402action is blank
403userimage not found
404username not found
405username is blank
406loginid not found
407loginid is blank
408loginid is invalid
409usertype not found
410usertype is blank