/// <summary> /// Creates a new Asana entry point. /// </summary> /// <param name="apiKeyOrBearerToken">The API key (for Basic authentication) or Bearer Token (for OAuth authentication) for the account we intend to access</param> public Asana(string apiKeyOrBearerToken, AuthenticationType authType, Action <string, string, string> errorCallback) { _baseUrl = "https://app.asana.com/api/1.0"; _errorCallback = errorCallback; AuthType = authType; if (AuthType == AuthenticationType.OAuth) { OAuthToken = apiKeyOrBearerToken; } else { APIKey = apiKeyOrBearerToken; EncodedAPIKey = Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes(apiKeyOrBearerToken + ":")); } AsanaFunction.InitFunctions(); }
static Asana() { AsanaFunction.InitFunctions(); }