Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Single User URL: https://www.commcarehq.org/a/[domain]/api/[version]/web-user/[user_id]

Permissions Required: Edit Web Users

Input parameters: 

NameDescriptionExample
usernameFilter list by usernameusername=bob@example.com


Output parameters:

NameDescriptionExample
idUser UUID3c5a623af057e23a32ae4000cf291339
usernameUser name of user, including domainjdoe@example.com
first_nameFirst name of userJohn
last_nameLast name of userDoe
default_phone_numberPrimary phone number of user+50253311399
emailEmail address of user john.doe@example.org
phone_numbersList of all phone numbers of the user(see examples)
roleName of user role(see examples)
permissionsObject representing user's permissions(see examples)
is_adminWhether the user is a project admin(see examples)

Output values:

Sample usage:

Code Block
https://www.commcarehq.org/a/demo/api/v0.4/web-user/

Sample output:

JSON:

 

Code Block
languagejavascript
{
   "meta":{
      "limit":20,
      "next":null,
      "offset":0,
      "previous":null,
      "total_count":2
   },
   "objects":[
      {
         "default_phone_number":null,
         "email":"admin@example.com",
         "first_name":"Joe",
         "id":"8f9756be9b1c7f28057d707b405d18f6",
         "is_admin": true,
         "last_name":"Admin",
         "permissions":{
            "doc_type":"Permissions",
            "edit_apps":true,
            "edit_commcare_users":true,
            "edit_data":true,
            "edit_web_users":true,
            "view_report_list":[
            ],
            "view_reports":true
         },
         "phone_numbers":[
         ],
         "resource_uri":"",
         "role":"Admin",
         "username":"admin@example.com"
      },
      {
         "default_phone_number":null,
         "email":"reporter@dimagi.com",
         "first_name":"Bob",
         "id":"73a1ce78809f7d077b4b3a01163e9186",
         "is_admin": false,
         "last_name":"Reporter",
         "permissions":{
            "doc_type":"Permissions",
            "edit_apps":false,
            "edit_commcare_users":false,
            "edit_data":false,
            "edit_web_users":false,
            "view_report_list":[
            ],
            "view_reports":true
         },
         "phone_numbers":[
         ],
         "resource_uri":"",
         "role":"Read Only",
         "username":"reporter@example.com"
      }
   ]
}

...