# I need to receive callback requests into my script and respond to them

**URL:** <https://community.postman.com/t/i-need-to-receive-callback-requests-into-my-script-and-respond-to-them/6582>\
**Category:** Help Hub\
**Created:** [July 16, 2019, 6:50pm UTC](https://community.postman.com/t/i-need-to-receive-callback-requests-into-my-script-and-respond-to-them/6582 "2019-07-16T18:50:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andranik.h89](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/andranik.h89/32/2322_2.png) [@andranik.h89](https://community.postman.com/u/andranik.h89)\
**Post date:** [July 16, 2019, 6:50pm UTC](https://community.postman.com/t/i-need-to-receive-callback-requests-into-my-script-and-respond-to-them/6582/1 "2019-07-16T18:50:14Z")

</div>

In the api that I need to test when I send a request I immediately receive a receive a response with a transactionID, no matter transaction succeeded or not. Along with my request I send a CallbackURL to the server where I expect the actual transaction result to be called back. The server will do a PUT request back to the CallbackURL that I have provided with the transactionID and the actual response or error.

So the question is, can I have such kind of scenarios in my postman tests?  
I guess I should run a web server and expose an endpoint which will expect a PUT request and I should get the body of this PUT request in my tests to check it, and respond back to it with success.

In other words, within my script I need to perform the following actions:

1. Do a request to the server passing a callback URL
2. check the immediate response from the server and keep the returned transactionID
3. Have a webserver run with and endpoint that I passed as a callback URL
4. expect a request to that endpoint with transactionID and actual response
5. Check that the response is what I actually expected
6. Respond to the request with success

I was thinking about Postman Mock server, but seems it is not designed for such usage.  
I also think may be I can run some JS webserver inside the postman sandbox…

Actually I am very new to postman testing and I am really confused about this kind of issue. Is it even possible to do this with postman or I need something else?

---

<div class="post-metadata">

**Author:** ![aamir.ahmed](https://avatars.discourse-cdn.com/v4/letter/a/e9bcb4/32.png) [@aamir.ahmed](https://community.postman.com/u/aamir.ahmed)\
**Post date:** [July 23, 2019, 5:55am UTC](https://community.postman.com/t/i-need-to-receive-callback-requests-into-my-script-and-respond-to-them/6582/2 "2019-07-23T05:55:34Z")

</div>

Hi @andranik.h89,

Welcome to the Postman community! You can send multiple requests to the server, append callbacks and handle the responses in the Pre-request scripts or Tests tab using the pm.sendRequest function whose usage is outlined in the given documentation: [https://learning.getpostman.com/docs/postman/scripts/postman\_sandbox\_api\_reference/#pmsendrequest](https://learning.getpostman.com/docs/postman/scripts/postman_sandbox_api_reference/#pmsendrequest)  
Hope that helps!

---

<div class="post-metadata">

**Author:** ![michin](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michin/32/3795_2.png) [@michin](https://community.postman.com/u/michin)\
**Post date:** [October 10, 2022, 3:30am UTC](https://community.postman.com/t/i-need-to-receive-callback-requests-into-my-script-and-respond-to-them/6582/3 "2022-10-10T03:30:40Z")

</div>

Did you ever figure this out? The only option out there currently that provides incoming webhooks is Runscope, but the consistency of the service is lacking.
