# How do you pass an array to the api

**URL:** <https://meta.discourse.org/t/how-do-you-pass-an-array-to-the-api/121598>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [June 28, 2019, 4:57pm UTC](https://meta.discourse.org/t/how-do-you-pass-an-array-to-the-api/121598 "2019-06-28T16:57:37Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)\
**Post date:** [September 6, 2020, 12:48pm UTC](https://meta.discourse.org/t/how-do-you-pass-an-array-to-the-api/121598/4 "2020-09-06T12:48:46Z")

</div>

Looks like this whole endpoint wants the values in a nested `web_hook` param:

> [@Nacho\_Caballero](#):
>
> `param is missing or the value is empty: web_hook`

I’m not a huge fan of this nested format, and there are a few endpoints like this that are on my eventual list to fix. You can make an API call to it using form-data like so:

 ![image](https://global.discourse-cdn.com/meta/original/3X/b/1/b130a503a438a684f4973a593851f35d99ed22e7.png)

Notice how each parameter has the “array” syntax `web_hook[payload_url]`. If you are sending your request with json it will look like:

```plaintext
{
  "web_hook": {
    "payload_url": "https://example.com/hello",
    "content_type": "1",
    ...
  }
} 

```

---

_[View the full topic](https://meta.discourse.org/t/how-do-you-pass-an-array-to-the-api/121598)._
