# Make a POST to API server using accessToken, after a user has registered

**URL:** <https://community.auth0.com/t/make-a-post-to-api-server-using-accesstoken-after-a-user-has-registered/15918>\
**Category:** Get Help\
**Created:** [September 26, 2018, 5:04am UTC](https://community.auth0.com/t/make-a-post-to-api-server-using-accesstoken-after-a-user-has-registered/15918 "2018-09-26T05:04:59Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![dak2009](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dak2009/32/44901_2.png) [@dak2009](https://community.auth0.com/u/dak2009)\
**Post date:** [June 18, 2019, 1:21pm UTC](https://community.auth0.com/t/make-a-post-to-api-server-using-accesstoken-after-a-user-has-registered/15918/3 "2019-06-18T13:21:32Z")

</div>

Did you guys ever get this to work? I’m stuck being unable to get an accessToken.

> [@Running a rule to call an API does not work due to 401 error](http://community.auth0.com/t/running-a-rule-to-call-an-api-does-not-work-due-to-401-error/26711):
>
> I have written a rule that posts a new user to my API. The rule fires when I sign up a new user. My API refuses the POST with a 401 error. When I debug the rule, the context.accessToken is empty {}. How do I get an access token to pass to my API? I can’t make heads or tails of the rule documentation. function (user, context, callback) { if (context.stats.loginsCount === 1) { return callback(null, user, context); } const request = require('request'); const payload = \_.extend({…

---

_[View the full topic](https://community.auth0.com/t/make-a-post-to-api-server-using-accesstoken-after-a-user-has-registered/15918)._
