This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Working with Users in Zoho Books



Overview

The following operations allow you to work with users. Click an operation name to see details on how to use it.

For a sample proxy service that illustrates how to work with users, see Sample configuration

OperationDescription

createUser

Creates a user.

getUserRetrieves the details of a user.
listUsersRetrieves all the users in the organization.

Operation details

This section provides further details on the operations related to time users.

Creating a user

The createUser operation creates a user for the organization. 

createUser
<zohobooks.createUser>
    <email>{$ctx:email}</email>
    <name>{$ctx:name}</name>
	<userRole>{$ctx:userRole}</userRole>
</zohobooks.createUser>
Properties
  • email: The e-mail address of the user.
  • name: The name of the user.
  • userRole: The role of the user. Sets the privileges for a user. Allowed Values: staff, admin and timesheetstaff.
Sample request

Following is a sample REST/JSON request that can be handled by the createUser operation.

Sample Request for createUser
{
	"apiUrl":"https://books.zoho.com",
	"authToken":"45bf59aede45cbd3e4248af901efa39a",
	"organizationId":"48848129",
	"email":"depp@gmail.com",
	"name":"Johnny",
	"userRole":"timesheetstaff"
}
Related Zoho Books documentation

https://www.zoho.com/books/api/v3/projects/users/#assign-users

Retrieving the details of a user

The getUser operation retrieves the details of a user.

getUser
<zohobooks.getUser>
	<userId>{$ctx:userId}</userId>
</zohobooks.getUser>
Properties
  • userId: The ID of the user to be retrieved.
Sample request

Following is a sample REST/JSON request that can be handled by the getUser operation.

Sample Request for getUser
{
	"apiUrl":"https://books.zoho.com",
	"authToken":"45bf59aede45cbd3e4248af901efa39a",
	"organizationId":"48848129",	
	"userId":"128419000000068013"
}
Related Zoho Books documentation

https://www.zoho.com/books/api/v3/projects/users/#get-a-user

Retrieving all users 

The listUsers operation retrieves the list of all the users in the organization.

listUsers
<zohobooks.listUsers>
    <sortColumn>{$ctx:sortColumn}</sortColumn>
    <page>{$ctx:page}</page>
    <perPage>{$ctx:perPage}</perPage>
	<filterBy>{$ctx:filterBy}</filterBy>
</zohobooks.listUsers>
Properties
  • sortColumn: Sort users. Allowed Values: name, email, user_role and status.
  • page: The number of the page to be returned - Pagination value.
  • perPage: Specifies how many entries should be returned in the response.
  • filterBy: Filter through users with user status. Allowed Values: Status.All, Status.Active, Status.Inactive, Status.Invited and Status.Deleted.
Sample request

Following is a sample REST/JSON request that can be handled by the listUsers operation.

Sample Request for listUsers
{
	"apiUrl":"https://books.zoho.com",
	"authToken":"45bf59aede45cbd3e4248af901efa39a",
	"organizationId":"48848129",
	"sortColumn":"email",
	"page":"1",
	"perPage":"200",
	"filterBy":"Status.Active"
}
Related Zoho Books documentation

https://www.zoho.com/books/api/v3/projects/users/#list-users

Sample configuration

Following is a sample proxy service that illustrates how to connect to Zoho Books with the init operation and use the createUser operation. The sample request for this proxy can be found in the createUser sample request. You can use this sample as a template for using other operations in this category.

Sample Proxy
<?xml version="1.0" encoding="UTF-8"?>
	<proxy xmlns="http://ws.apache.org/ns/synapse" name="zohobooks_createUser" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
	 <target>
	 <inSequence>
      <property name="authToken" expression="json-eval($.authToken)"/>
      <property name="apiUrl" expression="json-eval($.apiUrl)"/>
      <property name="organizationId" expression="json-eval($.organizationId)"/>
      <property name="email" expression="json-eval($.email)"/>
      <property name="name" expression="json-eval($.name)"/>
      <property name="userRole" expression="json-eval($.userRole)"/>
      <zohobooks.init>
         <authToken>{$ctx:authToken}</authToken>
         <apiUrl>{$ctx:apiUrl}</apiUrl>
         <organizationId>{$ctx:organizationId}</organizationId>
      </zohobooks.init>
      <zohobooks.createUser>
         <email>{$ctx:email}</email>
         <name>{$ctx:name}</name>
         <userRole>{$ctx:userRole}</userRole>
      </zohobooks.createUser>
	   <respond/>
	 </inSequence>
	  <outSequence>
	   <send/>
	  </outSequence>
	 </target>
   <description/>
  </proxy>