# Amazon Ads API: TypeError

**URL:** <https://community.postman.com/t/amazon-ads-api-typeerror/68565>\
**Category:** Help Hub\
**Tags:** variables, collections, authentication\
**Created:** [September 18, 2024, 10:43am UTC](https://community.postman.com/t/amazon-ads-api-typeerror/68565 "2024-09-18T10:43:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![europeversal](https://avatars.discourse-cdn.com/v4/letter/e/a87d85/32.png) [@europeversal](https://community.postman.com/u/europeversal)\
**Post date:** [September 18, 2024, 10:43am UTC](https://community.postman.com/t/amazon-ads-api-typeerror/68565/1 "2024-09-18T10:43:29Z")

</div>

Hi there,

sorry if this is a newbie questions.

I’ve followed the Amazon Ads API instruction and I’m stuck at [this step here](https://advertising.amazon.com/API/docs/en-us/guides/reporting/v3/get-started#checking-report-status).

Meaning I’ve successfully generated a report via postman (status 200 ok).

But when trying to request the status, I get the following error:

_There was an error in evaluating the Pre-request Script:TypeError: Cannot read properties of undefined (reading ‘startsWith’)_

Does anyone know why this happens and how to solve this?

Thanks so much 🙂 !

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [September 18, 2024, 11:18am UTC](https://community.postman.com/t/amazon-ads-api-typeerror/68565/2 "2024-09-18T11:18:51Z")

</div>

The error is being caused by code in a pre-request script, so logically that is where you need to start. You can have pre-request scripts on the request, folder or collection, so you might need to check all of those locations.

---

<div class="post-metadata">

**Author:** ![europeversal](https://avatars.discourse-cdn.com/v4/letter/e/a87d85/32.png) [@europeversal](https://community.postman.com/u/europeversal)\
**Post date:** [September 18, 2024, 12:43pm UTC](https://community.postman.com/t/amazon-ads-api-typeerror/68565/3 "2024-09-18T12:43:37Z")

</div>

Hi Mike,

thanks for your quick reply, I appreciate it 🙂 !

I did find a pre-request script, see the attached screenshot.

 ![Untitled](https://us1.discourse-cdn.com/getpostman/original/3X/6/e/6e703fef6903dac1b34e981f7b8652647cb53027.jpeg)

However, this is the original code provided by Amazon.

All I did is follow their developer instructions and installed the environment and collection files.

So it works out of the box, and I didn’t change anything, especially not the scripts.

Are you saying I need to meddle with the original Amazon code?

I would assume they know what they were doing and the code is fine as is?

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [October 18, 2024, 12:44pm UTC](https://community.postman.com/t/amazon-ads-api-typeerror/68565/4 "2024-10-18T12:44:16Z")

</div>

Closed on October 18, 2024, 12:44pm UTC

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