cURL
curl --request PATCH \
--url https://api.camposcloud.com/v1/apps/{appId}/files/move \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filePath": [
"src/a.js",
"src/b.js"
],
"pathTarget": "lib"
}
'import requests
url = "https://api.camposcloud.com/v1/apps/{appId}/files/move"
payload = {
"filePath": ["src/a.js", "src/b.js"],
"pathTarget": "lib"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({filePath: ['src/a.js', 'src/b.js'], pathTarget: 'lib'})
};
fetch('https://api.camposcloud.com/v1/apps/{appId}/files/move', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.camposcloud.com/v1/apps/{appId}/files/move",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'filePath' => [
'src/a.js',
'src/b.js'
],
'pathTarget' => 'lib'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.camposcloud.com/v1/apps/{appId}/files/move"
payload := strings.NewReader("{\n \"filePath\": [\n \"src/a.js\",\n \"src/b.js\"\n ],\n \"pathTarget\": \"lib\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.camposcloud.com/v1/apps/{appId}/files/move")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filePath\": [\n \"src/a.js\",\n \"src/b.js\"\n ],\n \"pathTarget\": \"lib\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.camposcloud.com/v1/apps/{appId}/files/move")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filePath\": [\n \"src/a.js\",\n \"src/b.js\"\n ],\n \"pathTarget\": \"lib\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Files moved successfully"
}{
"error": "'filePath' must be a non-empty array of strings."
}{
"error": "Invalid developer token"
}{
"error": "You do not have permission to perform this action on this application."
}{
"error": "Application not found or you do not have permission to access it."
}{
"error": "File upload limit reached, please try again later"
}{
"error": "Error from worker: Failed to move file 'src/a.js': ENOENT: no such file or directory"
}File System
/v1/apps/{appId}/files/move
This endpoint moves files or directories of an application into another directory.
PATCH
/
v1
/
apps
/
{appId}
/
files
/
move
cURL
curl --request PATCH \
--url https://api.camposcloud.com/v1/apps/{appId}/files/move \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filePath": [
"src/a.js",
"src/b.js"
],
"pathTarget": "lib"
}
'import requests
url = "https://api.camposcloud.com/v1/apps/{appId}/files/move"
payload = {
"filePath": ["src/a.js", "src/b.js"],
"pathTarget": "lib"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({filePath: ['src/a.js', 'src/b.js'], pathTarget: 'lib'})
};
fetch('https://api.camposcloud.com/v1/apps/{appId}/files/move', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.camposcloud.com/v1/apps/{appId}/files/move",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'filePath' => [
'src/a.js',
'src/b.js'
],
'pathTarget' => 'lib'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.camposcloud.com/v1/apps/{appId}/files/move"
payload := strings.NewReader("{\n \"filePath\": [\n \"src/a.js\",\n \"src/b.js\"\n ],\n \"pathTarget\": \"lib\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.camposcloud.com/v1/apps/{appId}/files/move")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filePath\": [\n \"src/a.js\",\n \"src/b.js\"\n ],\n \"pathTarget\": \"lib\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.camposcloud.com/v1/apps/{appId}/files/move")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filePath\": [\n \"src/a.js\",\n \"src/b.js\"\n ],\n \"pathTarget\": \"lib\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Files moved successfully"
}{
"error": "'filePath' must be a non-empty array of strings."
}{
"error": "Invalid developer token"
}{
"error": "You do not have permission to perform this action on this application."
}{
"error": "Application not found or you do not have permission to access it."
}{
"error": "File upload limit reached, please try again later"
}{
"error": "Error from worker: Failed to move file 'src/a.js': ENOENT: no such file or directory"
}This endpoint has a rate limit of 1 request every 3 seconds, shared with the other endpoints that change files (upload, delete, rename, move and create).
Items are moved one by one. If one of them fails, the items before it have already been moved.
Authorizations
Body
application/json