apiGet

api.apiGet<T>(endpoint) Convenience method that sends a GET request to the public REST API and returns the parsed JSON body. Throws if the response is not 2xx.

Arguments
argumentTypeDescription
endpointrequiredstringAPI path starting with /api/v1/... (e.g. /api/v1/cards/123). See the REST section for the full list of endpoints.

Return value - Promise<T>

const api = window.Addon.iframe();

const currentUser = await api.apiGet('/api/v1/users/current');
// { id, email, full_name, avatar_url, ... }

const spaces = await api.apiGet('/api/v1/spaces');
// [{ id, title, ... }, ...]
logo
Kaiten
If you have any questions or need help with integration feel free to write us at support@kaiten.ru