Exemplo n.º 1
0
        /// <summary>
        /// Request Access Token Partner makes a request to the token endpoint by adding the following parameters described below
        /// </summary>
        /// <exception cref="MeliLibTools.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="grantType">Value MUST be set to \&quot;authorization_code\&quot;</param>
        /// <param name="clientId"></param>
        /// <param name="clientSecret"></param>
        /// <param name="redirectUri"></param>
        /// <param name="code">The code received in the query string when redirected from authorization page  (optional)</param>
        /// <param name="refreshToken">The refresh_token received in the query string when redirected from authorization page  (optional)</param>
        /// <returns>Task of Token</returns>
        public async System.Threading.Tasks.Task <Token> GetTokenAsync(string grantType, string clientId, string clientSecret, string redirectUri, string code = default(string), string refreshToken = default(string))
        {
            MeliLibTools.Client.ApiResponse <Token> localVarResponse = await GetTokenAsyncWithHttpInfo(grantType, clientId, clientSecret, redirectUri, code, refreshToken);

            return(localVarResponse.Data);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Request Access Token Partner makes a request to the token endpoint by adding the following parameters described below
 /// </summary>
 /// <exception cref="MeliLibTools.Client.ApiException">Thrown when fails to make API call</exception>
 /// <param name="grantType">Value MUST be set to \&quot;authorization_code\&quot;</param>
 /// <param name="clientId"></param>
 /// <param name="clientSecret"></param>
 /// <param name="redirectUri"></param>
 /// <param name="code">The code received in the query string when redirected from authorization page  (optional)</param>
 /// <param name="refreshToken">The refresh_token received in the query string when redirected from authorization page  (optional)</param>
 /// <returns>Token</returns>
 public Token GetToken(string grantType, string clientId, string clientSecret, string redirectUri, string code = default(string), string refreshToken = default(string))
 {
     MeliLibTools.Client.ApiResponse <Token> localVarResponse = GetTokenWithHttpInfo(grantType, clientId, clientSecret, redirectUri, code, refreshToken);
     return(localVarResponse.Data);
 }