All docs This doc
Skip to end of metadata
Go to start of metadata


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

getUserById

Retrieves the details of a user.

listUsersRetrieves all users with at least one reservation.

Operation details

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

Retrieving the details of a user

The getUserById operation retrieves the details of a user. 

getUserById
<planyo.getUserById>
    <userId>{$ctx:userId}</userId>
    <email>{$ctx:email}</email>
	<detailLevel>{$ctx:detailLevel}</detailLevel>
</planyo.getUserById>
Properties
  • userId: The ID of the user to return details.
  • email: The e-mail address of the user to return details.
  • detailLevel: The indicator to return all user information without custom properties. Values: 1 or 4. Default: 1.
Sample request

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

Sample Request for getUserById
{
	"apiUrl":"http://api.planyo.com",
	"apiKey":"d3314e7094e0ad10714156181eff0cf4",
	"version":1,
	"language":"EN",
	"userId":470480,
	"email":"testing@gmail.com",
	"detailLevel":4
}
Related Planyo documentation

https://www.planyo.com/api.php?topic=get_user_data

Retrieving all users with at least one reservation

The listUsers operation retrieves all users with at least one reservation.

listUsers
<planyo.listUsers>
    <page>{$ctx:page}</page>
    <pageSize>{$ctx:pageSize}</pageSize>
    <siteId>{$ctx:siteId}</siteId>
    <detailLevel>{$ctx:detailLevel}</detailLevel>
    <userFilterName>{$ctx:userFilterName}</userFilterName>
    <userFilterValue>{$ctx:userFilterValue}</userFilterValue>
    <userFilterValueInc>{$ctx:userFilterValueInc}</userFilterValueInc>
    <firstName>{$ctx:firstName}</firstName>
    <lastName>{$ctx:lastName}</lastName>
    <email>{$ctx:email}</email>
    <country>{$ctx:country}</country>
    <address>{$ctx:address}</address>
    <city>{$ctx:city}</city>
    <zip>{$ctx:zip}</zip>
    <phoneNumber>{$ctx:phoneNumber}</phoneNumber>
    <phoneCountryCode>{$ctx:phoneCountryCode}</phoneCountryCode>
    <mobileNumber>{$ctx:mobileNumber}</mobileNumber>
    <mobileCountryCode>{$ctx:mobileCountryCode}</mobileCountryCode>
	<isListUnconfirmed>{$ctx:isListUnconfirmed}</isListUnconfirmed>
</planyo.listUsers>
Properties
  • page: The page number to return. Default: 0.
  • pageSize: Results per page. Default: 100. Maximum: 1000.
  • siteId: The site ID.
  • detailLevel: The indicator to return all user information without custom properties. Values: 1 or 4. Default: 1.
  • userFilterName: The custom user property filter name. Returns a subset of users.
  • userFilterValue: The exact value of the custom user property to be used together with userFilterName as the user filter.
  • userFilterValueInc: Looks for values of the custom user property which include the requested text.
  • firstName: Filters the results by the user's first name. Use the star(*) to match multiple values.
  • lastName: Filters the results by the user's last name. Use the star(*) to match multiple values. 
  • email: Filters the results by the user's e-mail address. Use the star(*) to match multiple values.
  • country: Filters the results by the user's 2-letter country code.
  • address: Filters the results by the user's address. Use the star(*) to match multiple values.
  • city: Filters the results by user's city. Use the star(*) to match multiple values.
  • zip: Filters the results by the user's zip code / postal address. Use the star(*) to match multiple values.
  • phoneNumber: Filters the results by the user's telephone number excluding the country code. Use the star(*) to match multiple values.
  • phoneCountryCode: Filters the results by the user's telephone country code, e.g. 1 for US.
  • mobileNumber: Filters the results by the user's mobile number excluding the country code. Use the star(*) to match multiple values.
  • mobileCountryCode: Filters the results by the user's mobile country code, e.g. 41 for Switzerland.
  • isListUnconfirmed: If "true", lists users without any confirmed reservations. By default, only users with confirmed reservations will be returned.
Sample request

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

Sample Request for listUsers
{
	"apiUrl":"http://api.planyo.com",
	"apiKey":"d3314e7094e0ad10714156181eff0cf4",
	"version":1,
	"language":"EN",
	"page":0,
	"pageSize":4,
	"siteId":17231,
	"detailLevel":4,
	"userFilterName":"prop1",
	"userFilterValue":"VOC_1",
	"firstName":"Ra*",
	"lastName":"Rod*",
	"email":"su*",
	"country":"LK",
	"address":"Addr*",
	"city":"City*",
	"zip":"0119*",
	"phoneNumber":"011*",
	"phoneCountryCode":"94",
	"mobileNumber":"077*",
	"mobileCountryCode":"94",
	"isListUnconfirmed":true
}

Note

There are more optional parameters available. For more information on the usage of these parameters please check the API document. 

Related Planyo Documentation

https://www.planyo.com/api.php?topic=list_users

Sample configuration

Following is a sample proxy service that illustrates how to connect to Planyo with the init operation and use the getUserById operation. The sample request for this proxy can be found in the getUserById 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="planyo_getUserById"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence>
         <property name="apiUrl" expression="json-eval($.apiUrl)"/>
         <property name="apiKey" expression="json-eval($.apiKey)"/>
         <property name="version" expression="json-eval($.version)"/>
         <property name="language" expression="json-eval($.language)"/>
         <property name="userId" expression="json-eval($.userId)"/>
         <property name="email" expression="json-eval($.email)"/>
         <property name="detailLevel" expression="json-eval($.detailLevel)"/>
         <planyo.init>
            <apiUrl>{$ctx:apiUrl}</apiUrl>
            <apiKey>{$ctx:apiKey}</apiKey>
            <version>{$ctx:version}</version>
            <language>{$ctx:language}</language>
         </planyo.init>
         <planyo.getUserById>
            <userId>{$ctx:userId}</userId>
            <email>{$ctx:email}</email>
            <detailLevel>{$ctx:detailLevel}</detailLevel>
         </planyo.getUserById>
         <respond/>
      </inSequence>
      <outSequence>
         <send/>
      </outSequence>
   </target>
   <description/>
</proxy>                                                                                                                                                 
  • No labels