internal static Token HandleBasicAuthentication(OrionApiClient OrionClient, Request request, Credentials credentials) { var authRequest = new Request(Method.GET, AuthenticationPath); ApplyBasicAuthentication(authRequest, credentials); var response = OrionClient.ExecuteTask <Token>(authRequest); if (response.StatusCode != StatusCode.OK) { throw new Exception("Unable to obtain Orion API token."); } return(response.Data); }
public IResult <Logo> UploadMainThemeLogo(string entityType, long entityId, string logoData) { var request = new Request($"Settings/CustomSettings/theme-main-logo?entity={entityType}&entityId={entityId}", Method.PUT); var logo = new Logo() { ImageStream = logoData, PromptName = "theme-main-logo", Category = "global", CustomAppSetting = "ClientPortal" }; request.AddParameter("application/json", JsonConvert.SerializeObject(logo)); //request.AddParameter(mimeType, brokerDealerLogo.ToString()); return(client.ExecuteTask <Logo>(request)); }