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

The setCustomProperties operation sets new values for multiple properties.

setCustomProperties
<planyo.setCustomProperties>
	<type>{$ctx:type}</type>
	<id>{$ctx:id}</id>
	<customProperties>{$ctx:customProperties}</customProperties>
</planyo.setCustomProperties>
Properties
  • type: The property type (one of: "site", "resource", "reservation", "user").
  • id: Related ID whose property is being queried (depending on type, one of: "site ID", "resource ID", "reservation ID", "user ID").
  • customProperties: The custom properties object containing the property names and values.
Sample request

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

Sample Request for setCustomProperties
{	
	"apiUrl":"http://api.planyo.com",
	"apiKey":"794f56460a03fc193ffdf2c45725ad87",
	"version":1,
	"language":"EN",
	"type" : "reservation",
	"id" : 943884,
	"customProperties" :{
							"my_prop_1":"my_val_1",
							"my_prop_2":"my_val_2",
							"my_prop_3":"my_val_3"
						}
}
Related Planyo documentation

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

Sample configuration

Following is a sample proxy service that illustrates how to connect to Planyo with the init operation and use the setCustomProperties operation. The sample request for this proxy can be found in the setCustomProperties sample request.

Sample Proxy
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" name="planyo_setCustomProperties" 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="method" expression="json-eval($.method)" />
			<property name="version" expression="json-eval($.version)" />
			<property name="language" expression="json-eval($.language)" />
			<property name="type" expression="json-eval($.type)" />
			<property name="id" expression="json-eval($.id)" />
			<property name="customProperties" expression="json-eval($.customProperties)" />
			<planyo.init>
				<apiUrl>{$ctx:apiUrl}</apiUrl>
				<language>{$ctx:language}</language>
				<apiKey>{$ctx:apiKey}</apiKey>
				<version>{$ctx:version}</version>
			</planyo.init>
			<planyo.setCustomProperties>
				<type>{$ctx:type}</type>
				<id>{$ctx:id}</id>
				<customProperties>{$ctx:customProperties}</customProperties>
			</planyo.setCustomProperties>
			<respond />
		</inSequence>
		<outSequence>
			<send />
		</outSequence>
	</target>
	<description />
</proxy>                                                                                                               
  • No labels