# Flow Widget req.post formating

**URL:** <https://devforum.zoom.us/t/flow-widget-req-post-formating/124345>\
**Category:** API and Webhooks\
**Created:** [January 10, 2025, 8:23pm UTC](https://devforum.zoom.us/t/flow-widget-req-post-formating/124345 "2025-01-10T20:23:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgibson](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@jgibson](https://devforum.zoom.us/u/jgibson)\
**Post date:** [January 10, 2025, 8:23pm UTC](https://devforum.zoom.us/t/flow-widget-req-post-formating/124345/1 "2025-01-10T20:23:33Z")

</div>

I am trying to create a script in the flow script widget to pull an address book from the contact center. I have created a server-to-server OAuth app on market place and I’m able to get an access token using postman without issue. My problem comes in when I try to do this on the flow script widget. Here is what I have for my script:

async function main () {

//header for auth token  
const auth = 'Basic REDACTED;  
const content\_type = ‘application/x-www-form-urlencoded’;

//body for auth token  
const grant\_type = ‘account\_credentials’;  
const account\_id = ‘REDACTED’;

const token\_url = ‘[https://zoom.us/oauth/token?grant\_type=](https://zoom.us/oauth/token?grant_type=)’ + grant\_type + ‘&account\_id=’ + account\_id;

//const headers = ‘{headers : {Authorization:’ + auth + ‘, Content-Type:’ + content\_type + ‘} }’;

try {  
const r = await req.post(token\_url, { headers: {‘Authorization’: auth, ‘Content-Type’: content\_type} });  
return r;  
} catch (error) {  
return error;  
}  
}

Currently this just returns {}. I think I might be passing in the header incorrectly but I’m not sure.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [January 14, 2026, 12:00pm UTC](https://devforum.zoom.us/t/flow-widget-req-post-formating/124345/2 "2026-01-14T12:00:15Z")

</div>

Closed on January 14, 2026, 12:00pm UTC

This topic was automatically closed 368 days after the last reply. New replies are no longer allowed.
