C# Class SMS_App1, API-Platform

Default class
Inheritance: System.Web.UI.Page
Show file Open project: attdevsupport/API-Platform

Protected Methods

Method Description
BtnSendSMS_Click ( object sender, EventArgs e ) : void

This function is called with user clicks on send SMS This validates the access token and then calls sendSMS method to invoke send SMS API.

GetDeliveryStatusButton_Click ( object sender, EventArgs e ) : void

This method is called when user clicks on get delivery status button

GetMessagesButton_Click ( object sender, EventArgs e ) : void

This method is called when user clicks on get message button

Page_Load ( object sender, EventArgs e ) : void

This function is called when the application page is loaded into the web browser. This function reads the web.config file and gets the values of the attributes

Private Methods

Method Description
BypassCertificateError ( ) : void

This function is used to neglect the ssl handshake error with authentication server

DrawGetStatusSuccess ( string status, string url ) : void

This function is used to draw the table for get status success response

DrawPanelForFailure ( Panel, panelParam, string message ) : void

This function draws table for failed response in the panalParam panel

DrawPanelForSuccess ( Panel, panelParam, string message ) : void

This function is called to draw the table in the panelParam panel for success response

GetAccessToken ( AccessType type, Panel, panelParam ) : bool

This function get the access token based on the type parameter type values. If type value is 1, access token is fetch for client credential flow If type value is 2, access token is fetch for client credential flow based on the exisiting refresh token

GetSmsDeliveryStatus ( ) : void

This function is called when user clicks on get delivery status button. this function calls get sms delivery status API to fetch the status.

IsTokenValid ( ) : string

This function validates the expiry of the access token and refresh token, function compares the current time with the refresh token taken time, if current time is greater then returns INVALID_REFRESH_TOKEN function compares the difference of last access token taken time and the current time with the expiry seconds, if its more, function returns INVALID_ACCESS_TOKEN otherwise returns VALID_ACCESS_TOKEN

ReadAccessTokenFile ( Panel, panelParam ) : bool

This function reads the Access Token File and stores the values of access token, expiry seconds refresh token, last access token time and refresh token expiry time This function returns true, if access token file and all others attributes read successfully otherwise returns false

ReadAndGetAccessToken ( Panel, panelParam ) : bool

This function is used to read access token file and validate the access token this function returns true if access token is valid, or else false is returned

ReadConfigFile ( ) : bool

Reads from config file

RecieveSms ( ) : void

This function calls receive sms api to fetch the sms's

SendSms ( ) : void

This function validates the input fields and if they are valid send sms api is invoked

Method Details

BtnSendSMS_Click() protected method

This function is called with user clicks on send SMS This validates the access token and then calls sendSMS method to invoke send SMS API.
protected BtnSendSMS_Click ( object sender, EventArgs e ) : void
sender object Sender Information
e EventArgs List of Arguments
return void

GetDeliveryStatusButton_Click() protected method

This method is called when user clicks on get delivery status button
protected GetDeliveryStatusButton_Click ( object sender, EventArgs e ) : void
sender object Sender Information
e EventArgs List of Arguments
return void

GetMessagesButton_Click() protected method

This method is called when user clicks on get message button
protected GetMessagesButton_Click ( object sender, EventArgs e ) : void
sender object Sender Details
e EventArgs List of Arguments
return void

Page_Load() protected method

This function is called when the application page is loaded into the web browser. This function reads the web.config file and gets the values of the attributes
protected Page_Load ( object sender, EventArgs e ) : void
sender object Sender Details
e EventArgs List of Arguments
return void