# SMS Inbound UDR Report

This example retrieves inbound SMS reception records for a specific time period. The response shows multiple SMS messages received from various mobile networks, processed through a single data center using GSM-7 encoding. The messages are primarily single-part SMS with keyword-based routing enabled.

For complete field definitions and advanced options, see the [GraphQL API Reference](https://developers.retarus.com/common/sdl).

## Query

```graphql
query smsInUdrReport (
  $customerId: String!
  $filterSMS: SmsInColumnUdrFilters
  $datePeriod: DatePeriod!
  $pageIndex: Int
  $pageSize: Int
  $sort: SortDirection
) {
  smsInUdrReport(
    customerId: $customerId
    datePeriod: $datePeriod
    filter: $filterSMS
    page: $pageIndex
    size: $pageSize
    sort: $sort
  ) {
    content {
      smsId
      correlatedJobId
      correlatedTrackingId
      trackingId
      correlatedSmsId
      dataCenter
      customerId
      correlatedService
      correlatedServiceAccount
      billingCode
      encoding
      sender
      recipient
      senderCountryCodeIso3
      recipientCountryCodeIso3
      keyword
      numberOfParts
      plaintextActions
      messageContent
      receivedTs
    }
    pageIndex
    pageSize
    hasMoreElements
  }
}
```

## Variables

```json
{
	"customerId": "XXXXX",
	"datePeriod": {
		"fromIncluded": "2025-07-12T00:00:00.000Z",
		"toExcluded": "2025-07-30T07:00:00.000Z"
	},
	"filterSMS": {
		"senderCountryCodeIso3": { "values": ["FRA", "DEU"] },
		"dataCenter": { "notValues": ["DE1"] }
	},
	"pageIndex": 0,
	"pageSize": 10,
	"sort": "ASC"
}
```

> **Filter**  The `filterSMS` value above keeps messages whose sender is in France or Germany (`senderCountryCodeIso3`) and excludes data center `DE1`. See [Filtering](/common/graphql-examples#filtering) for how `values` (logical OR) and `notValues` (logical AND NOT) combine.


## Response

```json
{
	"data": {
		"smsInUdrReport": {
			"content": [
				{
					"smsId": "I.20250712-062451.038-0lyi722xrWZ13GJJ6H",
					"correlatedJobId": null,
					"correlatedTrackingId": null,
					"trackingId": "lyi722xq-de2-smpp-35swdfrzh1gff         ",
					"correlatedSmsId": null,
					"dataCenter": "DE2",
					"customerId": "XXXXX",
					"correlatedService": null,
					"correlatedServiceAccount": null,
					"billingCode": "",
					"encoding": "GSM-7",
					"sender": "+3366******",
					"recipient": "****",
					"senderCountryCodeIso3": "FRA",
					"recipientCountryCodeIso3": "FRA",
					"keyword": "*",
					"numberOfParts": 1,
					"plaintextActions": null,
					"messageContent": null,
					"receivedTs": "2025-07-12T04:24:51.038Z"
				},
				// more items ...
			],
			"pageIndex": 0,
			"pageSize": 10,
			"hasMoreElements": true
		}
	}
}
```

## Field reference

| **Field** | **Description** |
|  --- | --- |
| `smsId` | Unique inbound SMS record identifier |
| `sender` | Sender's phone number |
| `recipient` | Receiving phone number |
| `senderCountryCodeIso3` | Sender's country (ISO 3166-1 alpha-3) |
| `recipientCountryCodeIso3` | Recipient's country (ISO 3166-1 alpha-3) |
| `encoding` | Message encoding type |
| `numberOfParts` | SMS parts count |
| `keyword` | Keyword that triggered the SMS routing |
| `receivedTs` | Message reception timestamp |
| `dataCenter` | Processing data center |
| `customerId` | Retarus customer account identifier |
| `correlatedService` | Related Retarus service |
| `correlatedServiceAccount` | Related service account |
| `trackingId` | Tracking identifier for monitoring |
| `correlatedTrackingId` | Related tracking identifier |
| `billingCode` | Cost center identifier |
| `plaintextActions` | Processing actions applied to the SMS |
| `messageContent` | SMS message content (if available) |
| `correlatedJobId` | Related outbound job identifier |
| `correlatedSmsId` | Related SMS identifier |