We will cover what public Zambdas are and when you should use them. If you are interested in creating your own public Zambda, we recommend reading the Writing Zambdas guide.
As the name implies, Public Zambdas are accessible to anyone. They do not require any authentication to use. Use public Zambdas when you wish to intentionally expose a Zambda to the public.
Example use cases:
- getting a list of available slots for scheduling an appointment
- returning a list of recent blog posts on your website
- form submissions that don't require authentication
- signing up for an appointment on a website that doesn't require authentication
If you do not already have a Zambda, you can create one by following the Writing Zambdas guide.
Navigate to https://console.zapehr.com/zambdas (opens in a new tab) and select your Zambda. Edit it to use trigger method
http_open and save your changes:
You can use the ZapEHR SDK or the
curl command to test your Zambda. You will need to replace the following values:
your_zambda_idwith the ID of the Zambda
your_zapehr_project_idwith the ID of the project that the Zambda belongs to. You can find this in the Project Settings (opens in a new tab)
You don't need an access token since this is a public Zambda.
Execute a public Zambda with the SDK:
const zambda = await zapehr.project.zambda.executePublic(
name: 'ZapEHR User',
// you can submit additional data to your Zambda here
If you try modifying your project ID and you will see that the request fails with an Unauthorized error.