# Report Webhooks
source: https://developer.mastercard.com/open-finance-us/documentation/webhooks/webhooks-report/index.md

There are two ways to receive information about a report via webhook notifications, depending on how the report is generated.

* **API request:** - when you generate a report using an API request, notifications
  are sent to the webhook URL you specified using the `callbackUrl` request parameter.

* **Data Connect** : when a report is generated through [Mastercard Data Connect](https://developer.mastercard.com/open-finance-us/documentation/connect/index.md), notifications are sent to the webhook URL specified when you generated the [Data Connect URL](https://developer.mastercard.com/open-finance-us/documentation/connect/generate-2-connect-url-apis/index.md).

You will receive notifications about events in the report lifecycle.

Events are different depending on how the report was generated. For details, see:

* [Report Events (API)](https://developer.mastercard.com/open-finance-us/documentation/webhooks/webhooks-report/report-webhooks-api/index.md) or
* [Report Events (Data Connect)](https://developer.mastercard.com/open-finance-us/documentation/webhooks/webhooks-report/report-webhooks-dc/index.md).

<br />

### Setting up a Report Listener {#setting-up-a-report-listener}

Here are some basic steps to follow when you want to set up an endpoint to receive webhook events on your server.

1. Add an inbound endpoint to receive webhook events, for example, `/reportlistener`.
2. Set the `content type` of the body to match the accept header used in the Generate Report call.
3. Set the security on your endpoint to allow the HTTPS protocol.
4. Test the endpoint locally to simulate external calls to your application. We recommend testing with the URL: <http://ngrok.com>.
5. Process the test request on a separate thread and return an HTTP 200 success response.

Example code:
* Java
* Javascript

```java
@PostMapping(value = "/yourCallback", accepts = "application/xml")
```

```javascript
app.post('/yourCallback', bodyParser.raw({type:'application/json'}), (req, resp) => {};
```

Note: Since report webhooks are sent only once, we recommend processing the webhook data on a different thread as soon as it is received.
