
Anonymous Community User asked a question.
API Authentication Issues
I am trying to build an integration to send encrypted emails through ShareFile, but I cannot successfully complete the first step, getting the authentication code. I'm trying to follow the steps on the OAuth2 Getting Started Guide (https://api.sharefile.com/gettingstarted/oauth2). Using the first endpoint, whether I pass 'token' or 'code' as response_type and whether I use POST or GET, the return text is an HTML representation of the ShareFile login page, rather than a JSON string with the requested token or code. The status code is 200.token_url = 'https://secure.sharefile.com/oauth/authorize?response_type=token&client_id=' & sf_client_id & '&redirect_uri=' & sf_redirectSet hReq = CreateObject('MSXML2.ServerXMLHTTP.6.0')With hReq .Open 'POST', token_url .setRequestHeader 'Content-type', 'application/x-www-form-urlencoded' .SendEnd WithIf I try a different endpoint, as found in the cURL sample code (https://api.sharefile.com/samples/curl), I receive the error 'Invalid request; missing 'grant_type'.' though the query string clearly contains grant_type.token_url = 'https://mycompany.sharefile.com/oauth/token?grant_type=password&client_id=' & sf_client_id & '&client_secret=' & sf_secret & '&username=' & sf_user & '&password=' & sf_pwdI've tried encoding and sending the parameters as a JSON payload, which also doesn't work. So what is the correct endpoint to get an authentication code or token? What parameters do I need to pass? Thanks