Start a conversation

User

1) user/change-language

Method - POST

Field Type Available values Note
authId
integer
   
language
String
  Two-letter code language


2) user/check-auth

Method - GET

Request parameters

Field Type Available values Note
login
String
   
type
String
"member" For the "onlineoffice" gateway, this field is not required. It will  be automatically  filled with the value of "member"
password
String
   


3) user/create

Method - POST

Fields description

Field Mandatory Note
login
yes  
type
yes Optional for onlineoffice gateway
password
no If the field is not transmitted, or transmitted with empty, the password is automatically generated and returned in the response.
        Password generation rules are determined by settings (see setting)
sponsorId
yes Sponsor ID (ID in the Account table)
confirmationUrl
no The URL of the page, that will be inserted into the email sent to the user to confirm registration.
        This line should contain a placeholder {{code}}
        URL example: https://mydomain.com/register-confirmation?code={code}}
          If this parameter is missing in the request, then the registration is considered confirmed and the letter is not sent to the user.
profile
yes  


4) user/delete

Method to delete user.


        URL - https://.../main-app/user/delete

Request body

{                  

  "authId"  :  40,                

  "withAccount"  :  1  

}

  • authId - record ID in the auth table. You can find it from the request user/check-auth: payload → auth → id
  • withAccount - Also delete user account


5) user/exists

Method - GET

Field Type Available values Note
login
String
   
type
String
"member" For the "onlineoffice" gateway, this field is not required. It will automatically be filled with the value of "member"


6) user/get

URL - https://.../main-app/user/get

Field Type Valid values Note
id
Integer
   


7)user/mail-confirm

E-mail confirmation

  • by user ("correct"). You have to pass the code specified in the letter.
  • by admin (forced). You have to specify the flag "force confirm" and email address. Also in this case, the check for overdue confirmation message is not performed.

Method - POST

Request body for "correct" confirmation

{

"code"  :  "ce67814b8c7b"

}

Request body for forced confirmation 

{

"force"  :  1,

"email"  :  "j.smift2h@endrix.org"

}

8)user/profile-update

This method is listed through a queue.

Only those fields, that transmitted in the request, are updated.

Method - POST

Fields description

Field Mandatory Note
authId
yes User ID (table auth). You can get this ID from the structure returned by the request user/check-auth (auth → id)
profile
yes  


Profile
      The entire list of profile fields, including custom fields, can be obtained by the profile-field/get-list request.

      Phone number format: user/create # phone

Loading avatar
In order to upload an avatar, you need to transfer the following profile structure.

{
      "data": base64 encoded string,
      "baseName": string,
      "extension": "png" or "jpeg" or "jpg" or "gif"
      }

Getting an avatar in any method that returns a client profile. For example, the user/exists method.


9) user/remove-avatar

This method removes the record from the user profile, the record from the file_storage table, and the file itself, if it exists.

Method - DELETE

URL - https://.../online-office/user/remove-avatar

Request parameters

Field Type Mandatory field Note
id
Integer
Yes User ID in the table kernel_user


10) user/reset-password

The method is designed to send an email to change the password. Automatically generated code is inserted into the body of the message for verification.

Method - POST

Request parameters

Field Type Mandatory field Note
email
String
yes User e-mail, for whom you need to change the password
confirmationUrl
String
yes Link to the page that the user must enter to change the password. The link must contain a placeholder for the code {{code}}.
   For example, http://example.com/user/reset-password?hash={{code}}


11) user/search

The method searches for all users to match by accountId, email, fullname.

  If accountId is specified, the method searches for all users downstream in the specified tree from the position of accountId with offset = 1 in this tree.

If accoutnId is specified, but there is no position in this tree, an error is returned.

 Search always occurs by partial match of the search string with email and fullname. If the search string is a number, then the search is additionally conducted by exact coincidence with accountId.

 When searching in a tree, additionally returns positionId as a result.

Parameter Type Mandatory field Default value Note
searchText string yes    search string
accountId int no    If specified, then a search is performed for its structure (downline) in the specified tree
treeId int no  0 Id of the tree to search
sortBy string no id sorting: id, user, email, fullname
   can be sorted in the reverse order by specifying the '-' sign before the parameter: -id, -user, -email, -fullname
   you can combine the parameters in a string: "-fullname, id, -user"
   id - matches accountId
   user - matches userId
   email - matches email
   fullname - matches firstname + `` + lastname
perPage
int no 50 Number of records returned - page size. The default is 50, but not more than 100
pageNumber
int no 1 Page number

Request examples

Request Description
/user/search?searchText=tom Searches among all users a match with '% tom%'
/user/search&searchText=54&accountId=1&treeId=1  Looks for a match with '% 54%' in the downline structure with id = 1 in a tree with id = 1 by name and email, as well as a match with accountId = 54
user/search?searchText=as&accountId=8&sortBy=-id,fullname Searches among all users a match with '% as%' in the tree with id = 0 and sorts by -id, fullname



12) user/set-password

Method - POST

Request parameters

Field Type Mandatory
        field
Note
id
Integer
Yes ID from DTO auth. This model can be obtained from the response to the user / check-auth request.
        This field is required if the userId parameter is not passed.
userId
Integer
Yes This field is required if the id parameter is not passed.
type
Integer
Yes This field is required if the id parameter is not passed.
newPassword
String
Yes


Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Daria T.

  2. Posted
  3. Updated

Comments