tata1mg / notifyone-core

12 stars 5 forks source link

Create, Store, Update and Delete channel partners configurations #11

Open prshant70 opened 2 months ago

prshant70 commented 2 months ago

tata1mg/notifyone#16

prshant70 commented 2 months ago

Sensitive data stored in DB (like channels partners tokens or other credentials) must be in encrypted form. Encryption and Decryption to be taken care of by the application layer.

prshant70 commented 1 month ago

API to fetch the channel partners configurations -

GET /channel_partners/configurations

Request Params :

{
    "channels": "SMS,EMAIL"
}

Response -

{
  "SMS": {
    "DEFAULT_PRIORITY": [
      "SMS_COUNTRY",
      "PLIVO",
      "AWS_SNS"
    ],
    "PRIORITY_LOGIC": "['SMS_COUNTRY', 'PLIVO', 'AWS_SNS'] if True else ['SMS_COUNTRY', 'PLIVO', 'AWS_SNS']",
    "GATEWAYS": {
      "SMS_COUNTRY": {
        "ID": "SMS_COUNTRY",
        "GATEWAY": "SMS_COUNTRY",
        "CONFIGURATION": {
          "SMS_COUNTRY_USERNAME": "otp_sc_stag",
          "SMS_COUNTRY_PASSWORD": "xxxxx",
          "SMS_COUNTRY_SENDER_ID": "HKPLUS",
          "SMS_COUNTRY_URL": "http://www.smscountry.com/SMSCwebservice_bulk.aspx"
        }
      },
      "SMS_COUNTRY1": {
        "ID": "SMS_COUNTRY1",
        "GATEWAY": "SMS_COUNTRY",
        "CONFIGURATION": {
          "SMS_COUNTRY_USERNAME": "otp_sc_stag",
          "SMS_COUNTRY_PASSWORD": "xxxxx",
          "SMS_COUNTRY_SENDER_ID": "HKPLUS",
          "SMS_COUNTRY_URL": "http://www.smscountry.com/SMSCwebservice_bulk.aspx"
        }
      },
      "PLIVO": {
        "ID": "PLIVO",
        "GATEWAY": "PLIVO",
        "CONFIGURATION": {
          "PLIVO_SMS_URL": "https://api.plivo.com/v1/Account/xxxxxx/Message/",
          "PLIVO_AUTH_ID": "xxxxx",
          "PLIVO_AUTH_TOKEN": "ZTFmMzYxODBmZWZiNGQwNjYyZmY5ODhmYjYxMjA1",
          "PLIVO_SENDER_ID": "HKPLUS",
          "PLIVO_CALLBACK_URL": "https://stagapi.1mg.com/analytics/lara_logging"
        }
      }
    }
  },
  "EMAIL": {
    "DEFAULT_PRIORITY": [
      "SPARK_POST",
      "AWS_SES"
    ],
    "PRIORITY_LOGIC": "['SPARK_POST', 'AWS_SES'] if True else ['SPARK_POST', 'AWS_SES']",
    "GATEWAYS": {
      "SPARK_POST": {
        "ID": "SPARK_POST",
        "GATEWAY": "SPARK_POST",
        "CONFIGURATION": {
          "BASE_URL": "https://api.sparkpost.com",
          "PATH": "/api/v1/transmissions?num_rcpt_errors=3",
          "API_KEY": "cc1a8516911d983877e16642958007732a924187"
        }
      },
      "AWS_SES": {
        "ID": "AWS_SES",
        "GATEWAY": "AWS_SES",
        "CONFIGURATION": {
          "AWS_REGION": "ap-south-1"
        }
      }
    }
  }
}