Fetch networks

Note:

  • Each time the zoho.connect.myNetworks integration task is executed, it triggers an API request in the back-end. This call is deducted from the external calls limit available for the service from which the task is executed, based on your pricing plan.
  • Only actual executions that receive a response (whether success or failure) are counted, not the number of times the task appears in the script. For example, if zoho.connect.myNetworks integration task is placed inside a for each task that iterates five times, the number of external calls consumed will be five, even though the task appears only once in the script. 

Overview

This task is used to fetch the list of networks to which the user is associated.

Syntax

<variable> = zoho.connect.myNetworks(<connectionName>);

where,

ParameterDescriptionData type
<variable>is the variable which will hold the returned response.KEY-VALUE

<connectionName>

(optional)*

is the name of the Zoho connect connection.

*Note: This param is not applicable to Zoho Creator and mandatory in Zoho Cliq.

TEXT

Note:

In integration tasks, the parameters must be in the defined order as given in the syntax, for the Deluge task to be executed. If you choose to use an optional parameter, ensure that all preceding parameters in the syntax are explicitly specified. If a preceding optional parameter is not required, a null value can be assigned instead, to maintain the defined syntax order.

For example, in the below syntax, options_map and connection are optional parameters:

<variable> = zoho.crm.v8.task (<module_name>, <record_details>, <options_map>, <connection>);

If you want to use the connection parameter, module_name, record_details and options_map must be specified in the 
exact order as the syntax. You can assign an empty map to the options_map parameter if it is not required.

 

Example

The following snippet can be used to fetch the list of networks you are associated with.

networkDetails = zoho.connect.myNetworks();

where,

networkDetails
is a variable which will hold the response.

Sample Response

Following is a sample success response:

{"networks": [
"{\"name\":\"ManageEngine PitStop\",\"id\":\"12913000000002002\"}",
"{\"name\":\"Creator Certified Developers\",\"id\":\"23392000000002002\"}",
"{\"name\":\"DC Partner Network\",\"id\":\"34630000000002002\"}",
"{\"name\":\"ManageEngine ADSolutions\",\"id\":\"19687000000002002\"}",
"{\"name\":\"Zoho Books Advisors\",\"id\":\"23476000000002002\"}"
],"emailId":"testuser@zohocorp.com"
}

To fetch the network IDs (or the scope IDs), use the following snippet:

<variable> = <response_variable>.get("networks");
for each <loop_variable> in <variable>
{
info <loop_variable>.get("id");
}

Note: The network id (also referred to as the Scope ID) returned by the response above is what would be used in almost every ZOHO Connect integration task. Alternatively, the user can get the Scope ID from the settings of a group which is under the corresponding network.

Related Links