CreateURL API¶
Creates a new URL document or updates the target address of an existing URL document at the specified path. URL documents are infoRouter items that store a hyperlink -" when opened, they redirect the user to the stored web address.
When the target Path does not exist, a new URL document is created. When it already exists, a new version is created with the updated address.
Endpoint¶
Methods¶
-
GET
/srv.asmx/CreateURL?authenticationTicket=...&Path=...&AddressURL=... -
POST
/srv.asmx/CreateURL(form data) -
SOAP Action:
http://tempuri.org/CreateURL
Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
authenticationTicket |
string | Yes | Authentication ticket obtained from AuthenticateUser. |
Path |
string | Yes | Full infoRouter path for the URL document to create or update (e.g. /MyLibrary/Links/CompanyWebsite). The document name must not end with the .url extension. |
AddressURL |
string | Yes | The target web address to store in the URL document (e.g. https://www.example.com). |
Response¶
Success Response¶
Error Response¶
Required Permissions¶
-
Creating a new URL document: The authenticated user must have Add Document permission on the destination folder (the parent of
Path). -
Updating an existing URL document: The authenticated user must have Check Out and Publish permissions on the existing document at
Path. If the document is already checked out by another user, the call fails.
Example¶
GET Request -" Create new URL document¶
GET /srv.asmx/CreateURL
?authenticationTicket=3f2504e0-4f89-11d3-9a0c-0305e82c3301
&Path=/MyLibrary/Links/CompanyWebsite
&AddressURL=https://www.example.com
HTTP/1.1
POST Request -" Create new URL document¶
POST /srv.asmx/CreateURL HTTP/1.1
Content-Type: application/x-www-form-urlencoded
authenticationTicket=3f2504e0-4f89-11d3-9a0c-0305e82c3301
&Path=/MyLibrary/Links/CompanyWebsite
&AddressURL=https://www.example.com
POST Request -" Update existing URL document¶
POST /srv.asmx/CreateURL HTTP/1.1
Content-Type: application/x-www-form-urlencoded
authenticationTicket=3f2504e0-4f89-11d3-9a0c-0305e82c3301
&Path=/MyLibrary/Links/CompanyWebsite
&AddressURL=https://www.newaddress.com
SOAP Request¶
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tns="http://tempuri.org/">
<soap:Body>
<tns:CreateURL>
<tns:authenticationTicket>3f2504e0-4f89-11d3-9a0c-0305e82c3301</tns:authenticationTicket>
<tns:Path>/MyLibrary/Links/CompanyWebsite</tns:Path>
<tns:AddressURL>https://www.example.com</tns:AddressURL>
</tns:CreateURL>
</soap:Body>
</soap:Envelope>
JavaScript¶
Every call answers XML with HTTP 200, success or not, so success is the thing to branch on and
errorCode is the number to report.
async function call(action, params) {
const response = await fetch(`/srv.asmx/${action}?${new URLSearchParams(params)}`);
const root = new DOMParser()
.parseFromString(await response.text(), 'text/xml')
.documentElement;
if (root.getAttribute('success') !== 'true') {
throw new Error(`${root.getAttribute('errorCode')}: ${root.getAttribute('error')}`);
}
return root;
}
Creates a document that holds a web address.
await call('CreateURL', {
authenticationTicket: ticket,
Path: '/Finance/Links/supplier.url',
AddressURL: 'https://www.example.com/portal'
});
The address is not checked. Anything non-empty is stored as written - no scheme is required and
nothing is fetched - so a typo is kept and only shows up when someone follows the link. An empty
AddressURL is refused by model binding with HTTP 400.
Notes¶
-
The document name in
Pathmust not include the.urlfile extension. infoRouter stores the URL address internally and does not use Windows-style.urlfiles. -
The destination folder (the parent of
Path) must already exist before calling this API. -
When updating an existing URL document that is not currently checked out, the API automatically checks the document out and then publishes a new version, leaving the document checked in afterward.
-
When updating a document that is already checked out by the current user, the document remains checked out after the call.
-
If the document at
Pathis checked out by a different user, the call fails with an error.
Related APIs¶
-
CreateDocumentShortcut - Create a shortcut to another infoRouter document
-
GetDocument - Retrieve properties of a document including its stored URL address
-
GetDocumentVersions - List all versions of a document
Error Codes¶
The errorCode values this operation returns, checked against a running server:
errorCode |
When |
|---|---|
4010 |
the ticket is expired or unknown, or there is no ticket at all - the anonymous user is refused |
4090 |
a document of that name is already in the folder |
4041 |
no folder at the parent of Path |
HTTP 400 |
a required string parameter was empty; refused by model binding, so there is no error document |
| Error | Description |
|---|---|
[900] Authentication failed |
Invalid or missing authentication ticket. |
[901] Session expired or Invalid ticket |
The ticket has expired or does not exist. |
The document file extension must be "url" |
The Path ends with the .url extension, which is not permitted. Remove the extension from the document name. |
Folder not found |
The destination folder (parent of Path) does not exist or is not accessible. |
This document has been checked out by another user. |
The document at Path is checked out by a different user; it cannot be updated. |