The function SendShare does not work anymore

  • 1
  • Problem
  • Updated 9 months ago

Hello,

The function SendShare has not worked since February 19. It returns always the error 404.
Have you the same problem? How to fix it?

Thank you for your help.
Sylver
Photo of Sylver

Sylver

  • 16 Posts
  • 1 Reply Like

Posted 9 months ago

  • 1
Photo of Brijesh Luckria

Brijesh Luckria, Manager, Engineering

  • 7 Posts
  • 0 Reply Likes
Sylver, Can you please provide the exact API call you are making for "SendShare"

Thanks,
Brijesh. 
(Edited)
Photo of Sylver

Sylver

  • 16 Posts
  • 1 Reply Like

Hello Brijesh,

Thanks for you help.
The below function allows to get a share link on itemId:

string CreateSendShare(string itemId)

{

string sendShare = null;

String uri = string.Format("https://{0}/sf/v3/Shares?notify=false", getHostname());

HttpWebRequest request = WebRequest.CreateHttp(uri);

addAuthorizationHeader(request);

DateTime dt = DateTime.Now.AddDays(30).ToUniversalTime();

string expirationDate = dt.ToString("yyyy-MM-dd HH:mm:ss");

var parameters = new

{

ShareType = "Send",

Title = "CreateSendShare",

Items = new[] { new { Id = itemId } },

ExpirationDate = expirationDate,

RequireLogin = false,

RequireUserInfo = false,

MaxDownloads = -1,

UseStreamIDs = false

};

string json = JsonConvert.SerializeObject(parameters);

request.Method = "POST";

request.ContentType = "application/json";

using (var writer = new StreamWriter(request.GetRequestStream()))

{

writer.Write(json);

}

HttpWebResponse response = (HttpWebResponse)request.GetResponse();

PrintOut(response.StatusCode);

using (var reader = new StreamReader(response.GetResponseStream()))

{

String body = reader.ReadToEnd();

JObject share = JObject.Parse(body);

sendShare = share["Uri"].ToString();

}

return sendShare;

}


(Edited)
Photo of Brijesh Luckria

Brijesh Luckria, Manager, Engineering

  • 7 Posts
  • 0 Reply Likes
It seems to be working as expected. I tried in few test accounts. 

{
 "ShareType":"Send",
 "Title":"Sample Send Share",
 "Items": [ {"Id":"fo67bd89-dda6-4f02-a846-17eaab9559878"}],
 "Recipients":[ { "User": { "Email": "correctemailadress@citrix.com" } } ],
 "ExpirationDate": "2021-07-23",
 "RequireLogin": false,
 "RequireUserInfo": false,
 "MaxDownloads": -1,
 "UsesStreamIDs": false
}

We will get 404 error, if Recipients email does not exist in that account. I tried that too and it returned the expected error message. 

{
  "readyState": 4,
  "responseText": "{\"code\":\"NotFound\",\"message\":{\"lang\":\"en-US\",\"value\":\"There is no account associated with this email address.\"},\"reason\":\"NotFound\"}",
  "responseJSON": {
    "code": "NotFound",
    "message": {
      "lang": "en-US",
      "value": "There is no account associated with this email address."
    },
    "reason": "NotFound"
  },
  "status": 404,
  "statusText": "Not Found"
}


Photo of Sylver

Sylver

  • 16 Posts
  • 1 Reply Like
Hello,

I added a valid Récipients email and it returns always the 404 error (Not found).

KR
Photo of Brijesh Luckria

Brijesh Luckria, Manager, Engineering

  • 7 Posts
  • 0 Reply Likes
I can debug your code if you mind sharing your console app code.. (Pull all the required method in a new console app and share it with me) .. 

Also it looks like you are not using ShareFile C# SDK? I will recommend using that.  https://github.com/citrix/ShareFile-NET
Photo of rob Brown

rob Brown

  • 1 Post
  • 0 Reply Likes
Have just been battling the same issue for a customer of ours. My test system was working fine with my trial account but when changing to their account it failed with 404. Both accounts worked last week. long story short, in my scenario, even though account authorisation worked and file upload worked the actual share link created for email was not validating(it couldn't find it ergo 404). on closer inspection the hostname creation from getHostname());  in my instance  was {0}.sf-api.com  and token.apicp was sharefile.com but for customer it was sharefile.eu , so switching accordingly to be {0}.sf-api.eu everything worked as it should.  My guess is changed storage location. This may or may not help you  :)
Photo of Sylver

Sylver

  • 16 Posts
  • 1 Reply Like
Hello,

Yes, last night I noticed the same problme as you. Change .com to .eu fix the issue...

@Brijesh, is it a bug in Citrix ShareFile?

It's unfortunate that we aren't notified for the change of domain.

Thank you everyone! :)

BR

Photo of Brijesh Luckria

Brijesh Luckria, Manager, Engineering

  • 7 Posts
  • 0 Reply Likes
I am not aware of the defect... Is your account a .com or .eu?  Can you let me know your account name? 
Photo of Sylver

Sylver

  • 16 Posts
  • 1 Reply Like