CreateFolder1 API¶
Creates a new subfolder with an optional description inside the specified parent folder. The parent folder must already exist. Use this variant when you need to specify both the parent path and the new folder name separately, and optionally provide a description.
Endpoint¶
Methods¶
- GET
/srv.asmx/CreateFolder1?authenticationTicket=...&ParentFolderPath=...&NewFolderName=...&Description=... - POST
/srv.asmx/CreateFolder1(form data) - SOAP Action:
http://tempuri.org/CreateFolder1
Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
authenticationTicket |
string | Yes | Authentication ticket obtained from AuthenticateUser. |
ParentFolderPath |
string | Yes | Full infoRouter path to the parent folder (e.g. /Finance/Reports). It does not have to exist: any missing folder along the way is created. Only the library at the start of the path must already exist. |
NewFolderName |
string | Yes | Name of the new subfolder. Sanitised before use - see below - so the folder created may carry a different name, which the response reports. An empty name, or one of nothing but spaces, is refused with HTTP 400. Maximum 128 characters. |
Description |
string | No | Optional description for the new folder. Maximum 255 characters; a longer value is refused with 4000. |
Response¶
Success Response¶
Error Response¶
| Attribute | Description |
|---|---|
success |
"true" if the folder was created successfully. |
FolderId |
The internal ID of the newly created folder. |
FolderName |
The sanitized name of the created folder. |
Required Permissions¶
The calling user must have create subfolder permission on the parent folder.
Example¶
GET Request¶
GET /srv.asmx/CreateFolder1
?authenticationTicket=3f2504e0-4f89-11d3-9a0c-0305e82c3301
&ParentFolderPath=/Finance/Reports
&NewFolderName=2024
&Description=Annual reports for fiscal year 2024
HTTP/1.1
POST Request¶
POST /srv.asmx/CreateFolder1 HTTP/1.1
Content-Type: application/x-www-form-urlencoded
authenticationTicket=3f2504e0-4f89-11d3-9a0c-0305e82c3301
&ParentFolderPath=/Finance/Reports
&NewFolderName=2024
&Description=Annual reports for fiscal year 2024
SOAP Request¶
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tns="http://tempuri.org/">
<soap:Body>
<tns:CreateFolder1>
<tns:authenticationTicket>3f2504e0-4f89-11d3-9a0c-0305e82c3301</tns:authenticationTicket>
<tns:ParentFolderPath>/Finance/Reports</tns:ParentFolderPath>
<tns:NewFolderName>2024</tns:NewFolderName>
<tns:Description>Annual reports for fiscal year 2024</tns:Description>
</tns:CreateFolder1>
</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 one folder from a parent path and a name, with an optional description. Otherwise the same as CreateFolder, which derives those two from a single path.
It creates the folders above it as well. The parent is resolved with path creation switched on, so a path whose parent does not exist is not refused - the whole chain is created and the response reports the leaf. If a caller needs "fail when the parent is missing", it has to check with FolderExists first.
The name is cleaned before it is used¶
The folder that appears may not be the one that was asked for, which is why the response reports
FolderName rather than echoing the request. Read it back rather than assuming.
| In the name | What happens |
|---|---|
/ \ : * ? " < > | # tab % & + |
each becomes one _ |
.. |
collapses to ., repeatedly |
| two spaces | collapse to one, repeatedly |
leading or trailing . |
removed |
| leading or trailing whitespace | removed |
| more than 128 characters | truncated, with a hash added before the extension |
So ..Q3 report <final>.. is created as Q3 report _final_.
const root = await call('CreateFolder1', {
authenticationTicket: ticket,
ParentFolderPath: '/Finance/Reports',
NewFolderName: '2026',
Description: 'Quarterly reporting'
});
// The name it used, which may differ from the one asked for.
console.log(root.getAttribute('FolderName'));
Description is optional and may be left empty. NewFolderName may not: an empty name, or one of
nothing but spaces, is refused by model binding with HTTP 400 before the operation runs.
Notes¶
- Root-level folders (domains/libraries) cannot be created using this API. Use
CreateDomaininstead. - Unlike
CreateFolder, this variant takes the parent path and new folder name as separate parameters, making it more suitable when the folder name is dynamic. - Folder names are sanitized (invalid characters are removed or replaced) before creation.
- If
Descriptionis omitted or null, the folder is created without a description.
Related APIs¶
- CreateFolder - Create a folder using a single full path
- CreateDomain - Create a top-level domain/library
- DeleteFolder - Delete a folder
- UpdateFolderProperties - Update folder name and description
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 told "Anonymous users cannot perform this action" |
4090 |
a folder of that name is already in the parent |
4041 |
ParentFolderPath is /, or names a library that does not exist |
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. |
| Folder not found | The parent folder path does not exist. |
| Access denied | The user does not have permission to create subfolders. |
| Root level folders cannot be created | The parent path points to the system root. |
SystemError:... |
An unexpected server-side error occurred. |