A basic API for learning how to integrate your app with the Jiter API
This app exposes API routes which allow a user to create reminders to purchase groceries, edit reminders, and receive reminders all using Jiter events.
- Install dependencies via
yarn- Install
yarnif you don't already have it installed
- Install
- Run
yarn setupto create your local environment file (or optionally runcp .env.sample .env) - Get your API keys and signing secret and add them to
.env - Start your local reverse proxy with
yarn proxyand then copy thehttpsvalue forForwarding(e.g.,https://123456789ABC.ngrok.io) and add it as theBASE_URLin your.env - Start the app with
yarn dev(or optionally build and start withyarn build && yarn start) - Use an API Client like Insomnia or make a CURL request to your API and watch the logs for responses
To create a new event, copy the snippet below and execute it in a terminal after replacing the API token with your token:
curl --request POST \
--url http://localhost:8000/api/events \
--header 'x-api-token: YOUR_API_TOKEN'Once the app is up and running, there are a variety of routes you can utilize to experiment with the Jiter API:
| Method | Route | Purpose |
|---|---|---|
POST |
/event |
Creates new event that will be delivered one minute in the future |
GET |
/api/events |
Finds all events |
GET |
/events/:id |
Finds event by id |
PUT |
/event/:id |
Updates event by id |
POST |
/api/webhooks/jiter |
Handles your payload |
After creating events, you'll see console.log output each time you receive a callback.