# Api error show TypeError: i is not a function

**URL:** <https://community.hubspot.com/t/api-error-show-typeerror-i-is-not-a-function/135385>\
**Category:** CMS Development\
**Tags:** free\
**Created:** [June 30, 2025, 5:52am UTC](https://community.hubspot.com/t/api-error-show-typeerror-i-is-not-a-function/135385 "2025-06-30T05:52:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sagar\_tomar1](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@sagar\_tomar1](https://community.hubspot.com/u/sagar_tomar1)\
**Post date:** [June 30, 2025, 5:52am UTC](https://community.hubspot.com/t/api-error-show-typeerror-i-is-not-a-function/135385/1 "2025-06-30T05:52:13Z")

</div>

Thank you in advance

72c72d32-09ab-45bf-9…f89deb5c56f468137:1 Error sending SMS: TypeError: i is not a function

```
at t.N (72c72d32-09ab-45bf-9…b5c56f468137:1:4633)

at t (index.js:403:30)

at Object.call (index.js:102:30)

at MessagePort.d (index.js:408:42)

```

N @ 72c72d32-09ab-45bf-9…f89deb5c56f468137:1

t @ index.js:403

call @ index.js:102

d @ index.js:408

i am facing ablove in

@hubspot/ui-extensions this extension when i call a api and my fuction is

const response = await fetchApi(‘[http://localhost:8000/send-message](http://localhost:8000/send-message)’, {

```
    method: 'POST', // Method is a direct option for fetchApi

    headers: {

      'Content-Type': 'application/json',

    },

    body: JSON.stringify({

      number: phoneNumber,

      portalId: portalId,

      message: input,

    }),

  });

```

---

<div class="post-metadata">

**Author:** ![Berangere](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/berangere/32/220784_2.png) [@Berangere](https://community.hubspot.com/u/Berangere)\
**Post date:** [June 30, 2025, 5:05pm UTC](https://community.hubspot.com/t/api-error-show-typeerror-i-is-not-a-function/135385/2 "2025-06-30T17:05:34Z")

</div>

Hi [@sagar\_tomar1](https://community.hubspot.com/t5/user/viewprofilepage/user-id/958224), I hope that you are well!  
Thank you for asking the HubSpot Community!  
So that we help you the best we can, what are you trying to achieve please?  
And with which endpoint? Do you have a documentation to share?  
The more info, screenshots (without sensitive/confidential information), and details you can provide, the better the Community can assist.

I’d love to put you in touch with our Top Experts: Hi @Anton, [@sylvain\_tirreau](https://community.hubspot.com/t5/user/viewprofilepage/user-id/601366) and [@zach\_threadint](https://community.hubspot.com/t5/user/viewprofilepage/user-id/324811) do you have suggestions to help [@sagar\_tomar1](https://community.hubspot.com/t5/user/viewprofilepage/user-id/958224), please?  
Have a wonderful day and thanks so much in advance for your help!  
Bérangère

---

<div class="post-metadata">

**Author:** ![GRajput](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/grajput/32/102020_2.png) [@GRajput](https://community.hubspot.com/u/GRajput)\
**Post date:** [July 4, 2025, 7:20am UTC](https://community.hubspot.com/t/api-error-show-typeerror-i-is-not-a-function/135385/3 "2025-07-04T07:20:14Z")

</div>

Hi [@sagar\_tomar1](https://community.hubspot.com/t5/user/viewprofilepage/user-id/958224)

Please share the top part of your file (imports and how fetchApi is defined), I believe there must be an error in importing the file.

Here are some tips -

Use fetchApi only inside UI extensions and import it correctly.

Use regular fetch() in non-extension code."

I hope this will help you out. Please mark it as **Solution Accepted and upvote** to help another Community member.

Thanks!
