by
0
6
84k
21
Top 1% !
Pearl of Wisdom
Tagged
Specified
Refined
OpenSource
Popularity: 29480th place

Published on:

.NETFramework4.0
Extension.cs
LanguageCSharp
LicenseMIT_X11
OSWindows

Base class to setup the secure communication towards MailUp REST API

This is how to setup a secure connection towards MailUP RESTful API. This base class can be extended with methods that directly call those web methods
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/171082/Base-class-to-setup-the-secure-communica?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
public class BaseAPIInvoker { #region App Credentials protected static String ClientId = "take from your console"; protected static String ClientSecret = "take from your console"; protected static String UserName = "mxxx@number"; protected static String Password = "pswsupersecret"; protected static String bypassToken = String.Empty; #endregion #region Endpoints protected static String OAuthAuthorization = "https://services.mailup.com/Authorization/OAuth/Authorization"; protected static String OAuthToken = "https://services.mailup.com/Authorization/OAuth/Token"; protected static String BaseEndpoint = "https://services.mailup.com/API/v1/Rest/ConsoleService.svc"; #endregion public OAuth2Client client; public BaseAPIInvoker() { client = new OAuth2Client(OAuthToken, OAuthAuthorization); client.ClientId = ClientId; client.ClientSecret = ClientSecret; client.Username = UserName; client.Password = Password; client.ForceToken = bypassToken; client.GetToken(); } }
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus