---
# System prepended metadata

title: Message Center
tags: [development]

---

# Message Center

###### tags: `development`


## Distribution Lists

### POST : /message-center/distribution-list
Bir dağıtım listesi oluşturmak yada güncellemek için kullanılır.

```json
{
  "name": "retail-digital-information-statement-digest",
  "content-type": "campaign | private-info | public-info | legal | otp ",
  "send-type": "instant | digest",
  "digest-frequence": "*/5 * * * *",
  "citizenship-number": "{{ user.citizenship-number }}",
  "channels": [....]
}
```

#### Mail Channel

```json
{
  "to": "{{user.primary-email}}",
  "cc": "{{user.emails | array.map 'email' }}",
  "bcc": "",
  "subject-template": "debit-card-periodic-transaction-mail-subject-digest",
  "master-template": "debit-card-periodic-transaction-mail-master-digest",
  "body-template": "debit-card-periodic-transaction-mail-body-digest-body",
  "attachments": [
    {
      "render": "pdf",
      "file-name":"list.pdf",
      "template": "debit-card-periodic-transaction-digest-list-html"
    },
    {
      "render": "html",
      "file-name":"gdpr.html",
      "template": "gdpr-info-html"
    }
  ]
}
```

#### SMS Channel

```json
{
  "to": "{{user.gsm-numberl}}",
  "sim-change-check-days": 7
  "master-template": "debit-card-periodic-transaction-sms-master-digest",
  "body-template": "debit-card-periodic-transaction-sms-body-digest-body"
}
```

#### Mobile Notification Channel
```json
{
  "device-reference": "{{user.mobile-device-reference}}",
  "application": "burgan-mobile-banking-retail",
  "title-template": "debit-card-periodic-transaction-push-title-digest",
  "sub-title-template": "debit-card-periodic-transaction-push-sub-title-digest",
  "master-template": "debit-card-periodic-transaction-push-master-digest",
  "body-template": "debit-card-periodic-transaction-push-body-digest-body",
  "actions": [
    {
      "command": "display-statements",
      "title": "Hareketleri Goster",
      "icon": "ic_statements",
      "parameter": "{{ user.id }}"
    },
    {
      "command": "ignore",
      "title": "Tamam",
      "icon": "ic_close"
    }
  ]
}
```

### GET : /message-center/distribution-lists/{page-index}/{page-size}

> Query Paramter : **name**, allow LIKE style query


```json
{
  "has-more": true,
  "items": [
    {
      "name": "retail-digital-information-statement-digest",
      "content-type": "campaign | private-info | public-info | legal | otp ",
      "send-type": "instant | digest",
      "digest-frequence": "*/5 * * * *",
      "channels": []
    },
    {
      "name": "retail-digital-information-statement-digest",
      "content-type": "campaign | private-info | public-info | legal | otp ",
      "send-type": "instant | digest",
      "digest-frequence": "*/5 * * * *",
      "channels": []
    },
  ]
}
```

### POST : /message-center/distribution-list/{name}

```json
[
  {
    "id": "80922bd5-9d77-4b13-b312-0aef1bc89485",
    "data": {
      "user": {
        "gsm-number": "5302896073",
        "primary-email": "ukaratas@rocketmail.com",
        "device-reference": "60c5850b-9694-47af-b803-7e883f43dcde",
        "emails": [
          {
            "email": "ukaratas@burgan.com.tr",
            "is-validated-by-customer": true,
            "is-validated-by-link": true
          },
          {
            "email": "ukaratas@hotmail.com",
            "is-validated-by-customer": true,
            "is-validated-by-link": false
          }
        ]
      },
      "transaction": []
    },
    "data-for-log": {
      "user": {
        "gsm-number": "530***6073",
        "primary-email": "******@rocketmail.com",
        "device-reference": "60c5850b-9694-47af-b803-7e883f43dcde",
        "emails": [
          {
            "email": "******@burgan.com.tr",
            "is-validated-by-customer": true,
            "is-validated-by-link": true
          },
          {
            "email": "******@hotmail.com",
            "is-validated-by-customer": true,
            "is-validated-by-link": false
          }
        ]
      },
      "transaction": []
    }
  },
  {
    "id": "90922bd5-9d77-4b13-b312-0aef1bc89485",
    "data": {
      "user": {
        "gsm-number": "5302891212",
        "primary-email": "hassan@outlook.com",
        "device-reference": "10c5850b-9694-47af-b803-7e883f43dcde"
      },
      "transaction": []
    },
    "data-for-log": {
      "user": {
        "gsm-number": "530***1212",
        "primary-email": "******@outlook.com",
        "device-reference": "10c5850b-9694-47af-b803-7e883f43dcde"
      },
      "transaction": []
    }
  }
]
```

### GET : /message-center/distribution-list/{name}/Item/{id}

```json
{
  "id": "90922bd5-9d77-4b13-b312-0aef1bc89485",
  "data-for-log": {
    "user": {
      "gsm-number": "530***1212",
      "primary-email": "******@outlook.com",
      "device-reference": "10c5850b-9694-47af-b803-7e883f43dcde"
    },
    "transaction": []
  },
  "mail": {
    "id": "b15e6285-04ea-413e-8afc-7d7613e043bb",
    "type": "private-info",
    "to": "ukaratas@rocketmail.com",
    "cc": "ukaratas@burgan.com.tr, ukaratas@hotrmail.com",
    "subject": "hesaptan paraciklar cikti bilader",
    "content": "hesaptan paraciklar cikti bilader",
    "attachments": [
      {
        "name": "list.pdf",
        "type": "PDF",
        "render-id": "8058310a-3eef-46d7-97cf-c2065d4d6e9b"
      },
      {
        "file-name": "gdpr.html",
        "type": "Plain",
        "render-id": "9058310a-3eef-46d7-97cf-c2065d4d6e9b"
      }
    ],
    "status": "completed-with-success"
  },
  "sms": {
    "id": "b15e6285-04ea-413e-8afc-7d7613e043bb",
    "number": "5302896073",
    "message": "hesaptan paraciklar cikti bilader",
    "type": "private-info",
    "sim-change-check-days": 7,
    "status": "completed-with-success"
  }
}
```


### GET : /message-center/distribution-list/{name}/Items/{page-index}/{page-size}
```json 
[
  {
    "id": "90922bd5-9d77-4b13-b312-0aef1bc89485",
    "data-for-log": {
      "user": {
        "gsm-number": "530***1212",
        "primary-email": "******@outlook.com",
        "device-reference": "10c5850b-9694-47af-b803-7e883f43dcde"
      },
      "transaction": []
    },
    "mail": {
      "id": "b15e6285-04ea-413e-8afc-7d7613e043bb",
      "type": "private-info",
      "to": "ukaratas@rocketmail.com",
      "cc": "ukaratas@burgan.com.tr, ukaratas@hotrmail.com",
      "content": "hesaptan paraciklar cikti bilader",
      "attachments": [
        {
          "name": "list.pdf",
          "type": "PDF",
          "render-id": "8058310a-3eef-46d7-97cf-c2065d4d6e9b"
        },
        {
          "file-name": "gdpr.html",
          "type": "Plain",
          "render-id": "9058310a-3eef-46d7-97cf-c2065d4d6e9b"
        }
      ],
      "status": "completed-with-success"
    },
    "sms": {
      "id": "b15e6285-04ea-413e-8afc-7d7613e043bb",
      "number": "5302896073",
      "message": "hesaptan paraciklar cikti bilader",
      "type": "private-info",
      "sim-change-check-days": 7,
      "status": "completed-with-success"
    }
  }
]
```


### GET : /message-center/distribution-list/{name}/Item/{id}/status
```json
{
  "mail": {
    "status": "completed-with-failure",
    "actions": [
      {
        "time-stamp": "2020-04-28T07:29:03+00:00",
        "status": "in-progress",
        "descriptrion": "SMS Turkcell OTP kanalından gönderildi."
      },
      {
        "time-stamp": "2020-04-28T07:30:00+00:00",
        "status": "in-progress",
        "descriptrion": "3 güm önce SIM kart değişikliği tespit edildi."
      },
      {
        "time-stamp": "2020-04-28T07:32:00+00:00",
        "status": "completed-with-failure",
        "descriptrion": "Mesaj gönderimi iptal edildi."
      }
    ]
  },
  "sms": {...},
  "push-notification": {...}
}
```