I eventually found out a way to do this. Uploading an aspx file that redirects to the correct document does the trick. I include the aspx file in the JavaScript code because this makes it easy to modify the url to point to different files. The aspx file automatically populates the url and description fields so making another call to set those is not necessary. Here is the code:
function AddLink(){
var fileName = "test.docx";
var vardata = '<%@ Page language="C#" %>'+
"<%@ Assembly Name='Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' %>"+
"<%@ Register TagPrefix='SharePoint' Namespace='Microsoft.SharePoint.WebControls' Assembly='Microsoft.SharePoint' %>"+
"<%@ Import Namespace='System.IO' %>"+
"<%@ Import Namespace='Microsoft.SharePoint' %>"+
"<%@ Import Namespace='Microsoft.SharePoint.Utilities' %>"+
"<%@ Import Namespace='Microsoft.SharePoint.WebControls' %>"+
'<html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">'+
'<head>'+
"<meta name='WebPartPageExpansion' content='full' /> <meta name='progid' content='SharePoint.Link' />"+
'<!--[if gte mso 9]><SharePoint:CTFieldRefs runat=server Prefix="mso:" FieldList="FileLeafRef,URL,IconOverlay"><xml>'+
'<mso:CustomDocumentProperties>'+
'<mso:ContentTypeId msdt:dt="string">0x01010A00EDD388FD5D86CB41BC0CFDC058F11820</mso:ContentTypeId>'+
'<mso:IconOverlay msdt:dt="string">|docx?d=wb030a1c46dee4fd6ac9e319218f7b63b|linkoverlay.gif</mso:IconOverlay>'+
'<mso:URL msdt:dt="string">https://sharepointsite.com/sites/TeamSite/Shared%20Documents/'+fileName+', https://sharepointsite.com/sites/TeamSite/Shared%20Documents/'+fileName+'</mso:URL>'+
'</mso:CustomDocumentProperties>'+
'</xml></SharePoint:CTFieldRefs><![endif]-->'+
'</head>'+
'<body>'+
"<form id='Form1' runat='server'>"+
"<SharePoint:UrlRedirector id='Redirector1' runat='server' />"+
'</form>'+
'</body>'+
'</html>';
var uspURL = "https://sharepointsite.com/sites/TeamSite/_api/web/getfolderbyserverrelativeurl('/sites//CustomTasks')/files" +
"/add(overwrite=true, url='Testing.aspx')";
$.ajax({
url: uspURL,
type: "POST",
contentType: "application/json;odata=verbose",
data: vardata,
headers: {
"Accept": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val()
},
success: function (data) {
var oitemid = data.d.ID
alert('Sucess');
},
error: function (jqxr, errorCode, errorThrown) {
alert(jqxr.responseText);
}
});
}