Пример #1
0
        /// <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();
        }
Пример #2
0
 static Asana()
 {
     AsanaFunction.InitFunctions();
 }