# Call reporting API after each test

**URL:** <https://community.postman.com/t/call-reporting-api-after-each-test/16019>\
**Category:** Help Hub\
**Tags:** tests\
**Created:** [September 18, 2020, 5:06pm UTC](https://community.postman.com/t/call-reporting-api-after-each-test/16019 "2020-09-18T17:06:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kshatriya.amit.singh](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kshatriya.amit.singh/32/5623_2.png) [@kshatriya.amit.singh](https://community.postman.com/u/kshatriya.amit.singh)\
**Post date:** [September 18, 2020, 5:06pm UTC](https://community.postman.com/t/call-reporting-api-after-each-test/16019/1 "2020-09-18T17:06:20Z")

</div>

Hi -  
I have a reporting tool which can gather data for all my test runs and display historical trends, for this I need to call an API after each postman test runs to push data into that tool. Any pointers on how I can probably create a single request to push this data but be able to call it after each test on my request? I thought about setnextrequest but if my API calls are in a workflow that might impact the flow.

Would adding a pm.sendRequest from each test work?

---

<div class="post-metadata">

**Author:** ![Seluj78](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/seluj78/32/5646_2.png) [@Seluj78](https://community.postman.com/u/Seluj78)\
**Post date:** [September 21, 2020, 8:13am UTC](https://community.postman.com/t/call-reporting-api-after-each-test/16019/2 "2020-09-21T08:13:51Z")

</div>

Hi !

While I have never used pm.sendRequest yet, It think it would work. Does your reporting tool allow to send data after the tests have been executed ? This would allow you to send all the data in one request

---

<div class="post-metadata">

**Author:** ![kshatriya.amit.singh](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kshatriya.amit.singh/32/5623_2.png) [@kshatriya.amit.singh](https://community.postman.com/u/kshatriya.amit.singh)\
**Post date:** [September 21, 2020, 8:26pm UTC](https://community.postman.com/t/call-reporting-api-after-each-test/16019/3 "2020-09-21T20:26:19Z")

</div>

I can send data either all at once or in real time. I am able to use sendRequest but the problem is my collection will have many tests and now if i use newman run I need to find a way to get run summary to be able to then push it to the reporting tool. I came across runsummary object but still trying to find out how to use it, documentation is sparse on that.

---

<div class="post-metadata">

**Author:** ![Seluj78](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/seluj78/32/5646_2.png) [@Seluj78](https://community.postman.com/u/Seluj78)\
**Post date:** [September 22, 2020, 1:40pm UTC](https://community.postman.com/t/call-reporting-api-after-each-test/16019/4 "2020-09-22T13:40:56Z")

</div>

Sorry, I cannot help you on that 😕

---

<div class="post-metadata">

**Author:** ![vdespa](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/vdespa/32/2770_2.png) [@vdespa](https://community.postman.com/u/vdespa)\
**Post date:** [September 22, 2020, 3:42pm UTC](https://community.postman.com/t/call-reporting-api-after-each-test/16019/5 "2020-09-22T15:42:09Z")

</div>

I would assume here that your ultimate goal is automation with newman.

The cleanest way of handling this would be to write your own newman reporter which can publish the results to where they are needed.

Anything outside of this solution is just a mess to maintain.

---

<div class="post-metadata">

**Author:** ![kshatriya.amit.singh](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kshatriya.amit.singh/32/5623_2.png) [@kshatriya.amit.singh](https://community.postman.com/u/kshatriya.amit.singh)\
**Post date:** [September 23, 2020, 6:20pm UTC](https://community.postman.com/t/call-reporting-api-after-each-test/16019/6 "2020-09-23T18:20:45Z")

</div>

Thank you! I was able to resolve it by using pm.request but its not graceful, I have to put that function in every request and make call based on pass or fail condition. Its not scalable for sure. I’ll look into writing my own reporter.
