Skip to main content

Connecting APIs

The AI can load external API connectors, set up authentication, and generate integration code.

Example Prompts

"Add a ShipStation integration to the shipping module. Reference the connectors and bob-request-api skills."

"Send a transactional email to the customer about their invoice"

"Upload this PDF to Cloudflare R2"

"Create a Stripe charge for the order total"

"Call another hook to recalculate inventory stock"

What the AI Does

1. Identifies the connector
→ Matches your request to the right connector type
→ Example: "send email" → bob.systemEmail()
→ Example: "Stripe charge" → bob.stripeApi('stripe')

2. Generates the loading code
→ Uses the shorthand method (bob.stripeApi, bob.s3Api, etc.)
→ Or generic loading: bob.loadConnector('type', 'slug')

3. Adds error handling
→ Checks connector availability before calling
→ Handles authentication failures

Result

External API

const stripe = await bob.stripeApi('stripe')
const charge = await stripe.createCharge({
amount: orderTotal,
currency: 'usd'
})

File Storage

const cdn = await bob.cdnR2Api()
await cdn.uploadFile(buffer, 'invoices/invoice-123.pdf')

System Services (no credentials needed)

const email = await bob.systemEmail()
await email.send({
to: customer.email,
subject: 'Invoice Ready',
body: emailHtml
})

Calling Other Hooks

const result = await bob.executeRequestOrThrow(
{ cfpPath: 'finance/finance.calculate-bill', cfpType: 'FLOW', type: 'cfp' },
{ docId: billId }
)

Available Connectors

MethodService
bob.stripeApi(slug)Stripe payments
bob.quickbooksApi(slug)QuickBooks accounting
bob.s3Api(slug)AWS S3 storage
bob.cdnR2Api()Cloudflare R2 storage
bob.httpApi(slug)Generic HTTP client
bob.slackApi(slug)Slack messaging
bob.ftpApi(slug)FTP file transfer
bob.systemEmail()Transactional email
bob.systemTax()Tax calculation
bob.systemCurrency()Currency conversion
bob.systemPdfGenerator()PDF generation
bob.loadConnector(type, slug)Any registered connector

Tips for Better Results

  • Name the service — "Stripe", "S3", "QuickBooks" helps the AI pick the right connector
  • Describe the operation — "upload a file", "create a charge", "send an email"
  • Mention the slug — if you know the API slug in your workspace, include it