API link not working

  • 1
  • Problem
  • Updated 5 days ago
We have a simple client portal hosted on Azure cloud. We coded it in .NET using REST API. 
I think it is verison 1. 

I can see that we have the below code. We show the sharefile in an IFRAME.

https://[company name].sharefile.com/default.aspx?side=0&username="; + email + "&password=" + pwd + "&masthead=3


This was working from past 2 years. Now, when we tried it, it is showing the portal, but the client is unable to create a folder.

If we use the same client details an login at Sharefile.com, he is able to create the folder.

Sharefile tech support directed me to this website. Can you help me on how to fix this issue. 
This is a very time sensitive issue as the portal is live and receiving calls. If we create the folder from the admin side, the clients are able to upload documents.

Thanks in advance for your reply.
Photo of Srinivas Thouta

Srinivas Thouta

  • 7 Posts
  • 0 Reply Likes
  • frustrated.

Posted 3 years ago

  • 1
Photo of Eliezer Encarnacion

Eliezer Encarnacion, Official Rep

  • 732 Posts
  • 102 Reply Likes
Hi Srinivas,

Thank you for bringing this up to our attention. I notice that the url you are using is not one of our publicly documented APIs (api.sharefile.com), so I am not aware of any changes to this endpoint. Would you be able to tell how your team learned about this url and parameters?
I am investigating with the web app team to clarify what is wrong and if it can be fixed.

In the meantime, you will have to remove the "masthead=3" argument from the url and display the ShareFile masthead in order to correctly display the Create Folder window. 

Let me know if you have any follow up questions or concerns.

Thanks!

Eli
Photo of Srinivas Thouta

Srinivas Thouta

  • 7 Posts
  • 0 Reply Likes
Eli,

Thanks for the quick reply. 

This might be the version 1. Sharefile has documention on REST API which had all the links and instructions and our programmer used that documentation to integrate the portal.

After removing the "masthead=3", I am able to create the folder.  But since we have an IFRAME, the intention is to display sharefile within our portal. 

What are the parameters we have to pass so that we can we don't show the BLACK HEADER on the top AND THE SIDE MENU (HIGHLIGHTED) in the below image.

https://www.dropbox.com/s/jdsjodhmus5av3o/api%20link%20without%20masthead.PNG?dl=0
Sincerely appreciate your response. Thanks for getting back to me so quickly.
You Rock !!
Photo of Eliezer Encarnacion

Eliezer Encarnacion, Official Rep

  • 732 Posts
  • 102 Reply Likes
Srinivas,

So far the way you were doing it is the only way to achieve this. Our web application engineers are working on this and the issue will be fixed, but in the meantime the only workaround that will allow an user to create Folders will unfortunately require that the header remains there. This should be fixed soon, I'll keep you updated.

Let me know if I can help with anything else,
Eli
Photo of Srinivas Thouta

Srinivas Thouta

  • 7 Posts
  • 0 Reply Likes
Eli,

We are having issues with the API. It used to work few months ago. Is there any other way we can get this resolved.

We are in the middle of peak season and the API is causing a huge problem.
Photo of Eliezer Encarnacion

Eliezer Encarnacion, Official Rep

  • 732 Posts
  • 102 Reply Likes
Srinivas,

The issue is still being worked on by our web application engineers. I'll try to get you an ETA on when it will be resolved. Unfortunately the only way to retain the Folder Creation functionality is to remove the masthead, at least until the issue is fixed. Apologies for the inconvenience.

Thanks,
Eli
Photo of Srinivas Thouta

Srinivas Thouta

  • 7 Posts
  • 0 Reply Likes
Thanks for the update. Eagerly waiting for an update.
Photo of Eliezer Encarnacion

Eliezer Encarnacion, Official Rep

  • 732 Posts
  • 102 Reply Likes
Srinivas,

A patch with this fix has been released. Please confirm with me on your end that you are able to create folders when removing the masthead from ShareFile.

I also wanted to take this opportunity to invite you to move to the next version of the ShareFile API, found here. This provides a better way to authenticate with ShareFile that does not require passing user credentials on a query string, which can be unsafe. A malicious user can capture that request, login to your ShareFile account, and access private information. In addition, the API you are using is no longer documented and will reach End Of Life soon. After that point, we won't be able to support login in using the default.aspx endpoint.

What language are you using on your website? I'd be glad to write a small script for you that will achieve the same use case you have implemented now, but using the V3 API.

Thanks,
Eli
Photo of Srinivas Thouta

Srinivas Thouta

  • 7 Posts
  • 0 Reply Likes
Hi,

We need your help. Please send us the script using V3 API. Please treat this us URGENT.

Current scenario: We are using V2 API and showing the sharefile website using IFRAME. Based on the current scenario, we are unable to change the IFrame part (we are open to ideas).

WHAT WE HAVE TO ACHIEVE:
Using API, we need to create an account on Sharefile, set the password on a .NET page. In the IFRAME, we should show the shared folder.

I have a programmer who can code in .NET. If you can send the code or guide him how to achieve the above task, it would be great.

Thanks in advance. Please treat this as very urgent.
Photo of Srinivas Thouta

Srinivas Thouta

  • 7 Posts
  • 0 Reply Likes
Hi,

I see that the API url is not working. When our clients login they are getting 401/404 error.

Whether the version 1 API URLs are disabled. When we login to the sharefile portal, clients are able to login.
Photo of Eliezer Encarnacion

Eliezer Encarnacion, Official Rep

  • 732 Posts
  • 102 Reply Likes
Srinivas,

It is very likely that page has been discontinued. As I mentioned a year ago, this was a non-documented API that would reach End of Life soon. In order to do the same with the supported V3 api, your application must do the following:

1. Obtain a clientId/secret pair from https://api.sharefile.com/rest/oauth2-request.aspx

2. Obtain a bearer token with the user's credentials
GET https://account.sf-api.com/oauth/token?grant_type=password&client_id={{client_id}}&client_secret={{client_secret}}&username={{user}}&password={{password}}
3. Authenticating using this same token (see this page), call the following API:

POST https://account.sf-api.com/sf/v3/Users/WebAppLink

That will give you a link you can use to login the user into the webapp directly, and display on your iframe. Let me know if you have any questions. Thanks! Eli
Photo of Sahil Shah

Sahil Shah

  • 1 Post
  • 0 Reply Likes
POST https://account.sf-api.com/sf/v3/Users/WebAppLink
I am trying to embed the link returned by this API in to an iframe.
The link is no longer able to open the user's web account. Instead it opens the login page.