# Unable to Authenticate from Athena API from Script Widget

**URL:** <https://devforum.zoom.us/t/unable-to-authenticate-from-athena-api-from-script-widget/133363>\
**Category:** Contact Center\
**Tags:** api\
**Created:** [May 29, 2025, 2:42pm UTC](https://devforum.zoom.us/t/unable-to-authenticate-from-athena-api-from-script-widget/133363 "2025-05-29T14:42:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nilashee](https://avatars.discourse-cdn.com/v4/letter/n/71c47a/32.png) [@Nilashee](https://devforum.zoom.us/u/Nilashee)\
**Post date:** [May 29, 2025, 2:42pm UTC](https://devforum.zoom.us/t/unable-to-authenticate-from-athena-api-from-script-widget/133363/1 "2025-05-29T14:42:13Z")

</div>

I have successfully tested authentication with Postmand using Basic Auth and was able to get the token as expected. But when I try the same using Zoom Script Widget, I consistently receive a 400 error from Athena indicating “Client ID required”. I appears that the script widget may not be sending he Authorization header correctly or getting stripped out or something. Even moving client\_id and Client\_secret into the body was also getting rejected by Athena API. Could you please confirm whether:

- Custom ‘Authorization’ headers are supported in Script Widgets?
- There’s an alternative way to implement Basic Auth from within the Script Widget environment?
- Or what’s the best way to proceed with this scenario?

---

<div class="post-metadata">

**Author:** ![justin.steinberg](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/justin.steinberg/32/9988_2.png) [@justin.steinberg](https://devforum.zoom.us/u/justin.steinberg)\
**Post date:** [June 1, 2025, 7:54pm UTC](https://devforum.zoom.us/t/unable-to-authenticate-from-athena-api-from-script-widget/133363/2 "2025-06-01T19:54:55Z")

</div>

@Nilashee, yes you can set the headers in your script.

Please take a look at this article, which shows an Authorization header.

> **[Script widget examples](https://support.zoom.com/hc/en/article?id=zm_kb&sysparm_article=KB0058807)**
>
> Contact center admins can add and edit the Script widget. This article contains various example configurations

It’s also possible that the Athena API requires additional request headers, such as ‘Accept’.

---

<div class="post-metadata">

**Author:** ![Nilashee](https://avatars.discourse-cdn.com/v4/letter/n/71c47a/32.png) [@Nilashee](https://devforum.zoom.us/u/Nilashee)\
**Post date:** [June 2, 2025, 3:17pm UTC](https://devforum.zoom.us/t/unable-to-authenticate-from-athena-api-from-script-widget/133363/3 "2025-06-02T15:17:05Z")

</div>

Hi Justin,  
Thanks for that. I have made some progress. It’s not throwing any error but the response is coming empty too. Do you see if I am doing anything wrong here? How to get the response value?  
try{  
const data={  
“grant\_type”: “client\_credentials”,  
“scope”: “athena/service/Athenanet.MDP.\*”  
}  
const response= await req.post(url, data, {  
headers: {  
“Authorization”: authHeader,  
“Content-Type”: “application/x-www-form-urlencoded”  
}  
})  
log.debug(“Response :”, response.toString());  
}  
catch(err){  
log.debug(err.message);  
}

Update: I have also tested the same with HTTP Call widget, get a 200 back but nothing in the response. Any idea why?
