postUrl()

postUrl()

Overview

The post url deluge task corresponds to a HTTP POST request. It is normally supported by services to perform write operation like adding or updating data.

Note: The returned response can have a maximum size of 50 mb. If this limit is crossed, a runtime error will be encountered.

Return Type

  • Text
  • Key-value

Syntax

To get the response in text or key-value format depending on the boolean value:

<variable> = postUrl( <stringUrl><body>,<boolean> );

(OR)

To post along with the header:

<variable> = postUrl( <stringUrl><body>, <headerMap>,<boolean> );
ParameterData typeDescription

<variable>

(optional)

TEXT

KEY-VALUE

Variable which will contain the returned response.
<stringUrl>TEXT

The url which will return the response.

<body>

KEY-VALUE

TEXT

Data to be posted.

<headerMap>

(optional)

KEY-VALUE

Variable holding header values as key-value pairs.

<boolean>

(optional)

BOOLEAN

Value 'true' will return a simple response content as text.

Value 'false' will return the response code (http status code), and response content as key-value.

Default value is true.

Examples

Lets say we have a Zoho Creator application App1 with a form named "Form1" with fields "Name1" , "Email1" and "Phone1". And, we have another application App2 with a form named "Form2" with fields "Name2", "Email2" and "Phone2". When a record is added to Form1, the same record needs to be added automatically to Form2. To achieve this we can use the following snippet in the On Success workflow of Form1.

myMap = map();
myMap.put("authtoken", "<your_API_key>");
myMap.put("scope", "creatorapi");
myMap.put("Name2", input.Name1);
myMap.put("Email2", input.Email1);
myMap.put("Phone2", input.Phone1);

resp = postUrl("https://creator.zoho.com/api/<appowner>/json/App2/form/Form2/record/add/", myMap);

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohodeluge.com