← Explore by outcome

PRACTICAL BUILD GUIDE

Build Bots and API Integrations for Real Workflows

A bot or integration connects an action to a result in another service. Begin with one useful workflow: notify a team about an enquiry, look up an order or create a support record. A narrowly scoped integration is easier to verify than a general assistant with access to every system.

STEP 1

Choose the interaction model

A notification integration sends information after an event. An interactive bot also accepts commands or messages, so it needs to identify the user and decide what they may do. Sketch the allowed actions and their responses before adding natural-language input. A small command menu is often sufficient for an internal tool.

  • Identify the sender and intended recipient for each action.
  • Distinguish read-only lookups from actions that change records.
  • Define the response when an order or customer cannot be found.

STEP 2

Put trust boundaries on the server

Browser code is visible to visitors and cannot keep a bot token secret. Send browser requests to your backend, validate the input and call the external API there. For incoming webhooks, use the authentication or signature mechanism documented by the provider. Do not rely on an obscure URL as the only protection.

  • Keep tokens in environment configuration.
  • Restrict the destination chat or account on the server.
  • Check authorisation for every operation that accesses private records.

STEP 3

Handle the provider’s response

An HTTP response alone may not describe the whole outcome; inspect the API’s documented success and error fields. Set request timeouts and apply a retry policy appropriate to the operation. When creating records, use idempotency support where the provider offers it, or maintain your own processed-event record.

  • Treat rate limiting separately from invalid credentials.
  • Avoid exposing raw provider errors to public visitors.
  • Keep saved enquiries even if a notification cannot be delivered.

STEP 4

Test the handoff end to end

Use a dedicated test destination and fictional input. Check the final message or record, including line breaks, escaping and long text. Disconnect the provider during a test and verify the user still gets an accurate result. Review access when team members leave or the integration changes ownership.

  • Verify that a public user cannot choose an arbitrary recipient.
  • Test duplicate webhook delivery.
  • Document how to rotate credentials and restore service.

Use AI with a clear specification

Adapt the bracketed details to your project. Ask your coding assistant to explain its changes, then run the examples and checks yourself.

Build [one bot or integration workflow] between [source] and [destination]. Keep credentials and recipient configuration server-side. Add validation, authorisation, timeouts and safe error responses. Explain duplicate handling and test the final result in a dedicated test destination.

BUILD IT WITH HOW2CODE

Need this adapted to your business?

Tell us about your workflow, existing tools and expected result. We’ll review the brief and discuss the scope with you.

Discuss this project →