API - Planyo Web Services - process_template

Estás aquí: Planyo » Ayuda » API » process_template

process_template

Description:

Template processor. This works the same way as in the email notifications or other templates. Depending on the context given by input parameters, you can use tags from Q204 and/or Q205. You can always use tags from Q206 and Q221 and the conditional tags from Q207. You must specify one of: site_id, resource_id or reservation_id to give appropriate context for the tags.

Input:

reservation_id int optional
ID of the reservation (required only for reservation-specific tags from Q204)
resource_id int optional
ID of the resource (required only for resource-specific tags from Q205)
site_id int optional
ID of the site (required only for meta-sites when site-specific tags listed in Q206 are used)
template string required
Template to be processed. If the template includes the tag $(resources) and both resource_id and reservation_id are empty, then you can iterate through all the site's resources and specify the inner (per-resource) template in the inner_template parameter. The tag $(resources) will be replaced by the resource listing.
inner_template string optional
This parameter is optional and must be only passed when template includes the tag $(resources) and both reservation_id and resource_id are empty. The inner template will be inserted for each resource of the site and can use resource-specific tags (from Q205).
method string required
must be set to process_template
language string optional
by specifying a 2-letter (ISO 639-1) language code (all capital letters e.g. EN, DE, FR, ES, IT) you can change the language of the text values returned
api_key string required
your API key - Click here to get your key. If your API key uses a hash key, you must also include the parameters hash_key and hash_timestamp.

Output:

- string
Processed template with tags replaced by appropriate values. The output code is returned directly in the output data

Sample:

Click here for a PHP sample which you can embed into your webpage

API playground:

Click here to test this function in the API playground.