Quick-access syntax cheatsheet for common Zoho API calls, REST integrations, and complex data manipulation.
Make a standard GET request to an external API, including headers and parameters.
headerMap = Map();
headerMap.put("Authorization", "Bearer YOUR_TOKEN");
headerMap.put("Content-Type", "application/json");
paramsMap = Map();
paramsMap.put("status", "active");
response = invokeurl
[
url: "https://api.example.com/v1/users"
type: GET
parameters: paramsMap
headers: headerMap
];
info response;Make a POST request to send JSON data to an external API endpoint.
headerMap = Map();
headerMap.put("Authorization", "Bearer YOUR_TOKEN");
headerMap.put("Content-Type", "application/json");
payload = Map();
payload.put("first_name", "Sunny");
payload.put("email", "sunny@example.com");
response = invokeurl
[
url: "https://api.example.com/v1/users"
type: POST
parameters: payload.toString()
headers: headerMap
];
info response;Parse a JSON array string into a Deluge List, iterate through it, and extract map properties.
jsonString = "[{\"id\":1, \"name\":\"Apple\"}, {\"id\":2, \"name\":\"Banana\"}]";
// Parse string to list
itemsList = jsonString.toJSONList();
for each item in itemsList
{
// Extract map values
itemId = item.get("id");
itemName = item.get("name");
info "Found item: " + itemName;
}