منو راهنمای برنامه نویسان API Parsaspace
C#.Net Java PHP Python Nodejs
مشاهده نسخه یک API

راهنمای برنامه نویسان پارسااسپیس (نسخه 2)

این راهنما برای برنامه نویسانی فراهم شده است که قصد دارند به صورت REST API و در قالب JSON از سرویس های پارسااسپیس بهره مند شوند.
توضیح کاملی از درخواست ها و پاسخ های دریافتی به همراه نمونه کد در زبان های مختلف در این راهنما مهیا شده است که به راحتی می توانید با کپی کردن نمونه کد و گنجاندن در برنامه خود از آن بهره مند شوید.
دقت داشته باشید که تمام پارامترهایی که در نمونه کد مقداردهی شده اند تستی می باشند، که باید با مقدار واقعی توسط شما مقداردهی شوند.

احراز هویت

تمامی درخواست ها از طریق TOKEN ارسالی در هر درخواست اعتبارسنجی خواهند شد.
دقت داشته باشید که در تمامی درخواست می بایست مقدار TOKEN دریافتی از قسمت [ورود و دریافت توکن] را در قسمت Header به صورت Bearer TOKEN ارسال نمائید.

Authorization: Bearer yourtoken

ورود و دریافت توکن


var client = new RestClient("https://api.parsaspace.com/v2/user/login");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("username", "your username");
request.AddParameter("password", "your password");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.parsaspace.com/v2/user/login',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'username=your username&password=your password',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/x-www-form-urlencoded'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

import requests
url = "https://api.parsaspace.com/v2/user/login"
payload='username=your username&password=your password'
headers = {
  'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Unirest.setTimeouts(0, 0);
HttpResponse response = Unirest.post("https://api.parsaspace.com/v2/user/login")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .field("username", "your username")
  .field("password", "your password")
  .asString();


var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.parsaspace.com/v2/user/login',
  'headers': {
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  form: {
    'username': 'your username',
    'password': 'your password'
  }};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

خروجی دستورات بالا JSON به شکل زیر می باشد:


{
    "result": "success", /*success or error*/
    "message": "message of success or error operation", 
    "token": "" /*filled when the result is success*/
}

این آدرس جهت دریافت TOKEN می باشد.
که TOKEN دریافت شده باید در تمامی درخواست ها در قسمت Header به صورت Bearer TOKEN ارسال شود.

HTTP Request

POST https://api.parsaspace.com/v2/user/login

Body Parameters

Parameter Type R/O Default Description
username string required null Your username in Parsaspace
password string required null Your password in Parsaspace

دریافت توکن جدید


var client = new RestClient("https://api.parsaspace.com/v2/user/login/refresh");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("username", "your username");
request.AddParameter("password", "your password");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.parsaspace.com/v2/user/login/refresh',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'username=your username&password=your password',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/x-www-form-urlencoded'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

import requests
url = "https://api.parsaspace.com/v2/user/login/refresh"
payload='username=your username&password=your password'
headers = {
  'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Unirest.setTimeouts(0, 0);
HttpResponse response = Unirest.post("https://api.parsaspace.com/v2/user/login/refresh")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .field("username", "your username")
  .field("password", "your password")
  .asString();


var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.parsaspace.com/v2/user/login/refresh',
  'headers': {
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  form: {
    'username': 'your username',
    'password': 'your password'
  }};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

خروجی دستورات بالا JSON به شکل زیر می باشد:


{
    "result": "success", /*success or error*/
    "message": "message of success or error operation", 
    "token": "" /*filled when the result is success*/
}

این آدرس جهت تغییر TOKEN موجود و دریافت TOKEN جدید می باشد.
برای مواردی که نیاز دارید TOKEN که در حال حاضر کار می کند را از دسترس خارج کنید.

HTTP Request

POST https://api.parsaspace.com/v2/user/login/refresh

Body Parameters

Parameter Type R/O Default Description
username string required null Your username in Parsaspace
password string required null Your password in Parsaspace

اطلاعات کاربری

اطلاعات حساب کاربری


var client = new RestClient("https://api.parsaspace.com/v2/user/info");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer yourtoken");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.parsaspace.com/v2/user/info',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer yourtoken'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

import requests
url = "https://api.parsaspace.com/v2/user/info"
payload={}
headers = {
  'Authorization': 'Bearer yourtoken'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Unirest.setTimeouts(0, 0);
HttpResponse response = Unirest.post("https://api.parsaspace.com/v2/user/info")
  .header("Authorization", "Bearer yourtoken")
  .asString();

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.parsaspace.com/v2/user/info',
  'headers': {
    'Authorization': 'Bearer yourtoken'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

خروجی دستورات بالا JSON به شکل زیر می باشد:


{
    "result": "success", /*success or error*/
    "message": "message of success or error operation", 
    "info": {   /*filled when the result is success*/
            "UserName": "your username",
            "Email": "your email",
            "Balance": 0, /*rial currency*/
            "Mobile": "0912*******",
            "MobileConfirmed": 0, /*1 confirmed, 0 not confirmed*/
            "ReferLink": "your referral link",
            "RegisterDate": "2021-01-02T12:38:07.117",
            "LastLoginDate": null,
            "LastLoginIP": null,
            "State":  0, /*1 active, 0 not active*/
            "TwoStep":  0, /*1 enable, 0 disable*/
            "UsedStorage": 0, /*byte unit*/
            "DownloadPlan": {
                "Storage": 0, /*byte unit*/
                "ExpireDate": null,
                "UsedStorage": 0,  /*byte unit*/
                "ReservePlan":  {
                        "Price" : 0 , /*rial currency*/
                        "Rundate" : "2021-01-02T12:38:07.117" ,/*end of day on this date*/
                        "Storage" : 0 /*byte unit*/
                        "Period": 0 /*the monthly service period*/
                    }
            },
            "BackupPlan": {
                "Storage": 0, /*byte unit*/
                "ExpireDate": null,
                "UsedStorage": 0, /*byte unit*/
                "ReservePlan": {
                        "Price" : 0 , /*rial currency*/
                        "Rundate" : "2021-01-02T12:38:07.117" , /*end of day on this date*/
                        "Storage" : 0 /*byte unit*/
                        "Period": 0 /*the monthly service period*/
                    }
            },
            "Websites": [
                {
                    "Domain": "your domain name",
                    "CreatedAt": "2021-01-02T13:36:36.86",
                    "UsedStorage": 0, /*byte unit*/
                    "DNS": 0,  /*1 set, 0 wating for dns change*/
                    "State": "active" /*the values it may have is active,new,expired,error*/
                }
            ]
        }
}

این آدرس اطلاعات حساب کاربری را بر می گرداند.

HTTP Request

POST https://api.parsaspace.com/v2/user/info

Body Parameters

Parameter Type R/O Default Description

مدیریت وب سایت

در این قسمت، تمامی امکانات مدیریت وب سایت از قبیل ایجاد، اطلاعات وب سایت، گزارش ترافیک و ... فراهم شده است.

لیست سرورها


var client = new RestClient("https://api.parsaspace.com/v2/website/servers");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer  yourtoken");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.parsaspace.com/v2/website/servers',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer  yourtoken'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

import requests
url = "https://api.parsaspace.com/v2/website/servers"
payload={}
headers = {
  'Authorization': 'Bearer  yourtoken'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Unirest.setTimeouts(0, 0);
HttpResponse response = Unirest.post("https://api.parsaspace.com/v2/website/servers")
  .header("Authorization", "Bearer  yourtoken")
  .asString();


var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.parsaspace.com/v2/website/servers',
  'headers': {
    'Authorization': 'Bearer  yourtoken'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

خروجی دستورات بالا JSON به شکل زیر می باشد:


{
"result": "success", /*success or error*/
"message": "message of success or error operation", 
"list": [ /*filled when the result is success*/
     {
        Id = 1 , 
        Name= "server name"
     },
     {
        Id = 2 , 
        Name= "server name"
     },
  ]
}

این آدرس لیست تمامی سرورهایی که میتوانید برروی آنها وب سایت ایجاد نمائید، را بر می گرداند.

HTTP Request

POST https://api.parsaspace.com/v2/website/servers

Body Parameters

Parameter Type R/O Default Description

ایجاد وب سایت


var client = new RestClient("https://api.parsaspace.com/v2/website/create");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer  yourtoken");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("domain", "new domain name");
request.AddParameter("server", "server id");
request.AddParameter("service", "service type");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.parsaspace.com/v2/website/create',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'domain=new domain name&server=server id&service=service type',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer  yourtoken',
    'Content-Type: application/x-www-form-urlencoded'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

import requests
url = "https://api.parsaspace.com/v2/website/create"
payload='domain=new domain name&server=server id&service=service type'
headers = {
  'Authorization': 'Bearer  yourtoken',
  'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Unirest.setTimeouts(0, 0);
HttpResponse response = Unirest.post("https://api.parsaspace.com/v2/website/create")
  .header("Authorization", "Bearer  yourtoken")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .field("domain", "new domain name")
  .field("server", "server id")
  .field("service", "service type")
  .asString();


var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.parsaspace.com/v2/website/create',
  'headers': {
    'Authorization': 'Bearer  yourtoken',
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  form: {
    'domain': 'new domain name',
    'server': 'server id',
    'service': 'service type'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

خروجی دستورات بالا JSON به شکل زیر می باشد:


{
   "result": "success", /*success or error*/
   "message": "message of success or error operation" 
}

این آدرس برای ایجاد وب سایت جدید می باشد.

HTTP Request

POST https://api.parsaspace.com/v2/website/create

Body Parameters

Parameter Type R/O Default Description
domain string required null your new domain name
server int required null The id of the server has obtained from the list of servers
service int required null Type of service (1 download, 2 backup)

اطلاعات وب سایت


var client = new RestClient("https://api.parsaspace.com/v2/website/info");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer  yourtoken");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("domain", "your domain");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.parsaspace.com/v2/website/info',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'domain=your domain',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer  yourtoken',
    'Content-Type: application/x-www-form-urlencoded'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

import requests
url = "https://api.parsaspace.com/v2/website/info"
payload='domain=your domain'
headers = {
  'Authorization': 'Bearer  yourtoken',
  'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)


Unirest.setTimeouts(0, 0);
HttpResponse response = Unirest.post("https://api.parsaspace.com/v2/website/info")
  .header("Authorization", "Bearer  yourtoken")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .field("domain", "your domain")
  .asString();

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.parsaspace.com/v2/website/info',
  'headers': {
    'Authorization': 'Bearer  yourtoken',
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  form: {
    'domain': 'your domain'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

خروجی دستورات بالا JSON به شکل زیر می باشد:


{
  "result": "success", /*success or error*/
  "message": "message of success or error operation", 
  "info": {  /*filled when the result is success*/
            
        "Domain": "your domain",
        "CreatedAt": "2021-01-02T13:36:36.86",
        "DNS": 0, /*1 set, 0 wating for dns change*/
        "State": "active",  /*the values it may have is active,new,expired,error*/
        "ServiceType": "download", /*the values it may have is download,backup*/
        "UsedStorage": "0", /*byte unit*/
        "ServerName": "آسیاتک",
        "ServerAddress": "asiatech.parsaspace.com",
        "AutoIndex": 0, /*1 enable, 0 disable*/
        "TrafficReport":  0, /*1 enable, 0 disable*/
        "SSL": "custom", /*the values it may have is custom,free,disabled,failed,in proccess*/
        "BasicAuth": {
            "State":  0, /*1 enable, 0 disable*/
            "UserName": null, /*filled when the state is enable*/
            "Password": null /*filled when the state is enable*/
        },
        "IPRestrict": {
            "AllowIP": null,
            "DenyIP": null,
            "AllowCommentIP": null,
            "DenyCommentIP": null
        },
        "Satisfy": "all", /*the values it may have is all,any*/
        "FilePermissions": [
            {
                "Key": "FTPDelete",
                "State": 0, /*1 allowed, 0 not allowed*/
            },
            {
                "Key": "FTPOverwrite",
                 "State": 0, /*1 allowed, 0 not allowed*/
            },
            {
                "Key": "FileManagerDelete",
                 "State": 0, /*1 allowed, 0 not allowed*/
            },
            {
                "Key": "FileManagerOverwrite",
                "State": 0, /*1 allowed, 0 not allowed*/
            },
            {
                "Key": "APIDelete",
                "State": 0, /*1 allowed, 0 not allowed*/
            },
            {
                "Key": "APIOverwrite",
                 "State": 0, /*1 allowed, 0 not allowed*/
            },
            {
                "Key": "RemoteUploadOverwrite",
                 "State": 0, /*1 allowed, 0 not allowed*/
            }
        ]
    }     
}

آین آدرس برای دریافت اطلاعات وب سایت می باشد.

HTTP Request

POST https://api.parsaspace.com/v2/website/info

Body Parameters

Parameter Type R/O Default Description
domain string required null Your domain name in Parsaspace

اطلاعات FTP


var client = new RestClient("https://api.parsaspace.com/v2/website/ftp/info");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer  yourtoken");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("domain", "your domain");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.parsaspace.com/v2/website/ftp/info',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'domain=your domain',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer  yourtoken',
    'Content-Type: application/x-www-form-urlencoded'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

import requests
url = "https://api.parsaspace.com/v2/website/ftp/info"
payload='domain=your domain'
headers = {
  'Authorization': 'Bearer  yourtoken',
  'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Unirest.setTimeouts(0, 0);
HttpResponse response = Unirest.post("https://api.parsaspace.com/v2/website/ftp/info")
  .header("Authorization", "Bearer  yourtoken")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .field("domain", "your domain")
  .asString();

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.parsaspace.com/v2/website/ftp/info',
  'headers': {
    'Authorization': 'Bearer  yourtoken',
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  form: {
    'domain': 'your domain'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

خروجی دستورات بالا JSON به شکل زیر می باشد:


{
    "result": "success", /*success or error*/
    "message": "message of success or error operation",
    "info": {  /*filled when the result is success*/
        "UserName": "your domain",
        "Password": "**********",
        "Port": 21,
        "Server": "your domain server name",
        "IPLimit": [
            "ip1",
            "ip2",
        ]
     }
}

آین آدرس برای دریافت اطلاعات FTP وب سایت می باشد.

HTTP Request

POST https://api.parsaspace.com/v2/website/ftp/info

Body Parameters

Parameter Type R/O Default Description
domain string required null Your domain name in Parsaspace

محدودیت IP برروی FTP


var client = new RestClient("https://api.parsaspace.com/v2/website/ftp/ip-limit");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer  yourtoken");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("domain", "your domain");
request.AddParameter("ip", "ip1,ip2,...");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.parsaspace.com/v2/website/ftp/ip-limit',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'domain=your domain&ip=ip1,ip2,...',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer  yourtoken',
    'Content-Type: application/x-www-form-urlencoded'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

import requests
url = "https://api.parsaspace.com/v2/website/ftp/ip-limit"
payload='domain=your domain&ip=ip1,ip2,...'
headers = {
  'Authorization': 'Bearer  yourtoken',
  'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Unirest.setTimeouts(0, 0);
HttpResponse response = Unirest.post("https://api.parsaspace.com/v2/website/ftp/ip-limit")
  .header("Authorization", "Bearer  yourtoken")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .field("domain", "your domain")
  .field("ip", "ip1,ip2,...")
  .asString();

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.parsaspace.com/v2/website/ftp/ip-limit',
  'headers': {
    'Authorization': 'Bearer  yourtoken',
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  form: {
    'domain': 'your domain',
    'ip': 'ip1,ip2,...'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

خروجی دستورات بالا JSON به شکل زیر می باشد:


{
    "result": "success", /*success or error*/
    "message": "message of success or error operation"
}

این آدرس برای اعمال محدودیت IP برروی FTP می باشد.

HTTP Request

POST https://api.parsaspace.com/v2/website/ftp/ip-limit

Body Parameters

Parameter Type R/O Default Description
domain string required null Your domain name in Parsaspace
ip string required null IP addresses allowed to access (Separate multiple IPs with comma)

تغییر رمزعبور FTP


var client = new RestClient("https://api.parsaspace.com/v2/website/ftp/change-password");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer  yourtoken");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("domain", "your domain");
request.AddParameter("password", "password");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.parsaspace.com/v2/website/ftp/change-password',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'domain=your domain&password=your password',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer  yourtoken',
    'Content-Type: application/x-www-form-urlencoded'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

import requests
url = "https://api.parsaspace.com/v2/website/ftp/change-password"
payload='domain=your domain&password=password'
headers = {
  'Authorization': 'Bearer  yourtoken',
  'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Unirest.setTimeouts(0, 0);
HttpResponse response = Unirest.post("https://api.parsaspace.com/v2/website/ftp/change-password")
  .header("Authorization", "Bearer  yourtoken")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .field("domain", "your domain")
  .field("password", "password")
  .asString(); 

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.parsaspace.com/v2/website/ftp/change-password',
  'headers': {
    'Authorization': 'Bearer  yourtoken',
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  form: {
    'domain': 'your domain',
    'password': 'password'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

خروجی دستورات بالا JSON به شکل زیر می باشد:


{
    "result": "success", /*success or error*/
    "message": "message of success or error operation"
}

این آدرس برای تغییر رمز عبور FTP می باشد.

HTTP Request

POST https://api.parsaspace.com/v2/website/ftp/change-password

Body Parameters

Parameter Type R/O Default Description
domain string required null Your domain name in Parsaspace
password string required null New FTP password

فعال/غیرفعال سازی Auto Index


var client = new RestClient("https://api.parsaspace.com/v2/website/auto-index");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer  yourtoken");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("domain", "your domain");
request.AddParameter("stat", "0");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.parsaspace.com/v2/website/auto-index',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'domain=your domain&stat=0',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer  yourtoken',
    'Content-Type: application/x-www-form-urlencoded'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

import requests
url = "https://api.parsaspace.com/v2/website/auto-index"
payload='domain=your domain&stat=0'
headers = {
  'Authorization': 'Bearer  yourtoken',
  'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Unirest.setTimeouts(0, 0);
HttpResponse response = Unirest.post("https://api.parsaspace.com/v2/website/auto-index")
  .header("Authorization", "Bearer  yourtoken")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .field("domain", "your domain")
  .field("stat", "0")
  .asString();

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.parsaspace.com/v2/website/auto-index',
  'headers': {
    'Authorization': 'Bearer  yourtoken',
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  form: {
    'domain': 'your domain',
    'stat': '0'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
}); 

خروجی دستورات بالا JSON به شکل زیر می باشد:


{
    "result": "success", /*success or error*/
    "message": "message of success or error operation"
}

این آدرس برای فعال و غیرفعال کردن قابلیت Auto Index (Directory Index) وب سایت می باشد.

HTTP Request

POST https://api.parsaspace.com/v2/website/auto-index

Body Parameters

Parameter Type R/O Default Description
domain string required null Your domain name in Parsaspace
stat int required null Enable or disable status (0 disable, 1 enable)

فعال/غیرفعال سازی SSL


var client = new RestClient("https://api.parsaspace.com/v2/website/ssl");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer  yourtoken");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("domain", "your domain");
request.AddParameter("enable", "1");
request.AddParameter("iscustom", "0");
request.AddParameter("privatekey", "private key");
request.AddParameter("certificate", "certificate");
request.AddParameter("fullchain", "full chain");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.parsaspace.com/v2/website/ssl',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'domain=your domain&enable=0&iscustom=0&privatekey=private key&certificate=certificate&fullchain=fullchain',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer  yourtoken',
    'Content-Type: application/x-www-form-urlencoded'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

import requests
url = "https://api.parsaspace.com/v2/website/ssl"
payload='domain=your domain&enable=0&iscustom=0&privatekey=private key&certificate=certificate&fullchain=full chain'
headers = {
  'Authorization': 'Bearer  yourtoken',
  'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Unirest.setTimeouts(0, 0);
HttpResponse response = Unirest.post("https://api.parsaspace.com/v2/website/ssl")
  .header("Authorization", "Bearer  yourtoken")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .field("domain", "your domain")
  .field("enable", "0")
  .field("iscustom", "0")
  .field("privatekey", "private key")
  .field("certificate", "certificate")
  .field("fullchain", "full chain")
  .asString();

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.parsaspace.com/v2/website/ssl',
  'headers': {
    'Authorization': 'Bearer  yourtoken',
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  form: {
    'domain': 'your domain',
    'enable': '0',
    'iscustom': '0',
    'privatekey': 'private key',
    'certificate': 'certificate',
    'fullchain': 'full chain'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

خروجی دستورات بالا JSON به شکل زیر می باشد:


{
    "result": "success", /*success or error*/
    "message": "message of success or error operation"
}

این آدرس برای فعال کردن SSL رایگان یا شخصی برای وب سایت می باشد.

HTTP Request

POST https://api.parsaspace.com/v2/website/ssl

Body Parameters

Parameter Type R/O Default Description
domain string required null Your domain name in Parsaspace
enable int required null Specifies whether to enable or disable (0 disable, 1 enable)
iscustom int required null Specifies whether SSL is free or custom (0 free, 1 custom)
privatekey string required null Custom SSL private key (Required for custom SSL)
certificate string required null Custom SSL certificate (Required for custom SSL)
fullchain string required null Custom SSL chain (Required for custom SSL)

فعال/غیرفعال سازی گزارش ترافیک


var client = new RestClient("https://api.parsaspace.com/v2/website/traffic-report");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer  yourtoken");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("domain", "your domain");
request.AddParameter("stat", "0");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.parsaspace.com/v2/website/traffic-report',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'domain=your domain&stat=0',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer  yourtoken',
    'Content-Type: application/x-www-form-urlencoded'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

import requests
url = "https://api.parsaspace.com/v2/website/traffic-report"
payload='domain=your domain&stat=0'
headers = {
  'Authorization': 'Bearer  yourtoken',
  'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)


Unirest.setTimeouts(0, 0);
HttpResponse response = Unirest.post("https://api.parsaspace.com/v2/website/traffic-report")
  .header("Authorization", "Bearer  yourtoken")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .field("domain", "your domain")
  .field("stat", "0")
  .asString();

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.parsaspace.com/v2/website/traffic-report',
  'headers': {
    'Authorization': 'Bearer  yourtoken',
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  form: {
    'domain': 'your domain',
    'stat': '0'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

خروجی دستورات بالا JSON به شکل زیر می باشد:


{
    "result": "success", /*success or error*/
    "message": "message of success or error operation"
}

این آدرس برای فعال و غیرفعال کردن گزارش ترافیک حرفه ای وب سایت می باشد.

HTTP Request

POST https://api.parsaspace.com/v2/website/traffic-report

Body Parameters

Parameter Type R/O Default Description
domain string required null Your domain name in Parsaspace
stat int required null Enable or disable status (0 disable, 1 enable)

فعال/غیرفعال سازی Basic Authentication


var client = new RestClient("https://api.parsaspace.com/v2/website/basic-auth");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer  yourtoken");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("domain", "your domain");
request.AddParameter("stat", "0");
request.AddParameter("username", "username");
request.AddParameter("password", "password");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.parsaspace.com/v2/website/basic-auth',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'domain=your domain&stat=0&username=username&password=password',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer  yourtoken',
    'Content-Type: application/x-www-form-urlencoded'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

import requests
url = "https://api.parsaspace.com/v2/website/basic-auth"
payload='domain=your domain&stat=0&username=username&password=password'
headers = {
  'Authorization': 'Bearer  yourtoken',
  'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Unirest.setTimeouts(0, 0);
HttpResponse response = Unirest.post("https://api.parsaspace.com/v2/website/basic-auth")
  .header("Authorization", "Bearer  yourtoken")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .field("domain", "your domain")
  .field("stat", "0")
  .field("username", "username")
  .field("password", "password")
  .asString();

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.parsaspace.com/v2/website/basic-auth',
  'headers': {
    'Authorization': 'Bearer  yourtoken',
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  form: {
    'domain': 'your domain',
    'stat': '0',
    'username': 'username',
    'password': 'password'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

خروجی دستورات بالا JSON به شکل زیر می باشد:


{
    "result": "success", /*success or error*/
    "message": "message of success or error operation"
}

این آدرس برای فعال و غیرفعال کردن Basic Authentication وب سایت می باشد.

HTTP Request

POST https://api.parsaspace.com/v2/website/basic-auth

Body Parameters

Parameter Type R/O Default Description
domain string required null Your domain name in Parsaspace
stat int required null Enable or disable status (0 disable, 1 enable)
username string required null New username (Required for enabling stat)
password string required null New password (Required for enabling stat)

فعال/غیرفعال سازی IP Restriction


var client = new RestClient("https://api.parsaspace.com/v2/website/ip-restrict");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer  yourtoken");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("domain", "your domain");
request.AddParameter("allowip", "ip1,ip2,...");
request.AddParameter("denyip", "ip1,ip2,...");
request.AddParameter("allowcommentip", "ip1,ip2,...");
request.AddParameter("denycommentip", "ip1,ip2,...");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.parsaspace.com/v2/website/ip-restrict',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'domain=your domain&allowip=ip1,ip2,...&denyip=ip1,ip2,...&allowcommentip=ip1,ip2,...&denycommentip=ip1,ip2,...',  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer  yourtoken',
    'Content-Type: application/x-www-form-urlencoded'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

import requests
url = "https://api.parsaspace.com/v2/website/ip-restrict"
payload='domain=your domain&allowip=ip1,ip2,...&denyip=ip1,ip2,...&allowcommentip=ip1,ip2,...&denycommentip=ip1,ip2,...'
headers = {
  'Authorization': 'Bearer  yourtoken',
  'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Unirest.setTimeouts(0, 0);
HttpResponse response = Unirest.post("https://api.parsaspace.com/v2/website/ip-restrict")
  .header("Authorization", "Bearer  yourtoken")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .field("domain", "your domain")
  .field("allowip", "ip1,ip2,...")
  .field("denyip", "ip1,ip2,...")
  .field("allowcommentip", "ip1,ip2,...")
  .field("denycommentip", "ip1,ip2,...")
  .asString();

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.parsaspace.com/v2/website/ip-restrict',
  'headers': {
    'Authorization': 'Bearer  yourtoken',
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  form: {
    'domain': 'your domain',
    'allowip': 'ip1,ip2,...',
    'denyip': 'ip1,ip2,...',
    'allowcommentip': 'ip1,ip2,...',
    'denycommentip': 'ip1,ip2,...'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

خروجی دستورات بالا JSON به شکل زیر می باشد:


{
    "result": "success", /*success or error*/
    "message": "message of success or error operation"
}

این آدرس برای فعال کردن محدودسازی IP برای دسترسی به وب سایت موردنظر می باشد.

HTTP Request

POST https://api.parsaspace.com/v2/website/ip-restrict

Body Parameters

Parameter Type R/O Default Description
domain string required null Your domain name in Parsaspace
allowip string required null IPs allowed to access (separate IPs with comma (empty remove ip))
denyip string required null IPs not allowed to access (separate IPs with comma (empty remove ip))
allowcommentip string optional null These IPs have no effect. It is for history (separate IPs with comma (empty remove ip))
denycommentip string optional null These IPs have no effect. It is for history (separate IPs with comma (empty remove ip))

تنظیمات Satisfy


var client = new RestClient("https://api.parsaspace.com/v2/website/satisfy");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer  yourtoken");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("domain", "your domain");
request.AddParameter("satisfy", "all");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.parsaspace.com/v2/website/satisfy',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'domain=your domain&satisfy=all',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer  yourtoken',
    'Content-Type: application/x-www-form-urlencoded'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

import requests
url = "https://api.parsaspace.com/v2/website/satisfy"
payload='domain=your domain&satisfy=all'
headers = {
  'Authorization': 'Bearer  yourtoken',
  'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Unirest.setTimeouts(0, 0);
HttpResponse response = Unirest.post("https://api.parsaspace.com/v2/website/satisfy")
  .header("Authorization", "Bearer  yourtoken")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .field("domain", "your domain")
  .field("satisfy", "all")
  .asString();

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.parsaspace.com/v2/website/satisfy',
  'headers': {
    'Authorization': 'Bearer  yourtoken',
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  form: {
    'domain': 'your domain',
    'satisfy': 'all'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

خروجی دستورات بالا JSON به شکل زیر می باشد:


{
    "result": "success", /*success or error*/
    "message": "message of success or error operation"
}

این آدرس برای مشخص کردن اعمال محدودیت دسترسی به صورت حداقل یکی یا همه می باشد.
اگر satisfy را برروی all تنظیم کنید برای دسترسی به وب سایت می بایست هر دو محدودیت (Basic Authentication , IP Restriction) برقرار باشد.
اگر satisfy را برروی any تنظیم کنید برای دسترسی به وب سایت می بایست حداقل یکی از دو محدودیت (Basic Authentication , IP Restriction) برقرار باشد.

HTTP Request

POST https://api.parsaspace.com/v2/website/satisfy

Body Parameters

Parameter Type R/O Default Description
domain string required null Your domain name in Parsaspace
satisfy string required null Specifies the type of restriction (any, all)

تنظیمات دسترسی فایل


var client = new RestClient("https://api.parsaspace.com/v2/website/file-permission");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer  yourtoken");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("domain", "your domain");
request.AddParameter("ftpdelete", "0");
request.AddParameter("ftpoverwrite", "0");
request.AddParameter("apidelete", "0");
request.AddParameter("apioverwrite", "0");
request.AddParameter("filemanagerdelete", "0");
request.AddParameter("filemanageroverwrite", "0");
request.AddParameter("remoteuploadoverwrite", "0");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.parsaspace.com/v2/website/file-permission',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'domain=you domain&ftpdelete=0&ftpoverwrite=0&apidelete=0&apioverwrite=0&filemanagerdelete=0&filemanageroverwrite=0&remoteuploadoverwrite=0',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer  yourtoken',
    'Content-Type: application/x-www-form-urlencoded'
  ),
));

$response = curl_exec($curl);
curl_close($curl);
echo $response;

import requests
url = "https://api.parsaspace.com/v2/website/file-permission"
payload='domain=your domain&ftpdelete=0&ftpoverwrite=0&apidelete=0&apioverwrite=0&filemanagerdelete=0&filemanageroverwrite=0&remoteuploadoverwrite=0'
headers = {
  'Authorization': 'Bearer  yourtoken',
  'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Unirest.setTimeouts(0, 0);
HttpResponse response = Unirest.post("https://api.parsaspace.com/v2/website/file-permission")
  .header("Authorization", "Bearer  yourtoken")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .field("domain", "your domain")
  .field("ftpdelete", "0")
  .field("ftpoverwrite", "0")
  .field("apidelete", "0")
  .field("apioverwrite", "0")
  .field("filemanagerdelete", "0")
  .field("filemanageroverwrite", "0")
  .field("remoteuploadoverwrite", "0")
  .asString();

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.parsaspace.com/v2/website/file-permission',
  'headers': {
    'Authorization': 'Bearer  yourtoken',
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  form: {
    'domain': 'your domain',
    'ftpdelete': '0',
    'ftpoverwrite': '0',
    'apidelete': '0',
    'apioverwrite': '0',
    'filemanagerdelete': '0',
    'filemanageroverwrite': '0',
    'remoteuploadoverwrite': '0'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

خروجی دستورات بالا JSON به شکل زیر می باشد:


{
    "result": "success", /*success or error*/
    "message": "message of success or error operation"
}

این آدرس برای اعمال محدودیت های دسترسی به فایل وب سایت می باشد.
در محدودیت های Over Write در صورتی اجازه دادن محدودیت، فایل جدید جایگزین فایل موجود هم نام خواهد شد، در غیر اینصورت در صورت اجازه ندادن، فایل جدید با یک نام جدید (پسوند در انتهای نام فایل) آپلود خواهد شد.

HTTP Request

POST https://api.parsaspace.com/v2/website/file-permission

Body Parameters

Parameter Type R/O Default Description
domain string required null Your domain name in Parsaspace
ftpdelete int required 0 File deletion access via FTP (0 not allow, 1 allow)
ftpoverwrite int required 0 File replacement access if there is a similar file via FTP (0 not allow, 1 allow)
apidelete int required 0 File deletion access via API (0 not allow, 1 allow)
apioverwrite int required 0 File replacement access if there is a similar file via API (0 not allow, 1 allow)
filemanagerdelete int required 0 File deletion access via file manager (0 not allow, 1 allow)
filemanageroverwrite int required 0 File replacement access if there is a similar file via file manager (0 not allow, 1 allow)
remoteuploadoverwrite int required 0 File replacement access if there is a similar file via remote upload (0 not allow, 1 allow)

مدیریت فایل

لیست


var client = new RestClient("https://api.parsaspace.com/v2/files/list");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer yourtoken");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("Domain", "yourdomain");
IRestResponse response = client.Execute(request);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.parsaspace.com/v2/files/list',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'domain=your domain',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer yourtoken',
    'Content-Type: application/x-www-form-urlencoded'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

import requests
url = "https://api.parsaspace.com/v2/files/list"
payload='Domain=your domain '
headers = {
'Authorization': 'Bearer yourtoken',
'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Unirest.setTimeouts(0, 0);
HttpResponse
    response = Unirest.post("https://api.parsaspace.com/v2/files/list")
    .header("Authorization", "Bearer yourtoken")
    .header("Content-Type", "application/x-www-form-urlencoded")
    .field("Domain", "your domain ")
    .asString();

var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.parsaspace.com/v2/files/list',
'headers': {'Authorization': 'Bearer yourtoken','Content-Type': 'application/x-www-form-urlencoded'},
form: {'Domain': 'your domain'}};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});

خروجی دستورات بالا JSON به شکل زیر می باشد:


{
"result": "success", /*success or error*/
"message": "message of success or error operation", 
"list": [ /*filled when the result is success*/
    {
     "Name": "test.zip",
     "IsFolder": false,
     "Size": 173996,
     "LastModified": "2021-01-02T14:49:49.969274265+03:30"
    } 
  ]
}

این آدرس لیست تمامی فایل ها را بر می گرداند.

HTTP Request

POST https://api.parsaspace.com/v2/files/list

Body Parameters

Parameter Type R/O Default Description
domain string required null Your domain name in Parsaspace
path string optional /[root] The path to which the files are returned

آپلود


var client = new RestClient("https://api.parsaspace.com/v2/files/upload"); 
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer yourtoken");
request.AddParameter("Domain", "yourdomain");
request.AddParameter("path", "/");
request.AddFile("file", "your file path");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.parsaspace.com/v2/files/upload',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('domain' => 'your domain','path' => '/','file'=> new CURLFILE('test.jpeg')),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer yourtoken'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

import requests
url = "https://api.parsaspace.com/v2/files/upload"
payload={'Domain': 'yourdomain','path': '/'}
files=[
    ('file',('test.txt',open('your file path','rb'),'text/plain'))
]
headers = {
    'Authorization': 'Bearer yourtoken'
}
response = requests.request("POST", url, 
    headers=headers, data=payload, files=files)
print(response.text)

Unirest.setTimeouts(0, 0);
HttpResponse
    response = Unirest.post("https://api.parsaspace.com/v2/files/upload")
    .header("Authorization", "Bearer yourtoken")
    .field("Domain", "yourdomain")
    .field("path", "/")
    .field("file", new File("your file path"))
    .asString();


var request = require('request');
var fs = require('fs');
var options = {
    'method': 'POST',
    'url': 'https://api.parsaspace.com/v2/files/upload',
    'headers': {
    'Authorization': 'Bearer yourtoken'
},
formData: {
    'Domain': 'yourdomain',
    'path': '/',
    'file': {
    'value': fs.createReadStream('your file path'),
    'options': {
    'filename': 'your file path',
    'contentType': null
   }
  }
 }
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});

خروجی دستورات بالا JSON به شکل زیر می باشد:


{
  "result": "success", /*success or error*/
  "message": "message of success or error operation", 
  "downloadLink": "file download link" /*filled when the result is success*/
}

آین آدرس برای آپلود فایل می باشد.

HTTP Request

POST https://api.parsaspace.com/v2/files/upload

Body Parameters

Parameter Type R/O Default Description
domain string required null Your domain name in Parsaspace
file file required null Selected file to upload (form-data)
path string optional /[root] The path where the file is uploaded

آپلود مستقیم


var client = new RestClient("https://api.parsaspace.com/v2/auth/uploadtoken");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer yourtoken");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("domain", "yourdomain");
request.AddParameter("path", "/");
request.AddParameter("remoteip", "user ip");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.parsaspace.com/v2/auth/uploadtoken',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'domain=your domain&path=/&remoteip=user ip',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer yourtoken',
    'Content-Type: application/x-www-form-urlencoded'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

import requests
url = "https://api.parsaspace.com/v2/auth/uploadtoken"
payload='domain=yourdomain&path=/&remoteip=user ip'
headers = {
    'Authorization': 'Bearer yourtoken',
    'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Unirest.setTimeouts(0, 0);
HttpResponse
    response = Unirest.post("https://api.parsaspace.com/v2/auth/uploadtoken")
    .header("Authorization", "Bearer yourtoken")
    .header("Content-Type", "application/x-www-form-urlencoded")
    .field("domain", "yourdomain")
    .field("path", "/")
    .field("remoteip", "user ip")
    .asString();

var request = require('request');
var options = {
    'method': 'POST',
    'url': 'https://api.parsaspace.com/v2/auth/uploadtoken',
    'headers': {
    'Authorization': 'Bearer yourtoken',
    'Content-Type': 'application/x-www-form-urlencoded'
    },
form: {
    'domain': 'yourdomain',
    'path': '/',
    'remoteip': 'user ip'
}};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});

خروجی دستورات بالا JSON به شکل زیر می باشد:


{
    "result": "success", /*success or error*/
    "message": "message of success or error operation",
    "token": "direct token", /*filled when the result is success*/
    "url": "direct link" /*filled when the result is success*/
}

پس از دریافت url و token از دستورات بالا می توانید به صورت زیر فایل های خود را ارسال نمائید:


<form action="url" enctype="multipart/form-data" method="post">
    <input type="hidden" name="token" value="token">
    <input type="file" name="file">
</form>

آپلود فایل به طور مستقیم در مسیر دلخواه.
با استفاده از این قابلیت می توانید فایل های خود را به طور مستقیم روی مسیر مورد نظر آپلود کنید، برای مثال اگر کاربران شما، ابتدا فایل خود را روی سایت شما آپلود می کنند و سپس شما فایل مورد نظر را روی پارسااسپیس آپلود می کنید، به جای این کار می توانید درخواست آپلود فایل کاربران را به طور مستقیم به پارسااسپیس ارسال کنید. برای این کار ابتدا باید از متد زیر token جهت آپلود فایل و آدرس url جهت ارسال فایل دریافت نمائید، سپس فایل مورد نظر خود را از طریق token دریافتی به url دریافت شده ارسال کنید.

HTTP Request

POST https://api.parsaspace.com/v2/auth/uploadtoken

Body Parameters

Parameter Type R/O Default Description
domain string required null Your domain name in Parsaspace
remoteip file required null User IP address
path string optional /[root] The path where the file is uploaded

ایجاد پوشه جدید


var client = new RestClient("https://api.parsaspace.com/v2/files/createfolder");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer yourtoken");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("domain", "yourdomain");
request.AddParameter("path", "/");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.parsaspace.com/v2/files/createfolder',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'domain=your domain&path=/',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer yourtoken',
    'Content-Type: application/x-www-form-urlencoded'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

import requests
url = "https://api.parsaspace.com/v2/files/createfolder"
payload='domain=yourdomain&path=/'
headers = {
    'Authorization': 'Bearer yourtoken',
    'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Unirest.setTimeouts(0, 0);
HttpResponse
    response = Unirest.post("https://api.parsaspace.com/v2/files/createfolder")
    .header("Authorization", "Bearer yourtoken")
    .header("Content-Type", "application/x-www-form-urlencoded")
    .field("domain", "yourdomain")
    .field("path", "/")
    .asString();

var request = require('request');
var options = {
    'method': 'POST',
    'url': 'https://api.parsaspace.com/v2/files/createfolder',
    'headers': {
    'Authorization': 'Bearer yourtoken',
    'Content-Type': 'application/x-www-form-urlencoded'
},
form: {
    'domain': 'yourdomain',
    'path': '/'
}};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});

خروجی دستورات بالا JSON به شکل زیر می باشد:


{
    "result": "success", /*success or error*/
    "message": "message of success or error operation"
}

این آدرس برای ایجاد پوشه می باشد.

HTTP Request

POST https://api.parsaspace.com/v2/files/createfolder

Body Parameters

Parameter Type R/O Default Description
domain string required null Your domain name in Parsaspace
path string optional /[root] The path in which the folder is created

حذف فایل/پوشه


var client = new RestClient("https://api.parsaspace.com/v2/files/remove");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer yourtoken");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("Domain", "yourdomain");
request.AddParameter("path", "/test");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.parsaspace.com/v2/files/remove',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'domain=your domain&path=/test.jpg',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer yourtoken',
    'Content-Type: application/x-www-form-urlencoded'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

    import requests
    url = "https://api.parsaspace.com/v2/files/remove"
    payload='domain=yourdomain&path=/test'
    headers = {
        'Authorization': 'Bearer yourtoken',
        'Content-Type': 'application/x-www-form-urlencoded'
    }
    response = requests.request("POST", url, headers=headers, data=payload)
    print(response.text)

Unirest.setTimeouts(0, 0);
HttpResponse
    response = Unirest.post("https://api.parsaspace.com/v2/files/remove")
    .header("Authorization", "Bearer yourtoken")
    .header("Content-Type", "application/x-www-form-urlencoded")
    .field("domain", "yourdomain")
    .field("path", "/test")
    .asString();


var request = require('request');
var options = {
    'method': 'POST',
    'url': 'https://api.parsaspace.com/v2/files/remove',
    'headers': {
    'Authorization': 'Bearer yourtoken',
    'Content-Type': 'application/x-www-form-urlencoded'
},
form: {
    'domain': 'yourdomain',
    'path': '/test'
}};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});

خروجی دستورات بالا JSON به شکل زیر می باشد:


{
    "result": "success", /*success or error*/
    "message": "message of success or error operation"
}

این آدرس برای حذف فایل یا پوشه می باشد.

HTTP Request

POST https://api.parsaspace.com/v2/files/remove

Body Parameters

Parameter Type R/O Default Description
domain string required null Your domain name in Parsaspace
path string optional /[root] The Path you want to delete (Separate multiple paths with comma)

تغییر نام


var client = new RestClient("https://api.parsaspace.com/v2/files/rename");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer yourtoken");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("domain", "yourdomain");
request.AddParameter("source", "/test.zip");
request.AddParameter("destination", "/test1.zip");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.parsaspace.com/v2/files/rename',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'domain=your domain&source=/test.rar&destination=/test2.rar',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer yourtoken',
    'Content-Type: application/x-www-form-urlencoded'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

import requests
url = "https://api.parsaspace.com/v2/files/rename"
payload='domain=yourdomain&source=/test.zip&destination=/test1.zip'
headers = {
    'Authorization': 'Bearer yourtoken',
    'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Unirest.setTimeouts(0, 0);
HttpResponse
    response = Unirest.post("https://api.parsaspace.com/v2/files/rename")
    .header("Authorization", "Bearer yourtoken")
    .header("Content-Type", "application/x-www-form-urlencoded")
    .field("domain", "yourdomain")
    .field("source", "/test.zip")
    .field("destination", "/test1.zip")
    .asString();

var request = require('request');
var options = {
    'method': 'POST',
    'url': 'https://api.parsaspace.com/v2/files/rename',
    'headers': {
    'Authorization': 'Bearer yourtoken',
    'Content-Type': 'application/x-www-form-urlencoded'
},
form: {
    'domain': 'yourdomain',
    'source': '/test.zip',
    'destination': '/test1.zip'
}};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});

خروجی دستورات بالا JSON به شکل زیر می باشد:


{
    "result": "success", /*success or error*/
    "message": "message of success or error operation"
}

این آدرس برای تغییر نام فایل یا پوشه می باشد.

HTTP Request

POST https://api.parsaspace.com/v2/files/rename

Body Parameters

Parameter Type R/O Default Description
domain string required null Your domain name in Parsaspace
source string required null Source file path
destination string required null Destination file path

انتقال


var client = new RestClient("https://api.parsaspace.com/v2/files/move");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer yourtoken");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("domain", "yourdomain");
request.AddParameter("source", "/test.rar");
request.AddParameter("destination", "/newfolder/test.rar");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.parsaspace.com/v2/files/move',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'domain=your domain&source=/test.rar&destination=/newfolder/test.rar',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer yourtoken',
    'Content-Type: application/x-www-form-urlencoded'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

import requests
url = "https://api.parsaspace.com/v2/files/move"
payload='domain=yourdomain&source=/test.rar&destination=/newfolder/test.rar'
headers = {
  'Authorization': 'Bearer yourtoken',
  'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Unirest.setTimeouts(0, 0);
HttpResponse
    response = Unirest.post("https://api.parsaspace.com/v2/files/move")
    .header("Authorization", "Bearer yourtoken")
    .header("Content-Type", "application/x-www-form-urlencoded")
    .field("domain", "yourdomain")
    .field("source", "/test.rar")
    .field("destination", "/newfolder/test.rar")
    .asString();

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.parsaspace.com/v2/files/move',
  'headers': {
    'Authorization': 'Bearer yourtoken',
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  form: {
    'domain': 'yourdomain',
    'source': '/test.rar',
    'destination': '/newfolder/test.rar'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

خروجی دستورات بالا JSON به شکل زیر می باشد:


{
    "result": "success", /*success or error*/
    "message": "message of success or error operation"
}

این آدرس برای انتقال فایل یا پوشه می باشد.

HTTP Request

POST https://api.parsaspace.com/v2/files/move

Body Parameters

Parameter Type R/O Default Description
domain string required null Your domain name in Parsaspace
source string required null Source file path (Separate multiple paths with comma)
destination string required null Destination file path

کپی


var client = new RestClient("https://api.parsaspace.com/v2/files/copy");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer yourtoken");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("domain", "yourdomain");
request.AddParameter("source", "/test.rar");
request.AddParameter("destination", "/test");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.parsaspace.com/v2/files/copy',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'domain=your domain&source=/test.rar&destination=/test',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer yourtoken',
    'Content-Type: application/x-www-form-urlencoded'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

import requests
url = "https://api.parsaspace.com/v2/files/copy"
payload='domain=yourdomain&source=/test.rar&destination=/test'
headers = {
  'Authorization': 'Bearer yourtoken',
  'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Unirest.setTimeouts(0, 0);
HttpResponse response = Unirest.post("https://api.parsaspace.com/v2/files/copy")
  .header("Authorization", "Bearer yourtoken")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .field("domain", "yourdomain")
  .field("source", "/test.rar")
  .field("destination", "/test")
  .asString();


var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.parsaspace.com/v2/files/copy',
  'headers': {
    'Authorization': 'Bearer yourtoken',
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  form: {
    'domain': 'yourdomain',
    'source': '/test.rar',
    'destination': '/test'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

خروجی دستورات بالا JSON به شکل زیر می باشد:


{
    "result": "success", /*success or error*/
    "message": "message of success or error operation"
}

این آدرس برای کپی فایل یا پوشه می باشد.

HTTP Request

POST https://api.parsaspace.com/v2/files/copy

Body Parameters

Parameter Type R/O Default Description
domain string required null Your domain name in Parsaspace
source string required null Source file path (Separate multiple paths with comma)
destination string required null Destination file path

ریموت آپلود


var client = new RestClient("https://api.parsaspace.com/v2/remote/new");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer yourtoken");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("domain", "yourdomain");
request.AddParameter("path", "/test");
request.AddParameter("url", "downloadlink1,downloadlink2");
request.AddParameter("filename", "name1,name2");
request.AddParameter("checkid", "123456");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.parsaspace.com/v2/remote/new',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'domain=your domain&path=/test&url=downloadlink1,downloadlink2&filename=name1,name2&checkid=123456',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer yourtoken',
    'Content-Type: application/x-www-form-urlencoded'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

import requests
url = "https://api.parsaspace.com/v2/remote/new"
payload='domain=yourdomain&path=/test&url=downloadlink1,downloadlink2&filename=name1,name2&checkid=123456'
headers = {
  'Authorization': 'Bearer yourtoken',
  'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Unirest.setTimeouts(0, 0);
HttpResponse response = Unirest.post("https://api.parsaspace.com/v2/remote/new")
  .header("Authorization", "Bearer yourtoken")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .field("domain", "yourdomain")
  .field("path", "/test")
  .field("url", "downloadlink1,downloadlink2")
  .field("filename", "name1,name2")
  .field("checkid", "123456")
  .asString(); 

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.parsaspace.com/v2/remote/new',
  'headers': {
    'Authorization': 'Bearer yourtoken',
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  form: {
    'domain': 'yourdomain',
    'path': '/test',
    'url': 'downloadlink1,downloadlink2',
    'filename': 'name1,name2',
    'checkid': '123456'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

خروجی دستورات بالا JSON به شکل زیر می باشد:


{
    "result": "success", /*success or error*/
    "message": "message of success or error operation"
}

این آدرس برای ریموت آپلود فایل می باشد.

HTTP Request

POST https://api.parsaspace.com/v2/remote/new

Body Parameters

Parameter Type R/O Default Description
domain string required null Your domain name in Parsaspace
url string required null Download files link (Separate different link with comma - max 100 link)
path string optional /[root] The path where the file is uploaded
filename string optional null New name of download files (Separate different link with comma - empty the ignored rename)
checkid int optional 0 Will be used for reporting

وضعیت ریموت آپلود


var client = new RestClient("https://api.parsaspace.com/v2/remote/status");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer yourtoken");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("domain", "yourdomain");
request.AddParameter("checkid", "123456");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.parsaspace.com/v2/remote/status',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'domain=your domain&checkid=123456',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer yourtoken',
    'Content-Type: application/x-www-form-urlencoded'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;


import requests
url = "https://api.parsaspace.com/v2/remote/status"
payload='domain=yourdomain&checkid=123456'
headers = {
  'Authorization': 'Bearer yourtoken',
  'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Unirest.setTimeouts(0, 0);
HttpResponse response = Unirest.post("https://api.parsaspace.com/v2/remote/status")
  .header("Authorization", "Bearer yourtoken")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .field("domain", "yourdomain")
  .field("checkid", "123456")
  .asString();

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.parsaspace.com/v2/remote/status',
  'headers': {
    'Authorization': 'Bearer yourtoken',
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  form: {
    'domain': 'yourdomain',
    'checkid': '123456'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

خروجی دستورات بالا JSON به شکل زیر می باشد:


{
    "result": "success", /*success or error*/
    "message": "message of success or error operation",
    "list": [ /*filled when the result is success*/
        {
            "Url": "downloadlink1",
            "Status": "InvalidUrl",
            "FileName": null,
            "DownloadSize": 0
        } 
    ]
}

این آدرس برای گرفتن وضعیت ریموت آپلود فایل می باشد.

HTTP Request

POST https://api.parsaspace.com/v2/remote/status

Body Parameters

Parameter Type R/O Default Description
domain string required null Your domain name in Parsaspace
checkid int required 0 Will be used for reporting

توضیحات تکمیلی

در این قسمت توضیحات تکمیلی برای آشنایی بیشتر با ورودی و خروجی ها (Request, Response) آورده شده است که جهت سهولت کار و ارتباط ساده تر و سریع تر می بایست مطالعه شود.

خطاها

API پارسااسپیس از کدهای خطای زیر استفاد می کند:

Code Meaning
401 Unauthorized -- Your Token is wrong.
404 Not Found -- The specified resource could not be found.
429 Too Many Requests -- You're requesting too many kittens! Slow down!
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.