Asenkron Çoklu İzin Ekleme

Bu metot, alıcıdan alınmış izinlerin yığın olarak İYS'ye yüklenmesine imkan tanır.

  • Tekil izin eklemede geçerli olan kurallar çoklu izin ekleme için de geçerlidir. Aradaki farklar izin nesnelerinin çoğullaştırılması ve hatalı/yüklenememiş izinlerin adreslendirilmesidir.
  • POST /sps/{iysCode}/brands/{brandCode}/consents/request
Alan/Değer Açıklama
consentDate İznin vatandaştan alındığı tarih ve saat
source İzin kaynağı
recipient Alıcının iletişim adresi
recipientType Alıcı tipi
status İzin durumu
type Alıcının izin verdiği iletişim kanalı
retailerCode İznin alınmasına aracılık eden bayinin İYS numarası
retailerAccess İzne erişimi olan bayilerin İYS numaraları

[
  {      
    "type": "EPOSTA",
    "source": "HS_WEB",
    "recipient": "ornek@adiniz.com",
    "status": "ONAY",
    "consentDate": "2018-02-10 09:40:00",
    "recipientType": "BIREYSEL",
    "retailerCode": 11223344,
    "retailerAccess": [22233344, 44222419, 13239987]
  },
  {
    "type": "EPOSTA",
    "source": "HS_WEB",
    "recipient": "ornek@adiniz.com",
    "status": "ONAY",
    "consentDate": "2018-02-10 09:50:00",
    "recipientType": "TACIR",
    "retailerCode": 11223344,
    "retailerAccess": [22233344, 44222419, 13239987]
  },
  {
    "type": "MESAJ",
    "source": "HS_MESAJ",
    "recipient": "+905813334455",
    "status": "RET",
    "consentDate": "2018-02-10 09:55:00",
    "recipientType": "BIREYSEL",
    "retailerCode": 11223344,
    "retailerAccess": [22233344, 44222419, 13239987]
  }
]
- İstek Cevabı: 200

Alan/Değer Açıklama
requestId Yığın izin için üretilen istek bilgisi
subrequestId Yığın içindeki izin nesnesi için üretilen istek bilgisi
{
  "requestId": "73b75030-3a92-4f1e-b247-b0509dbadbfc", 
  "subRequests": [
    {
      "subrequestId": "7ed0f89d-15c7-457f-a16a-d689ef5dca62",
      "consentDate": "2018-02-10 09:40:00",
      "recipient": "ornek@adiniz.com",
      "recipientType": "BIREYSEL",
      "status": "ONAY",
      "type": "EPOSTA",
    },
    {
      "subrequestId": "38af0a95-a63b-40b8-839d-06ffc323bf0c",
      "consentDate": "2018-02-10 09:50:00",
      "recipient": "ornek@adiniz.com",
      "recipientType": "TACIR",
      "status": "ONAY",
      "type": "EPOSTA"
    },
    {
      "subrequestId": "cf7b94b5-c64c-4426-9ec9-beab5d8d89b5",
      "consentDate": "2018-02-10 09:55:00",
      "recipient": "+905813334455",
      "recipientType": "BIREYSEL",
      "status": "RET",
      "type": "MESAJ"
     }
  ]
}
  • İstek Cevap Şablonu: 422
Alan/Değer Açıklama
errors Hatalı izinleri adresleyen obje
index Yığındaki hatalı iznin yeri
code Hata kodu
location Hatanın izin nesnesindeki yeri
value Hatalı değer
message Hata koduna karşılık gelen mesaj
{ 
  "errors": [{
    "index": 0,  /* yapılan istekteki index 2'de (3. izin)  bulunan iznin hataları */
    "code": "0047",
    "location": ["recipient"],
    "value": <locationda'ki son field'ın hatalı değeri>,
    "message": "telefon numarası şu şekilde olmalıdır"
  },
  {
    "index": 0,  /* yapılan istekteki index 5'de (6. izin)  bulunan iznin hataları */
    "code": "0048",
    "location": ["consentDate"],
    "value": "2020-13-01 25:00:00",
    "message": "hatalı tarih formatı. (2020-01-01 00:00:00)"
  },
  {
    "index": 2,  /* yapılan istekteki index 5'de (6. izin)  bulunan iznin hataları */
    "code": "0048",
    "location": ["consentDate"],
    "value": "2020-13-01 25:00:00",
    "message": "hatalı tarih formatı. (2020-01-01 00:00:00)"
  }]
}

// verilen 100 izin için, şekil hatası bulunursa, ilk bulunan hatalı izin için hata listesi verilir.

  • İstek Örneği:

    [
      {      
        "type": "EPOSTA",
        "source": "HS_WEB",
        "recipient": "ornek2@adiniz.com",
        "status": "ONAY",
        "consentDate": "2018-02-10 09:40:00",
        "recipientType": "BIREYSEL",
        
      },
      {
        "type": "EPOSTA",
        "source": "HS_WEB",
        "recipient": "ornek2@adiniz.com",
        "status": "RET",
        "consentDate": "2018-02-10 09:50:00",
        "recipientType": "BIREYSEL",
        
      },
      {
        "type": "EPOSTA",
        "source": "HS_WEB",
        "recipient": "ornek2@adiniz.com",
        "status": "ONAY",
        "consentDate": "2018-02-10 09:51:00",
        "recipientType": "BIREYSEL",
        
      }
    ]
    

  • İstek Cevabı: 422

    {
       "errors":[
          {
             "index":1,
             "code":"H153",
             "location":[
                "recipient"
             ],
             "value":"ornek2@adiniz.com",
             "message":"Listede izin durumu ONAY olan aynı alıcı (recipient & recipientType) için, RET eklenen izinden sonra ONAY eklenemez."
          }
       ]
    }