Node.js API Client
The Buzzy API Node.js client provides a convenient way to interact with the Buzzy REST API from Node.js applications. This client handles authentication, request formatting, and response parsing, making it easier to use the API.
Installation
npm install buzzy-api-nodejsUsage
import {
login,
insertMicroAppRow,
getMicroAppData
} from 'buzzy-api-nodejs';
// Example: Login and get auth credentials
async function example() {
const auth = await login({
url: 'https://your-buzzy-instance.com',
email: '[email protected]',
password: 'password'
});
// Use auth credentials for other API calls
const { token, userId } = auth;
// Example: Get data from a MicroApp
const rows = await getMicroAppData({
microAppID: 'microAppID',
authToken: token,
userId: userId,
url: 'https://your-buzzy-instance.com'
});
console.log(rows);
}API Reference
login
Logs in a user and retrieves authentication token and user ID.
Parameters:
url(string): The base URL of your Buzzy instanceemail(string): The user's emailpassword(string): The user's password
Returns:
Promise resolving to
{ token, userId }
logout
Logs out a user by removing their authentication token.
Parameters:
authToken(string): Authentication tokenuserId(string): User IDurl(string): Buzzy instance URL
Returns:
Promise resolving to logout response
Example:
getUserID
Finds a user ID based on an email address.
Parameters:
authToken(string): Authentication tokenuserId(string): User ID of the requesting userurl(string): The base URL of your Buzzy instanceemail(string): The email to look up
Returns:
Promise resolving to an object containing the user ID
insertMicroAppRow
Inserts a new row into a specified MicroApp.
Parameters:
microAppID(string): The ID of the MicroAppauthToken(string): Authentication tokenuserId(string): User ID of the requesting userurl(string): The base URL of your Buzzy instancerowData(object): The data to insertembeddingRowID(string, optional): The ID of the embedding rowviewers(array, optional): Array of user IDs who can view this rowuserID(string, optional): The ID of the creator
Returns:
Promise resolving to an object containing the inserted row ID
getMicroAppData
Retrieves data from a specified MicroApp.
Parameters:
microAppID(string): The ID of the MicroAppauthToken(string): Authentication tokenuserId(string): User ID of the requesting userurl(string): The base URL of your Buzzy instanceoptSearchFilters(object, optional): Optional search filterssearchFilter(object, optional): Primary search filteroptViewFilters(object, optional): Optional view filters for filtering results, including geo/spatial queries usingsortValGeometry(see geo/spatial query examples)optIsVectorSearch(boolean, optional): Whether to use vector searchoptVectorSearchString(string, optional): Vector search stringoptLimit(number, optional): Number of results to return
Returns:
Promise resolving to an array of rows
getMicroAppDataRow
Retrieves a specific row from a MicroApp.
Parameters:
rowID(string): The ID of the rowauthToken(string): Authentication tokenuserId(string): User ID of the requesting userurl(string): The base URL of your Buzzy instance
Returns:
Promise resolving to the row data
removeMicroAppRow
Removes a specific row from a MicroApp.
Parameters:
rowID(string): The ID of the row to removeauthToken(string): Authentication tokenuserId(string): User ID of the requesting userurl(string): The base URL of your Buzzy instance
Returns:
Promise resolving to the operation result
updateMicroAppDataRow
Updates a specific row in a MicroApp.
Parameters:
rowID(string): The ID of the row to updateauthToken(string): Authentication tokenuserId(string): User ID of the requesting userurl(string): The base URL of your Buzzy instancerowData(object): The new data for the rowcreatorID(string, optional): The ID of the creator
Returns:
Promise resolving to a boolean indicating success
insertOrganization
Creates a new organization.
Parameters:
authToken(string): Authentication tokenuserId(string): User ID of the requesting userurl(string): The base URL of your Buzzy instanceorganizationInfo(object): Information about the organization
Returns:
Promise resolving to the operation result
insertTeam
Creates a new team within an organization.
Parameters:
authToken(string): Authentication tokenuserId(string): User ID of the requesting userurl(string): The base URL of your Buzzy instanceteamInfo(object): Information about the teamadminID(string, optional): The ID of the admin user
Returns:
Promise resolving to the operation result
insertTeamMembers
Adds members to teams.
Parameters:
authToken(string): Authentication tokenuserId(string): User ID of the requesting userurl(string): The base URL of your Buzzy instanceteamIDs(array): Array of team IDsemails(array, optional): Array of user emailsuserIDs(array, optional): Array of user IDstargetInitialApp(string, optional): Initial app for new userstargetInitialScreen(string, optional): Initial screen for new userstargetRoute(string, optional): Route for new users
Returns:
Promise resolving to the operation result
Advanced Team Management
enforceTeamMembership
Enforces team membership for a user by adding/removing them from specified teams.
Parameters:
authToken(string): Authentication tokenuserId(string): User ID making the requesturl(string): Buzzy instance URLuserID(string): User ID to manage (optional if email provided)email(string): Email to manage (optional if userID provided)teamIDs(array): Array of team IDs to enforce membership for
Returns:
Promise resolving to enforcement response
Example:
getTeamMembers
Gets team members for specified teams.
Parameters:
authToken(string): Authentication tokenuserId(string): User IDurl(string): Buzzy instance URLteamIDs(array): Array of team IDs to get members for
Returns:
Promise resolving to team members response with array of user IDs
Example:
AI-Powered App Creation
createAppWithPrompt
Creates an app using AI prompt.
Parameters:
url(string): Buzzy instance URLapiKey(string): API key for authenticationuserEmail(string): User's emailappPrompt(string): AI prompt for app creationattachments(array, optional): Optional attachments array
Returns:
Promise resolving to app creation response with buzzID
Example:
Organization Management
readOrganization
Retrieves information about a specific organization.
Parameters:
authToken(string): Authentication tokenuserId(string): User ID of the requesting userurl(string): The base URL of your Buzzy instanceorganizationID(string): The ID of the organization to read
Returns:
Promise resolving to the organization data
Example:
updateOrganization
Updates an existing organization's information.
Parameters:
authToken(string): Authentication tokenuserId(string): User ID of the requesting userurl(string): The base URL of your Buzzy instanceorganizationID(string): The ID of the organization to updateorganizationInfo(object): Updated organization information
Returns:
Promise resolving to the update result
Example:
deleteOrganization
Deletes an organization.
Parameters:
authToken(string): Authentication tokenuserId(string): User ID of the requesting userurl(string): The base URL of your Buzzy instanceorganizationID(string): The ID of the organization to delete
Returns:
Promise resolving to the deletion result
Example:
Team Management
readTeam
Retrieves information about a specific team.
Parameters:
authToken(string): Authentication tokenuserId(string): User ID of the requesting userurl(string): The base URL of your Buzzy instanceteamID(string): The ID of the team to read
Returns:
Promise resolving to the team data
Example:
updateTeam
Updates an existing team's information.
Parameters:
authToken(string): Authentication tokenuserId(string): User ID of the requesting userurl(string): The base URL of your Buzzy instanceteamID(string): The ID of the team to updateteamInfo(object): Updated team information
Returns:
Promise resolving to the update result
Example:
deleteTeam
Deletes a team.
Parameters:
authToken(string): Authentication tokenuserId(string): User ID of the requesting userurl(string): The base URL of your Buzzy instanceteamID(string): The ID of the team to delete
Returns:
Promise resolving to the deletion result
Example:
readTeamMember
Retrieves information about a specific team member.
Parameters:
authToken(string): Authentication tokenuserId(string): User ID of the requesting userurl(string): The base URL of your Buzzy instanceteamID(string): The ID of the teamuserID(string): The ID of the team member
Returns:
Promise resolving to the team member data
Example:
updateTeamMember
Updates a team member's role or information.
Parameters:
authToken(string): Authentication tokenuserId(string): User ID of the requesting userurl(string): The base URL of your Buzzy instanceteamID(string): The ID of the teamuserID(string): The ID of the team member to updaterole(string): The new role for the team member ('admin' or 'member')
Returns:
Promise resolving to the update result
Example:
deleteTeamMember
Removes a member from a team.
Parameters:
authToken(string): Authentication tokenuserId(string): User ID of the requesting userurl(string): The base URL of your Buzzy instanceteamID(string): The ID of the teamuserID(string): The ID of the team member to remove
Returns:
Promise resolving to the deletion result
Example:
enforceTeamMembership
Enforces team membership for a user by adding them to specified teams.
Parameters:
authToken(string): Authentication tokenuserId(string): User ID of the requesting userurl(string): The base URL of your Buzzy instanceemail(string): Email of the user to add to teamsteamIDs(array): Array of team IDs to add the user to
Returns:
Promise resolving to the enforcement result
Example:
getTeamMembers
Retrieves all members for specified teams.
Parameters:
authToken(string): Authentication tokenuserId(string): User ID of the requesting userurl(string): The base URL of your Buzzy instanceteamIDs(array): Array of team IDs to get members for
Returns:
Promise resolving to an array of team members
Example:
MicroAppChild Operations
MicroAppChild operations allow you to manage file attachments and child items within MicroApp data structures. These operations are essential for handling file uploads, attachments, and hierarchical data relationships.
createMicroAppChild
Creates a new MicroAppChild entry, typically used for file attachments or child data items.
Parameters:
authToken(string): Authentication tokenuserId(string): User ID of the requesting userurl(string): The base URL of your Buzzy instancemicroAppResourceID(string): ID of the MicroApp resourceappID(string): ID of the parent app itemfieldID(string): ID of the parent fieldcontent(object): Content data for the child item
Returns:
Promise resolving to an object containing the created child ID
Example:
getChildItemsByField
Retrieves all MicroAppChild items for a specific parent app item and field.
Parameters:
authToken(string): Authentication tokenuserId(string): User ID of the requesting userurl(string): The base URL of your Buzzy instanceappID(string): ID of the parent app itemfieldID(string): ID of the parent field
Returns:
Promise resolving to an array of child items
Example:
readMicroAppChild
Reads a specific MicroAppChild item by its ID.
Parameters:
authToken(string): Authentication tokenuserId(string): User ID of the requesting userurl(string): The base URL of your Buzzy instancechildID(string): ID of the child item to read
Returns:
Promise resolving to the child item data
Example:
updateMicroAppChild
Updates the content of an existing MicroAppChild item.
Parameters:
authToken(string): Authentication tokenuserId(string): User ID of the requesting userurl(string): The base URL of your Buzzy instancechildID(string): ID of the child item to updatecontent(object): New content data for the child item
Returns:
Promise resolving to the update result
Example:
removeMicroAppChild
Deletes a MicroAppChild item.
Parameters:
authToken(string): Authentication tokenuserId(string): User ID of the requesting userurl(string): The base URL of your Buzzy instancechildID(string): ID of the child item to delete
Returns:
Promise resolving to the deletion result
Example:
AI-Powered App Creation
createAppWithPrompt
Creates a new app using AI based on a natural language prompt.
Parameters:
authToken(string): Authentication tokenuserId(string): User ID of the requesting userurl(string): The base URL of your Buzzy instanceprompt(string): Natural language description of the app to createorganizationID(string): ID of the organization to create the app in
Returns:
Promise resolving to the created app information
Example:
S3 File Operations
copyS3File
Copies a file between S3 locations.
Parameters:
authToken(string): Authentication tokenuserId(string): User IDurl(string): Buzzy instance URLsourceResourceID(string): Source resource IDdestinationResourceID(string): Destination resource IDfileKey(string): File key to copynewFileKey(string, optional): Optional new file key
Returns:
Promise resolving to copy response with signed URL
Example:
uploadFileToS3
Uploads a file to S3 from a URL.
Parameters:
authToken(string): Authentication tokenuserId(string): User IDurl(string): Buzzy instance URLresourceID(string): Resource IDfieldID(string): Field IDfileUrl(string): URL of file to uploadfilename(string): Filename for the upload
Returns:
Promise resolving to upload response with URL
Example:
Comprehensive Examples
File Attachment Workflow
Here's a complete example showing how to create, manage, and delete file attachments using MicroAppChild operations:
Organization and Team Management Lifecycle
Last updated