# Request Failed with Error Code 502 in Call List API Chapter

**URL:** <https://discourse.sst.dev/t/request-failed-with-error-code-502-in-call-list-api-chapter/881>\
**Category:** General\
**Created:** [March 14, 2019, 2:44am UTC](https://discourse.sst.dev/t/request-failed-with-error-code-502-in-call-list-api-chapter/881 "2019-03-14T02:44:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhernan873](https://avatars.discourse-cdn.com/v4/letter/j/94ad74/32.png) [@jhernan873](https://discourse.sst.dev/u/jhernan873)\
**Post date:** [March 14, 2019, 2:44am UTC](https://discourse.sst.dev/t/request-failed-with-error-code-502-in-call-list-api-chapter/881/1 "2019-03-14T02:44:55Z")

</div>

Hello All,  
I have been going through the tutorial with some slight modifications but I am having trouble getting past this point. I have gone through the various posts that people have received for this issue but it always seems to come down to a typo in their serverless file or some URL. I have 2x, 3x, 4x checked everything to make sure but I am still receiving this error.

My Create API is working just fine and I am able to add new entries via my app. When I review the request I am receiving a Message stating that I am missing an Authentication Token and if I run my list mock file via the CLI I do get a response with all my “notes” but it fails within the App every time. From my research it seems like it may be due to my OPTIONS api method’s Authentication Method but I am unsure of what that needs to be set to. Any help is appreciated. Thank you.

Home.js:

```
    async componentDidMount() {
        if(!this.props.isAuthenticated) {
            return;
        }

        try {
            const items = await this.items();
            this.setState({ items });
        } catch(e) {
            alert(e);
        }

        this.setState({ isLoading: false });
    }

    items () {
        return API.get("SearchCriteria","/SearchCriteria");
    }

```

Serverless.yml:

```
list:
    handler: list.main
    events:
      - http:
          path: SearchCriteria
          method: get
          cors: true
          authorizer: aws_iam
```

---

<div class="post-metadata">

**Author:** ![jhernan873](https://avatars.discourse-cdn.com/v4/letter/j/94ad74/32.png) [@jhernan873](https://discourse.sst.dev/u/jhernan873)\
**Post date:** [March 15, 2019, 3:35am UTC](https://discourse.sst.dev/t/request-failed-with-error-code-502-in-call-list-api-chapter/881/2 "2019-03-15T03:35:13Z")

</div>

My typo was not on my list api but the update api. I had too many get functions in my serverless file and list was being overwritten. This is no longer an issue.

---

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [March 24, 2019, 7:31pm UTC](https://discourse.sst.dev/t/request-failed-with-error-code-502-in-call-list-api-chapter/881/3 "2019-03-24T19:31:08Z")

</div>

Glad you figure it out. Thanks for reporting back!
