# I need help with API pre-request script

**URL:** <https://forum.bubble.io/t/i-need-help-with-api-pre-request-script/289733>\
**Category:** APIs\
**Created:** [October 23, 2023, 11:15pm UTC](https://forum.bubble.io/t/i-need-help-with-api-pre-request-script/289733 "2023-10-23T23:15:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![joneschristopher379](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/joneschristopher379/32/165450_2.png) [@joneschristopher379](https://forum.bubble.io/u/joneschristopher379)\
**Post date:** [October 23, 2023, 11:15pm UTC](https://forum.bubble.io/t/i-need-help-with-api-pre-request-script/289733/1 "2023-10-23T23:15:00Z")

</div>

I have this API to integrate but it has a pre-request script that is used to generate the passwordhash, I am not sure how this can be done in the bubble API connector.

 ![retwert](https://us1.discourse-cdn.com/bubble/original/3X/5/7/575f1e280920bb391bf66f76807f89577f9aa132.png)

 ![send namecheap](https://us1.discourse-cdn.com/bubble/original/3X/4/b/4b79812a7e0f96ffb9a093868f7b91e0fa06c14d.png)

---

<div class="post-metadata">

**Author:** ![icaroalmeida](https://avatars.discourse-cdn.com/v4/letter/i/6bbea6/32.png) [@icaroalmeida](https://forum.bubble.io/u/icaroalmeida)\
**Post date:** [October 23, 2023, 11:58pm UTC](https://forum.bubble.io/t/i-need-help-with-api-pre-request-script/289733/2 "2023-10-23T23:58:50Z")

</div>

Hello friend. What is the response to this first API call?

---

<div class="post-metadata">

**Author:** ![joneschristopher379](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/joneschristopher379/32/165450_2.png) [@joneschristopher379](https://forum.bubble.io/u/joneschristopher379)\
**Post date:** [October 24, 2023, 1:45am UTC](https://forum.bubble.io/t/i-need-help-with-api-pre-request-script/289733/3 "2023-10-24T01:45:26Z")

</div>

Access denied

![dfgd](https://us1.discourse-cdn.com/bubble/original/3X/4/e/4e52efd52c559d055c65670b7ec0ce51ffab5118.png)

---

<div class="post-metadata">

**Author:** ![dorilama](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/dorilama/32/226878_2.png) [@dorilama](https://forum.bubble.io/u/dorilama)\
**Post date:** [October 24, 2023, 5:57am UTC](https://forum.bubble.io/t/i-need-help-with-api-pre-request-script/289733/4 "2023-10-24T05:57:07Z")

</div>

in nocode that would be setting up actions to calculate what you need before the api request.  
In code, with a server side action, you do your calculation and then fetch.

---

<div class="post-metadata">

**Author:** ![ankur1](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@ankur1](https://forum.bubble.io/u/ankur1)\
**Post date:** [October 24, 2023, 7:45am UTC](https://forum.bubble.io/t/i-need-help-with-api-pre-request-script/289733/5 "2023-10-24T07:45:57Z")

</div>

You need to create server side plugin for this. Run the pre-script code in Bubble server server via the plugin. Then pass the returned “passwordhash” to the api connector.

**Ankur@Nocodetalks**  
[Checkout Bubble Plugin Development Course?](https://nocodetalks.co/bubbleplugin)

---

<div class="post-metadata">

**Author:** ![joneschristopher379](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/joneschristopher379/32/165450_2.png) [@joneschristopher379](https://forum.bubble.io/u/joneschristopher379)\
**Post date:** [October 24, 2023, 10:42am UTC](https://forum.bubble.io/t/i-need-help-with-api-pre-request-script/289733/6 "2023-10-24T10:42:50Z")

</div>

So when this is done can the passwordhash be part of the api call from the bubble api connector

---

<div class="post-metadata">

**Author:** ![ankur1](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@ankur1](https://forum.bubble.io/u/ankur1)\
**Post date:** [October 24, 2023, 12:31pm UTC](https://forum.bubble.io/t/i-need-help-with-api-pre-request-script/289733/7 "2023-10-24T12:31:55Z")

</div>

@joneschristopher379, it won’t directly output into the Bubble API connector.

However, you have two options:

1. Retrieve the response from the server-side action and then pass this output to the API connector in the subsequent step.
2. Alternatively, you can make the API call directly within the server-side action, streamlining the process into a single step.

**Ankur@Nocodetalks**  
[Checkout Bubble Plugin Development Course?](https://nocodetalks.co/bubbleplugin)
