Service

https://iam.crocodealer.com

Client card

Request

POST /v2/users/user

{
"app":" →  Application IDstring","token":" →  Authorization tokenstring"
}
Response
{
"status":" →  Status '1' - success or '0' - errorstring","message":" →  Request result messagestring","user": {  →  General user data objectobject"id":" →  User IDstring","name":" →  User namestring","phone":" →  User phonestring","email":" →  User phonestring"
},
"groups": [  →  User data field groupsarray{"id":" →  Group IDstring","title":" →  Group ID titlestring"}
],
"paths": {  →  File pathsobject"images": {  →  Image pathsobject"s":" →  Small imageobject","m":" →  Medium imageobject","l":" →  Large imageobject"
}
},
"files":" →  An array with user filesarray","fields": [  →  User fields to editarray{"label":" →  Field titlestring","field":" →  Field namestring","value":" →  Field valuestring","type":" →  Field/selector type; static is not editablestring","group":" →  Field groupstring","placeholder":" →  Field placeholderstring","values": [  →  Field value setarray{"label":" →  Field value titlestring","value":" →  Field valuestring","selected":" →  If '1' if value selected or '0' if notinteger"}
]
}
]
}

Client card management

Request

POST /v2/users/edit

{
"app":" →  Application IDstring","token":" →  User authorization tokenstring!","fields": [  →  A set of edited toolsarray{"name":" →  An edited field namename!","type":" →  An edited field type: 'text', 'radio', 'checkbox','date', 'select'name!","value":" →  The edited field valuestring!"}
],
"files": [  →  An array with user filesarray{"name":" →  File namestring","action":" →  File action; 'update' to apply changes, 'insert' to upload a new file, 'delete' to delete filestring","order":" →  A file ordernal number. If this parameter is not set, the array index will be used as the ordernal number. Instead of the file array, an object may also be used where the keys are file ordernal numbersstring"}
]
}
Response
{
"status":" →  Status '1' - success or '0' - errorstring","message":" →  Request result messagestring","fields": [  →  Array with the results of the field editingarray{"name":" →  An edited field namestring","status":" →  Field edit status '1' - success, '0' - errorstring","message":" →  Field edit result messagestring"}
]
}

Client authorization

Request

POST /v2/users/authorize

{
"app":" →  Application IDstring","type":" →  User type (client is default, manager is optional to obtain access to CRM resources)string!","action":" →  Authorization action (auhorize or register). If password2 is provided then registration method will be executed, otherwise authorization will be the default actionstring!","method":" →  Authorization method 'phone','email'string!","phone":" →  User phone is required if email is absentstring!","email":" →  User email is required if phone is absentstring!","token":" →  User token is required if was issued earliser and being stored in the apllicationstring!","code":" →  A verification code from sms or email. The code is required for one-time-code autorizationstring","password":" →  User password if it is a desired authorization method. If user exists string","password2":" →  User password confirmation for registration processstring","visitor":" →  An application visitor ID issued by /user/visitorstring!","ip":" →  Client IP should be specified when method is called from server scriptsstring"
}
Response
{
"status":" →  Status '1' - success or '0' - errorstring","message":" →  Request result messagestring","token":" →  User authorization token to be stored in the application and used as a parameter to check authorizationstring","user": {  →  Userdata object object"id":" →  User IDstring","phone":" →  User phonestring","email":" →  User emailstring","name":" →  User namestring","parent": {  →  User manager detailsobject"id":" →  User manager IDstring","name":" →  User manager namestring"
}
}
}

Visitor

Request

POST /v2/users/visitor

{
"app":" →  Application IDstring","action":" →  Required action with provided user ID. 'request' - is used to obtain visitor ID if the application does not store any visior ID yet; 'check' - is used to check validity of visitor ID and returns ID in case it is invalid; 'active' - is used to set last activity date, when switching between the app sections; 'online' - is used to ping a visitor to set last online date. object","visitor":" →  An application visitor ID issued by the same method earlierstring!","params": {  →  Object contains a set of additional parametersobject"roistat":" →  Roistat analytics IDstring"
}
}
Response
{
"status":" →  Status '1' - success or '0' - errorstring","message":" →  Request result messagestring","visitor": {  →  Visitor data objectstring"token":" →  Visitor token to be stored in the application and to be used with current methodobject"
},
"user": {  →  User data objectobject"id":" →  User IDobject"
}
}

User authorization sesion

Request

POST /v2/users/session

{
"app":" →  Application IDstring","params": {  →  Parameter objectobject!"session":" →  Session token ID. The parameter is requiered except for 'action' = 'request' string!","role":" →  User role 'client' - to access an APP account, 'manager' - to access CRMstring!","intent":" →  Session intent 'authorize' - for authorization reasonsstring!"
},
"action":" →  Method action: 'check' - to check current session, 'active' - set last activity date, 'online' - set last online date,'request' - to create a new sessionstring!"
}