X

Upload a file

Upload a file to your secure file transfer area.


[POST] https://api-eu1.stannp.com/v1/files/upload

Parameters

file string This value can be either a binary file or a URL to a file.
folder int A folder ID for placing the file in a folder.

Request

                using RestSharp;

var client = new RestClient("https://api-eu1.stannp.com/v1/files/upload?api_key={API_KEY}");
var request = new RestRequest(Method.POST);

request.AddParameter("file", "https://www.stannp.com/assets/samples/letter-heading.webp");
request.AddParameter("folder", "0");


IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
            

Response

{
    "success": true,
    "data": {
        "id": "342"
    }
}

Create a folder

Create a folder in your secure file transfer area.


[POST] https://api-eu1.stannp.com/v1/files/createFolder

Parameters

name string The name of the folder you wish to create.

Request

                using RestSharp;

var client = new RestClient("https://api-eu1.stannp.com/v1/files/createFolder?api_key={API_KEY}");
var request = new RestRequest(Method.POST);

request.AddParameter("name", "Test Folder");


IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
            

Response

{
    "success": true,
    "data": "342"
}

List folders

Get a list of the folders in your secure file transfer area.


[GET] https://api-eu1.stannp.com/v1/files/folders

Request

                using RestSharp;

var client = new RestClient("https://api-eu1.stannp.com/v1/files/folders?api_key={API_KEY}");
var request = new RestRequest(Method.GET);

IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
            

Response

{
    "success": true,
    "data": [
        {
            "id": "2",
            "name": "test folder",
            "created": "2017-06-27 14:24:07"
        },
        {
            "id": "15",
            "name": "test folder 2",
            "created": "2017-06-27 14:26:23"
        }
    ]
}