# Wowza Rest api using curl in php always return key not send in header

**URL:** <https://community.wowza.com/t/wowza-rest-api-using-curl-in-php-always-return-key-not-send-in-header/53560>\
**Category:** Wowza Developer Dojo\
**Created:** [June 24, 2019, 2:50pm UTC](https://community.wowza.com/t/wowza-rest-api-using-curl-in-php-always-return-key-not-send-in-header/53560 "2019-06-24T14:50:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hidayat\_Ullah](https://avatars.discourse-cdn.com/v4/letter/h/6a8cbe/32.png) [@Hidayat\_Ullah](https://community.wowza.com/u/Hidayat_Ullah)\
**Post date:** [June 24, 2019, 2:50pm UTC](https://community.wowza.com/t/wowza-rest-api-using-curl-in-php-always-return-key-not-send-in-header/53560/1 "2019-06-24T14:50:55Z")

</div>

I’m trying to consume wowza rest api using php with curl following is my code

```auto
$url = 'https://api-sandbox.cloud.wowza.com/api/v1.3/live_streams';

$headers = array(
"wsc-access-key:myaccessKy;
wsc-api-key:myapikey");
$cr = curl_init($url);
     
      curl_setopt($cr,CURLOPT_POST,1);
      curl_setopt($cr, CURLOPT_HTTPHEADER,$headers);
      $res = curl_exec($cr);
      curl_close($cr);
      dd($res);

```

when i dd the response i get this

{“meta”:{“status”:401,“code”:“ERR-401-NoApiKey”,“title”:“No Api Key Error”,“message”:“No API key sent in header.”,“description”:""}}

What could be the reason,

Thanks.

---

<div class="post-metadata">

**Author:** ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)\
**Post date:** [June 24, 2019, 11:00pm UTC](https://community.wowza.com/t/wowza-rest-api-using-curl-in-php-always-return-key-not-send-in-header/53560/2 "2019-06-24T23:00:05Z")

</div>

Have you competed this step already?

* * *

You will need to request API access via your cloud account and then you will see the API keys in your account.

[https://www.wowza.com/docs/how-to-use-the-wowza-streaming-cloud-rest-api#requesting-access-to-the-api](https://www.wowza.com/docs/how-to-use-the-wowza-streaming-cloud-rest-api#requesting-access-to-the-api)

---

<div class="post-metadata">

**Author:** ![Hidayat\_Ullah](https://avatars.discourse-cdn.com/v4/letter/h/6a8cbe/32.png) [@Hidayat\_Ullah](https://community.wowza.com/u/Hidayat_Ullah)\
**Post date:** [June 25, 2019, 9:07am UTC](https://community.wowza.com/t/wowza-rest-api-using-curl-in-php-always-return-key-not-send-in-header/53560/3 "2019-06-25T09:07:55Z")

</div>

Yes

i got my api and access key and send it in the header is shown in the code above but here i removed my actual key.

but still it return the above response ?

---

<div class="post-metadata">

**Author:** ![Amara\_Graham](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/amara_graham/32/381_2.png) [@Amara\_Graham](https://community.wowza.com/u/Amara_Graham)\
**Post date:** [September 23, 2019, 3:51pm UTC](https://community.wowza.com/t/wowza-rest-api-using-curl-in-php-always-return-key-not-send-in-header/53560/4 "2019-09-23T15:51:07Z")

</div>

Each key in your header array needs to be in quotes.

```auto
$headers = array("wsc-access-key:myaccessKy";"wsc-api-key:myapikey");

```
