apiPost

api.apiPost<T>(endpoint, data) Convenience method that sends a POST request with a JSON body and returns the parsed JSON response.

Arguments
argumentTypeDescription
endpointrequiredstringAPI path starting with /api/v1/... (e.g. /api/v1/cards/123). See the REST section for the full list of endpoints.
datarequiredunknownRequest body. The SDK serializes it as JSON and sets Content-Type: application/json.

Return value - Promise<T>

const api = window.Addon.iframe();

const comment = await api.apiPost(
  `/api/v1/cards/${cardId}/comments`,
  { text: 'Hello from my addon!' },
);
// { id, text, author_id, created, ... }
logo
FlowFast
If you have any questions or need help with integration feel free to write us at support@flowfast.io