GET

Description

Retrieves a list of files and folders or a single file or folder.

URL structure

https://api.fortnox.se/3/archive/{id}

https://api.fortnox.se/3/archive?path={directory}

Method

GET

Version

3

Response

The archive register can return a list of files and folders or a single file/folder. By specifying a path or an Id in the URL, a single folder will be returned. If your path or Id points to a file, the content will be a returned as a filestream. If no path or Id is provided a list of the root will be returned.

<?xml version="1.0" encoding="UTF-8"?>
<Folder url="https://api.fortnox.se/3/archive/root">
    <Email>fortnox@example.se</Email>
    <Files>
        <File url="https://api.fortnox.se/3/archive/ecf2a0e7-06b3-4067-9614-f5da77f0e008">
            <Comments></Comments>
            <Id>ecf2a0e7-06b3-4067-9614-f5da77f0e008</Id>
            <Name>fortswap.png</Name>
            <Path>root</Path>
            <Size>56135</Size>
        </File>
        [...]
        <File url="https://api.fortnox.se/3/archive/8c636972-00a2-4352-912e-d7a0d5d1f1be">
            <Comments></Comments>
            <Id>8c636972-00a2-4352-912e-d7a0d5d1f1be</Id>
            <Name>moln.png</Name>
            <Path>root</Path>
            <Size>49629</Size>
        </File>
    </Files>
    <Folders>
        <Folder url="https://api.fortnox.se/3/archive/d8b06758-6c73-40c0-8e26-9fa1437cfe7b">
            <Id>d8b06758-6c73-40c0-8e26-9fa1437cfe7b</Id>
            <Name>testmapp</Name>
        </Folder>
        [...]
        <Folder url="https://api.fortnox.se/3/archive/d8b06758-6c73-40c0-8e26-9fa437sdg456">
            <Id>d8b06758-6c73-40c0-8e26-9fa437sdg456</Id>
            <Name>testmapp</Name>
        </Folder>
    </Folders>
    <Id>root</Id>
    <Name>root</Name>
</Folder>
<?xml version="1.0" encoding="UTF-8"?>
<Folder url="https://api.fortnox.se/3/archive/d8b06758-6c73-40c0-8e26-9fa1437cfe7b">
    <Email>d8b06758-6c73-40c0-8e26-9fa1437cfe7b.501737@alfa.arkivplats.se</Email>
    <Files>
        <File url="https://api.fortnox.se/3/archive/b15958d8-36b3-41e6-8ec5-3462899e3e96">
            <Comments></Comments>
            <Id>b15958d8-36b3-41e6-8ec5-3462899e3e96</Id>
            <Name>test.png</Name>
            <Path>d8b06758-6c73-40c0-8e26-9fa1437cfe7b</Path>
            <Size>3874</Size>
        </File>
    </Files>
    <Folders/>
    <Id>d8b06758-6c73-40c0-8e26-9fa1437cfe7b</Id>
    <Name>testmapp</Name>
</Folder>
{
    "Folder": {
        "@url": "https://api.fortnox.se/3/archive/root",
        "Email": "fortnox@example.se",
        "Files": [
            {
                "@url": "https://api.fortnox.se/3/archive/ecf2a0e7-06b3-4067-9614-f5da77f0e008",
                "Comments": null,
                "Id": "ecf2a0e7-06b3-4067-9614-f5da77f0e008",
                "Name": "fortex.png",
                "Path": "root",
                "Size": 56135
            },
            [...]
            {
                "@url": "https://api.fortnox.se/3/archive/8c636972-00a2-4352-912e-d7a0d5d1f1be",
                "Comments": null,
                "Id": "8c636972-00a2-4352-912e-d7a0d5d1f1be",
                "Name": "moln.png",
                "Path": "root",
                "Size": 49629
            }
        ],
        "Folders": [
            {
                "@url": "https://api.fortnox.se/3/archive/d8b06758-6c73-40c0-8e26-9fa1437cfe7b",
                "Id": "d8b06758-6c73-40c0-8e26-9fa1437cfe7b",
                "Name": "testmapp"
            },
            [...]
            {
                "@url": "https://api.fortnox.se/3/archive/d8b06758-6c73-40c0-8e26-9fa1437w235b",
                "Id": "d8b06758-6c73-40c0-8e26-9fa1437w235b",
                "Name": "testmapp2"
            }
        ],
        "Id": "root",
        "Name": "root"
    }
}
{
    "Folder": {
        "@url": "https://api.fortnox.se/3/archive/d8b06758-6c73-40c0-8e26-9fa1437cfe7b",
        "Email": "example@fortnox.se",
        "Files": [
            {
                "@url": "https://api.fortnox.se/3/archive/b15958d8-36b3-41e6-8ec5-3462899e3e96",
                "Comments": null,
                "Id": "b15958d8-36b3-41e6-8ec5-3462899e3e96",
                "Name": "test.png",
                "Path": "d8b06758-6c73-40c0-8e26-9fa1437cfe7b",
                "Size": 3874
            }
        ],
        "Folders": [],
        "Id": "d8b06758-6c73-40c0-8e26-9fa1437cfe7b",
        "Name": "testmapp"
    }
}

POST – Subdirectory

If no directory is provided in the parameter path, the folder will be created in the root directory.

Description

Creates a new subdirectory either in root or in a specific subdirectory.

URL structure

https://api.fortnox.se/3/archive/?path={directory}

Method

POST

Version

3

Request

The request body should contain a structure of a folder, either in JSON or XML.

<?xml version="1.0" encoding="utf-8"?>
<Folder>
  <Name>New folder</Name>
</Folder>
{
  "Folder":{
     "Name":"New folder"
  }
}

Response

The response should contain the created folder in either JSON or XML.

<?xml version="1.0" encoding="UTF-8"?>
<Folder url="https://api.fortnox.se/3/archive/c33ec8cc-3a00-49c1-a90d-d8e379c0e616">
    <Email>c33ec8cc-3a00-49c1-a90d-d8e379c0e616.501737@alfa.arkivplats.se</Email>
    <Files/>
    <Folders/>
    <Id>c33ec8cc-3a00-49c1-a90d-d8e379c0e616</Id>
    <Name>New folder</Name>
</Folder>
{
    "Folder": {
        "@url": "https://api.fortnox.se/3/archive/90b93241-0eac-45fe-9413-277830e6a9cf",
        "Email": "90b93241-0eac-45fe-9413-277830e6a9cf.501737@alfa.arkivplats.se",
        "Files": [],
        "Folders": [],
        "Id": "90b93241-0eac-45fe-9413-277830e6a9cf",
        "Name": "New folder"
    }
}

POST – Files

If not directory or FolderId is provided, the file will be uploaded to the root directory.

Description

Upload a file to a specific subdirectory.

URL structure

https://api.fortnox.se/3/archive/?path={directory}

https://api.fortnox.se/3/archive/?folderid={Id}

Method

POST

Version

3

Request

The request body should contain the contents of the file.

Response

<?xml version="1.0" encoding="UTF-8"?>
<File url="https://api.fortnox.se/3/archive/0df13d88-0686-49c8-987d-b9e384dedd7a">
  <Comments></Comments>
  <Id>0df13d88-0686-49c8-987d-b9e384dedd7a</Id>
  <Name>voucher1.png</Name>
  <Path>root</Path>
  <Size>157</Size>
</File>
{
  "File": {
    "@url": "https://api.fortnox.se/3/archive/0df13d88-0686-49c8-987d-b9e384dedd7a",
    "Comments": null,
    "Id": "0df13d88-0686-49c8-987d-b9e384dedd7a",
    "Name": "voucher1.png",
    "Path": "root",
    "Size": 157
  }
}

DELETE

Please note that removing a folder will also resulting in removal of all the contents within!

Description

Removes a file or folder.

URL structure

https://api.fortnox.se/3/archive/{Id}

https://api.fortnox.se/3/archive?path={directory}

Method

DELETE

Version

3

Request

The request body should be empty.

Response

The response body should be empty.

Fields

File

Field Description Limits Type Searchable Sortable Required R/W
Url Direct URL to the record String R
Comments Comments String R
Id Id of the file String R
Name Name of the file String R
Path Path to the file String Yes R
Size Size(in bytes) of the file String R

Folder

Field Description Limits Type Searchable Sortable Required R/W
Url Direct URL to the record String R
Email Unique email for the folder String Yes R
Files List of files
Folders List of folders
Id Id of the folder String Yes R
Name Name of the folder String Yes Yes R/W