# 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:** 3

<div class="post-metadata">

**Author:** ![Nacho\_Caballero](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nacho_caballero/32/130189_2.png) [@Nacho\_Caballero](https://meta.discourse.org/u/Nacho_Caballero)\
**Post date:** [September 6, 2020, 12:35pm UTC](https://meta.discourse.org/t/how-do-you-pass-an-array-to-the-api/121598/3 "2020-09-06T12:35:54Z")

</div>

Hey Blake,

Is this still the recommended way to send an array to the API? I’m trying to create a web hook and I’m not able to send the `web_hook_event_type_ids` array parameter.

I’ve tried it with CURL (as multipart/form-data)

```plaintext
curl -X POST "https://MYSITE.com/admin/api/web_hooks" \
  -H "Api-Key: KEY" \
  -H "Api-Username: USER" \
  -F "payload_url=https://MYOTHERSITE.com" \
  -F "content_type=1" \
  -F "wildcard_web_hook=false" \
  -F "verify_certificate=true" \
  -F "active=true" \
  -F "web_hook_event_type_ids[]=2"

# I get
{"errors":["param is missing or the value is empty: web_hook"]}%

```

And with [httpie](https://httpie.org/docs#usage) (as application/json):

```plaintext
http POST https://MYSITE.com/admin/api/web_hooks \
  Api-Key:KEY \
  Api-Username:USER \
  payload_url=https://MYOTHERSITE.com \
  content_type=1 \
  wildcard_web_hook:=false \
  verify_certificate:=true \
  active:=true \
  web_hook_event_type_ids:='[2]'

# I get
{
    "errors": [
        "Web hook event types can't be blank"
    ]
}

```

---

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