Webanizr Logo
Open / sluit menu
Module callApi

The callApi module retreives data from an external server. It calls the given url as a GET request. It can be used to retreive data from static sources or simple rest APIs.

syntax

webanizr.collect('callApi', parameters, callback)

parameters

The callApi module accepts one parameter:

url__api (required)

The url of the static source or simple API. The URL should return valid JSON data.

type__caching (optional)

This parameter only accepts one value: "inmodule". If this value is present, the json is cached and the url will no longer be used to retreive the data. The cache is cleared when reloading the page.

If this parameter is omitted no caching is applied.

callback

This callback function is called when the data is retrieved. The function gets the retreived data as parameter. If the retreival of the data results in an error the callback function is not called.

demo

https://cdn.cpmodules.webanizr.com/demo/call-api/index.html