tdevapigists
9/18/2017 - 1:35 PM

NotificationPreferenceExternalAPI.json

{
  "swagger": "2.0",
  "info": {
    "title": "Notification Preferences API",
    "description": "The Notification Preference API allows you to set the preference details for you by Telstra Wholesale. The notification preferences for each service provider specify the notification types that the service provider is subscribed to as well as the URLs to which each type of notification should be pushed via the Push Notification API.The following notification types are currently supported by the API:\n•  Order Notifications (NBN order updates)\n•  Ticket Notifications (NBN and copper tickets)\n•  Diagnostic Result Notifications (copper diagnostic tests)",
    "version": "1.0.0",
    "termsOfService": "https://sdev.telstra.com/legal/wholesale"
  },
  "host": "private-sapi.telstra.com",
  "basePath": "/application/tw-notification-broker/v1/preferences",
  "schemes": [
    "https"
  ],
  "security": [
    {
      "OAuth2": [
        "TWNOTIFICATIONPREFERENCE"
      ]
    }
  ],
  "paths": {
    "/add-customer-preference-details": {
      "post": {
        "operationId": "Post customer preference",
        "summary": "This API resource would insert the customer preference details for the given Service Provider Id (SP Id) or primary CIDN.",
        "description": "This API resource would insert the customer notification preference to the notification database.\n",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization header in the format 'Bearer {access_token}' - get the token by using the OAuth API with the scope 'TWNOTIFICATIONPREFERENCE'.",
            "type": "string",
            "required": true
          },
          {
            "name": "payload",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/addCustomerPreferenceDetails"
            }
          }
        ],
        "tags": [
          "CPA"
        ],
        "responses": {
          "201": {
            "description": "Resource Created",
            "schema": {
              "$ref": "#/definitions/Success"
            }
          },
          "400": {
            "description": "Invalid or missing request parameters",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          },
          "401": {
            "description": "Invalid or no credentials passed in the request",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          },
          "403": {
            "description": "Authorization credentials passed and accepted but account does not have permission",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          },
          "404": {
            "description": "The requested URI does not exist",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          },
          "429": {
            "description": "Too many requests in a given amount of time",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          },
          "500": {
            "description": "An internal error occurred when processing the request",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        },
        "security": []
      }
    },
    "/update-customer-preference-details": {
      "patch": {
        "operationId": "Patch customer preference",
        "summary": "This API resource would update the customer preference details for the given Service Provider Id (SP Id) or primary CIDN.",
        "description": "This API resource would udpate the customer notification preference to the notification database.\n",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization header in the format 'Bearer {access_token}' - get the token by using the OAuth API with the scope 'TWNOTIFICATIONPREFERENCE'.",
            "type": "string",
            "required": true
          },
          {
            "name": "payload",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpdateCustomerPreferenceDetails"
            }
          }
        ],
        "tags": [
          "CPA"
        ],
        "responses": {
          "200": {
            "description": "Successful return of the message.",
            "schema": {
              "$ref": "#/definitions/Success"
            }
          },
          "400": {
            "description": "Invalid or missing request parameters",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          },
          "401": {
            "description": "Invalid or no credentials passed in the request",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          },
          "403": {
            "description": "Authorization credentials passed and accepted but account does not have permission",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          },
          "404": {
            "description": "The requested URI does not exist",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          },
          "429": {
            "description": "Too many requests in a given amount of time",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          },
          "500": {
            "description": "An internal error occurred when processing the request",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        },
        "security": []
      }
    },
    "/get-customer-preference-details": {
      "get": {
        "operationId": "Get Notifications new",
        "summary": "This API resource would get all the customer preference details for the given Service Provider Id (SP Id), in case of LOLO. This resource can be used to get the customer preference details for the given primary CIDN in case of SIIAM system.",
        "description": "This API resource would get all the customer preference details.\n",
        "produces": [
          "application/json"
        ],
        "tags": [
          "CPA"
        ],
        "responses": {
          "200": {
            "description": "Successful return of the message.",
            "schema": {
              "$ref": "#/definitions/GetCustomerPreferenceDetails"
            }
          },
          "400": {
            "description": "Invalid or missing request parameters",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          },
          "401": {
            "description": "The calling IP address or the Client Certificate are not authorized to call the API.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          },
          "403": {
            "description": "If the customer is not entitled to retrieve a particular data.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          },
          "404": {
            "description": "The requested URL or resource does not exist.",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          },
          "429": {
            "description": "Too many requests in a given amount of time",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          },
          "500": {
            "description": "There was an Internal Server Error occurring on the API",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        },
        "security": []
      }
    }
  },
  "securityDefinitions": {
    "OAuth2": {
      "type": "oauth2",
      "tokenUrl": "/v1/oauth/token",
      "flow": "application",
      "scopes": {
        "TWNOTIFICATIONPREFERENCE": "OAuth scope for the Notification Preference API"
      }
    }
  },
  "definitions": {
    "addCustomerPreferenceDetails": {
      "type": "object",
      "required": [
        "notificationChannel",
        "status"
      ],
      "properties": {
        "notificationChannel": {
          "type": "string",
          "description": "This value will only be 'API'. This field may support additional values in the future."
        },
        "status": {
          "type": "string",
          "description": "Determines the status of the customer notification preferences. This value will only be 'Active'. This field may support additional values in the future."
        },
        "preferenceDetails": {
          "type": "array",
          "items": {
            "required": [
              "entityType",
              "entityStatus"
            ],
            "properties": {
              "entityType": {
                "type": "string",
                "description": "Entity Type, viz., Order, Ticket, Diagnostic, Outage."
              },
              "entityStatus": {
                "type": "string",
                "description": "Entity Status, viz., 'Push' or 'None'."
              },
              "subscriberURL": {
                "type": "string",
                "description": "End point URL for customer to which the notification message will be posted. URL will be defined per Customer and not by per Customer per entity. like https://www.iinet.com.au/notifications and NOT https://www.iinet.com.au/notifications/order https://www.iinet.com.au/notifications/ticket."
              },
              "subscriberEmail": {
                "type": "string",
                "description": "End point Email for customer to which the Email notification message will be sent.Not in scope."
              },
              "subscriberNumber": {
                "type": "integer",
                "description": "End point Mobile number for customer to which the SMS notification message will be sent.Not in scope."
              },
              "token": {
                "type": "string",
                "description": "Will be included in the header message, in case of PUSH Notification scenario."
              }
            }
          }
        }
      },
      "example": {
        "notificationChannel": "API",
        "status": "Active",
        "preferenceDetails": [
          {
            "entityType": "Diagnostics",
            "entityStatus": "Push",
            "subscriberURL": "https://www.iinet.com.au/notifications/diagnostic",
            "token": "b8ijwUxirjWzDOzpnDaaMvqxXpZF"
          }
        ]
      }
    },
    "UpdateCustomerPreferenceDetails": {
      "type": "object",
      "properties": {
        "notificationChannel": {
          "type": "string",
          "description": "This value will only be 'API'. This field may support additional values in the future."
        },
        "status": {
          "type": "string",
          "description": "Determines the status of the customer notification preferences. This value will only be 'Active'. This field may support additional values in the future"
        },
        "preferenceDetails": {
          "type": "array",
          "items": {
            "required": [
              "entityType",
              "entityStatus"
            ],
            "properties": {
              "entityType": {
                "type": "string",
                "description": "Entity Type, viz., Order, Ticket, Diagnostic, Outage."
              },
              "entityStatus": {
                "type": "string",
                "description": "Entity Status, viz., 'Push' or 'None'."
              },
              "subscriberURL": {
                "type": "string",
                "description": "End point URL for customer to which the notification message will be posted. URL will be defined per Customer and not by per Customer per entity. like https://www.iinet.com.au/notifications and NOT https://www.iinet.com.au/notifications/order https://www.iinet.com.au/notifications/ticket."
              },
              "token": {
                "type": "string",
                "description": "Will be included in the header message, in case of PUSH Notification scenario."
              }
            }
          }
        }
      },
      "example": {
        "notificationChannel": "API",
        "status": "Active",
        "preferenceDetails": [
          {
            "entityType": "Diagnostics",
            "entityStatus": "Push",
            "subscriberURL": "https://www.iinet.com.au/notifications/diagnostic",
            "token": "b8ijwUxirjWzDOzpnDaaMvqxXpZF"
          }
        ]
      }
    },
    "GetCustomerPreferenceDetails": {
      "type": "object",
      "required": [
        "notificationChannel",
        "status"
      ],
      "properties": {
        "notificationChannel": {
          "type": "string",
          "description": "This value will only be 'API'. This field may support additional values in the future."
        },
        "status": {
          "type": "string",
          "description": "Determines the status of the customer notification preferences. This value will only be 'Active'. This field may support additional values in the future"
        },
        "preferenceDetails": {
          "type": "array",
          "items": {
            "required": [
              "entityType",
              "entityStatus"
            ],
            "properties": {
              "entityType": {
                "type": "string",
                "description": "Entity type to have a value from the below with a one occurrence for each event type, viz., Order, Ticket, Diagnostic, Outage."
              },
              "entityStatus": {
                "type": "string",
                "description": "Entity Status, viz., 'Push' or 'None'."
              },
              "subscriberURL": {
                "type": "string",
                "description": "End point URL for customer to which the notification message will be posted. URL will be defined per Customer and not by per Customer per entity. like https://www.iinet.com.au/notifications and NOT https://www.iinet.com.au/notifications/order https://www.iinet.com.au/notifications/ticket."
              },
              "token": {
                "type": "string",
                "description": "Token of the end customer.Will be included in the header message, in case of PUSH Notification scenario."
              }
            }
          }
        }
      },
      "example": {
        "notificationChannel": "API",
        "status": "Active",
        "preferenceDetails": [
          {
            "entityType": "Diagnostics",
            "entityStatus": "Push",
            "subscriberURL": "https://www.iinet.com.au/notifications/diagnostic",
            "token": "b8ijwUxirjWzDOzpnDaaMvqxXpZF"
          }
        ]
      }
    },
    "Error": {
      "type": "object",
      "required": [
        "message"
      ],
      "properties": {
        "status": {
          "type": "integer",
          "format": "int32",
          "description": "The status code."
        },
        "message": {
          "type": "string",
          "description": "Message describing the error."
        }
      },
      "example": {
        "status": 400,
        "message": "Invalid or missing request parameters"
      }
    },
    "Success": {
      "type": "object",
      "required": [
        "message"
      ],
      "properties": {
        "status": {
          "type": "integer",
          "format": "int32",
          "description": "The status code."
        },
        "message": {
          "type": "string",
          "description": "Success message."
        }
      },
      "example": {
        "status": 200,
        "message": "OK"
      }
    }
  }
}