{"section":"tutorials","requestedLocale":"en","requestedSlug":"call-webhook-making-requests-to-external-services","locale":"en","slug":"call-webhook-making-requests-to-external-services","path":"docs/en/tutorials/weni-by-vtex/flows/call-webhook-making-requests-to-external-services.md","branch":"main","content":"## What is an API?\n\nThe acronym API corresponds to “Application Programming Interface“. They are a way of integrating systems, enabling benefits such as data security and ease of exchanging information\n\n![](https://cdn.statically.io/gh/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/weni-by-vtex/flows/call-webhook-making-requests-to-external-services_1.png)\n\nToday, the ability to connect and integrate with other systems is an essential feature for most solutions today. For this reason, we have an action card to use in flows precisely for this function: Call Webhook\n\n## Call webhook\n\nThe Call Webhook card is responsible for the connection between the platform and other external systems, below, we have a little about her anatomy:\n\n![](https://cdn.statically.io/gh/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/weni-by-vtex/flows/call-webhook-making-requests-to-external-services_2.png)\n\n  1. Request method: Where you define what will be the method for your API request (GET, POST, PUT or DELETE);\n  2. Request URL: Where you place the request URL for the API;\n  3. Request header: Where you place the request header along with information such as authorization tokens and content types;\n  4. Request body: Where you add a body for your request (used for POST and PUT);\n\n## How to format the request body correctly\n\nNormally, for the POST and PUT requests body we use JSON notation to send the information requested by the API. Below is an example of a JSON body:\n`{\"\"platform\"\": \"\"push\"\", \"\"author\"\": \"\"john\"\"}`\n\nHow can we reproduce this notation using the webhook call card? On the platform, we use the functions `@json` and `@object` for this construction, the first to signal which notation we will translate the values, and the second to signal the beginning and end of our keys. Translating the example above to the notation used on the platform, we have:\n`@(json (object (\"\"platform\"\", \"\"push\"\", \"\"author\"\", \"\"john\"\")))`\n\nIf you want to use a variable such as `@contact.name` for the \"\"author\"\" field in our example, we have:\n`@(json (object (\"\"platform\"\", \"\"push\"\", \"\"author\"\", contact.name)))`\n\nThe request body accepts all variables and expressions supported on the platform.\n\n### Navigating a webhook\n\nAfter making the request, you can use some expressions to query information from the response.\n\n![](https://cdn.statically.io/gh/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/weni-by-vtex/flows/call-webhook-making-requests-to-external-services_3.png)\n\n  * **@results**\n`@results.[name of the result from the Call Webhook card]`: To check the request status, such as 200, 400, 500.\n\n  * **@webhook**\nThis expression is used to retrieve values returned from the last webhook call made in the flow. For example:\n    * `@webhook`: The value of this variable is the full response from the last request made.\n    * `@webhook.results.client`: Name of the client returned by the API, if only one object is returned.\n    * `@webhook.results.0.client`: Name of the client returned by the API. If the response is in an array, you need to specify the position of the array, such as 0, 1, 2, and so on.\n\nTo store the values in other variables, you can save them as a [contact field](/en/docs/tutorials/contact-fields) or [flow result](/en/docs/tutorials/variables-glossary).\","}