# Axois get call post login

**URL:** <https://community.auth0.com/t/axois-get-call-post-login/110105>\
**Category:** Get Help\
**Tags:** identifier-first, login-experience\
**Created:** [June 27, 2023, 7:17pm UTC](https://community.auth0.com/t/axois-get-call-post-login/110105 "2023-06-27T19:17:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jared.modugno](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jared.modugno/32/71057_2.png) [@jared.modugno](https://community.auth0.com/u/jared.modugno)\
**Post date:** [June 27, 2023, 7:17pm UTC](https://community.auth0.com/t/axois-get-call-post-login/110105/1 "2023-06-27T19:17:33Z")

</div>

How would I write an axios call to a get endpoint in the post-login actions? I tried this but it was giving me a 404 (I’m able to plug in the same headers and url in postman and get data back)

```auto
exports.onExecutePostLogin = async (event, api) => {
  const axios = require('axios');
  
  const namespace = ' ****';

  const url = 'https:// ******* /user-info';
  const options = {
    headers: {
      'Authorization': ' ****',
      'Inst2Person' : ' ****'      
    }
  };
  var response = await axios.get(url, options);
  if (event.authorization) {
    api.idToken.setCustomClaim(`${namespace}/responseFromApiIDToken`, response.data. **** );
  );
  }
};

```

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [June 27, 2023, 7:34pm UTC](https://community.auth0.com/t/axois-get-call-post-login/110105/3 "2023-06-27T19:34:13Z")

</div>

Hi @jared.modugno,

Thanks for reaching out to the Auth0 Community!

After looking carefully at the code snippet you shared, it looks like you are calling an endpoint that does not exist. (Reference: [Authentication API Explorer](https://auth0.com/docs/api/authentication#standard-error-responses:~:text=%7B%22error%22%3A%20%22-,endpoint_disabled,-%22%2C%20%22error_description%22%3A%20%22...%22%7D))

The correct endpoint should be `/userinfo` without a hyphen.

Could you please make these changes and let me know how it goes?

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![jared.modugno](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jared.modugno/32/71057_2.png) [@jared.modugno](https://community.auth0.com/u/jared.modugno)\
**Post date:** [June 27, 2023, 8:20pm UTC](https://community.auth0.com/t/axois-get-call-post-login/110105/4 "2023-06-27T20:20:22Z")

</div>

> [@rueben.tiow](#):
>
> `userinfo`

Apologies, the endpoint i’m trying to hit is an api that I’ve created that ends in user-info. It’s an endpoint that hosted (it doesn’t use my localhost).  
Does the rest of the axios call look correct?

---

<div class="post-metadata">

**Author:** ![jared.modugno](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jared.modugno/32/71057_2.png) [@jared.modugno](https://community.auth0.com/u/jared.modugno)\
**Post date:** [June 28, 2023, 12:43pm UTC](https://community.auth0.com/t/axois-get-call-post-login/110105/5 "2023-06-28T12:43:36Z")

</div>

It was a proxy issue with the api on my side, thank you for your response!

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [June 28, 2023, 4:22pm UTC](https://community.auth0.com/t/axois-get-call-post-login/110105/6 "2023-06-28T16:22:41Z")

</div>

Hi @jared.modugno,

I’m glad you got it working now!

Please let us know if there’s anything else we can do to help.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [July 12, 2023, 4:22pm UTC](https://community.auth0.com/t/axois-get-call-post-login/110105/7 "2023-07-12T16:22:56Z")

</div>

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