Can I make POST requests to Stripe API endpoints d...
# support
h
I tried using a tool API request , and it looks like it allows setting Content-Type: application/x-www-form-urlencoded required by Stripe, but it seems like it keeps sending the request body as json, and I keep getting an error. Has anyone resolved this issue or found a PCI-compliant workaround? https://cdn.discordapp.com/attachments/1412127320080126047/1412127320508071956/image.png?ex=68b7298d&is=68b5d80d&hm=d6c3e75707da6d2e4bcb2024112591e6ff5dd3f192b1e7a0c3aa7482755e3c4e&
t
Did you see a body-type function there?
h
No....I got your point. So, the task is not doable from within VAPI, correct?
c
Hi Harter, To make POST requests to Stripe API endpoints directly from Vapi, you'll need to use webhooks for server authentication. You can authenticate your server endpoints by using a secret token, custom headers, or OAuth2. For example, with custom headers, you might configure it like this:
Copy code
json
{
  "server": {
    "url": "https://your-server.com/webhook",
    "headers": {
      "Authorization": "Bearer your-api-key"
    }
  }
}
If you choose OAuth2 authentication, you'll need to configure OAuth2 credentials for Vapi to obtain and refresh access tokens. For more information, you can refer to the [Server Authentication documentation](https://docs.vapi.ai/server-url/server-authentication). Let me know if you need further assistance!
h
Hi, Thank you for your reply! The issue I can't figure out is how to send a request with body formatted as application/x-www-form-urlencoded. Does VAPI have this capability? Please let me know
t
I am not sure it does,. You can create a workflow to convert the message/info from json into any format you want before sending to the stripe API.
h
Thanks for the idea! You mean the VAPI workflow?
t
No, using make.com
c
Hi Harter, Yes, you can make POST requests to external APIs like the Stripe API from Vapi, especially within a workflow. You would typically do this by configuring a tool using the Vapi dashboard that can make HTTP requests to any external API endpoint. Here's a simplified example: 1. **Create a Tool**: In the Vapi dashboard, navigate to 'Tools' and create a new tool. Specify the API endpoint you want to call (e.g., Stripe) and configure any required parameters and headers, including an API key if needed for authentication. 2. **Integrate the Tool in a Workflow**: Use this tool within your workflow to handle specific actions or gather data as necessary. For more details, you might want to refer to our [E-commerce order management workflow](https://docs.vapi.ai/workflows/examples/ecommerce-order-management) example which demonstrates integrating with external APIs. If you have any more questions, feel free to ask!
5 Views