<!-- source: docs/api/2_capi/groupfile/checkfilenameexists.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/checkfilenameexists -->

# CheckFilenameExists

Check if filename exists for provided path and name.

| Service | Operation |
| ------- | --------- |
| groupFile | CHECK_FILENAME_EXISTS |

## Method Parameters
Parameter | Description
--------- | -----------
groupId | The id of the group.
folderPath | The folder path.
filename | The file name.

## Usage

**C#:**

```csharp
string groupId = "dfsfsffsd";
string folderPath = "";
string filename = "cccc";
SuccessCallback successCallback = (response, cbObject) =>
{
  Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
  Debug.Log(string.Format("Failed | {0}  {1}  {2}", status, code, error));
};

_bc.GroupFileService.CheckFilenameExists(groupId, folderPath, filename, successCallback, failureCallback);
```

**C++:**

```cpp
const char *groupId = "dfsfsffsd";
const char *folderPath = "";
const char *filename = "cccc";

_bc->getGroupFileService()->checkFilenameExists(groupId, folderPath, filename, this);
```

**Obj-C:**

```objectivec
NSString *groupId = @"dfsfsffsd";
NSString *folderPath = @"";
NSString *filename = @"cccc";
BCCompletionBlock successBlock;      // define callback
BCErrorCompletionBlock failureBlock; // define callback

[[_bc groupFileService] checkFilenameExists:groupId
                    folderPath:folderPath
                      filename:filename
               completionBlock:successBlock
          errorCompletionBlock:failureBlock
                      cbObject:nil];
```

**Java:**

```java
String groupId = "dfsfsffsd";
String folderPath = "";
String filename = "cccc";
this; // implements IServerCallback

_bc.getGroupFileService().checkFilenameExists(groupId, folderPath, filename, this);

public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
  System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
  System.out.print(String.format("Failed | %d %d %s", statusCode,  reasonCode, jsonError.toString()));
}
```

**JavaScript:**

```javascript
var groupId = "dfsfsffsd";
var folderPath = "";
var filename = "cccc";

_bc.groupFile.checkFilenameExists(groupId, folderPath, filename, result =>
{
  var status = result.status;
  console.log(status + " : " + JSON.stringify(result, null, 2));
});
```

**Dart:**

```dart
var  groupId = "dfsfsffsd";
var  folderPath = "";
var  filename = "cccc";

ServerResponse result = await _bc.groupFileService.checkFilenameExists(groupId:groupId, folderPath:folderPath, filename:filename);

if (result.statusCode == 200) {
    print("Success");
} else {
    print("Failed ${result.error['status_message'] ?? result.error}");
}
```

**Roblox:**

```lua
local groupId = "dfsfsffsd"
local folderPath = ""
local filename = "cccc"

local callback = function(success, response)
    if success then
        print("Success")
    else
        print("Failed | " .. tostring(response.status_message))
    end
end

_bc.groupFile:checkFilenameExists(groupId, folderPath, filename, callback)
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
local groupId = "dfsfsffsd"
local folderPath = ""
local filename = "cccc"

local callback = function(success, response)
    if success then
        print("Success")
    else
        print("Failed | " .. tostring(response.status_message))
    end
end

_bc.groupFile:checkFilenameExists(groupId, folderPath, filename, callback)
```

**Cloud Code:**

```cfscript
var groupId = "dfsfsffsd";
var folderPath = "";
var filename = "cccc";
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.checkFilenameExists(groupId, folderPath, filename);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "CHECK_FILENAME_EXISTS",
  "data":
  {
    "groupId": "dfsfsffsd",
    "folderPath": "",
    "filename": "cccc"
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "fileDetails": {
            "treeId": "d9e937cc-750f-4414-962c-838f1af3f34a",
            "fileName": "glog.json",
            "fileSize": 7051,
            "dateUploaded": 1677183768000,
            "etag": "08c580b36ee79773bfec4a3c51bd1b64",
            "acl": {
                "member": 2,
                "other": 0
            },
            "version": 1,
            "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/d9e937cc-750f-4414-962c-838f1af3f34a/6d938c22-3b8c-4b99-a913-2edafed71a83/V1/glog.json",
            "fileId": "6d938c22-3b8c-4b99-a913-2edafed71a83"
        },
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7",
        "exists": true
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/groupfile/checkfullpathfilenameexists.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/checkfullpathfilenameexists -->

# CheckFullpathFilenameExists

Check if filename exists for provided full path name.

| Service | Operation |
| ------- | --------- |
| groupFile | CHECK_FULLPATH_FILENAME_EXISTS |

## Method Parameters
Parameter | Description
--------- | -----------
groupId | The id of the group.
fullPathFilename | The full file name with path.

## Usage

**C#:**

```csharp
string groupId = "dfsfsffsd";
string fullPathFilename = "cccc";
SuccessCallback successCallback = (response, cbObject) =>
{
  Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
  Debug.Log(string.Format("Failed | {0}  {1}  {2}", status, code, error));
};

_bc.GroupFileService.CheckFullpathFilenameExists(groupId, fullPathFilename, successCallback, failureCallback);
```

**C++:**

```cpp
const char *groupId = "dfsfsffsd";
const char *fullPathFilename = "cccc";

_bc->getGroupFileService()->checkFullpathFilenameExists(groupId, fullPathFilename, this);
```

**Obj-C:**

```objectivec
NSString *groupId = @"dfsfsffsd";
NSString *fullPathFilename = @"cccc";
BCCompletionBlock successBlock;      // define callback
BCErrorCompletionBlock failureBlock; // define callback

[[_bc groupFileService] checkFullpathFilenameExists:groupId
              fullPathFilename:fullPathFilename
               completionBlock:successBlock
          errorCompletionBlock:failureBlock
                      cbObject:nil];
```

**Java:**

```java
String groupId = "dfsfsffsd";
String fullPathFilename = "cccc";
this; // implements IServerCallback

_bc.getGroupFileService().checkFullpathFilenameExists(groupId, fullPathFilename, this);

public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
  System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
  System.out.print(String.format("Failed | %d %d %s", statusCode,  reasonCode, jsonError.toString()));
}
```

**JavaScript:**

```javascript
var groupId = "dfsfsffsd";
var fullPathFilename = "cccc";

_bc.groupFile.checkFullpathFilenameExists(groupId, fullPathFilename, result =>
{
  var status = result.status;
  console.log(status + " : " + JSON.stringify(result, null, 2));
});
```

**Dart:**

```dart
var  groupId = "dfsfsffsd";
var  fullPathFilename = "cccc";

ServerResponse result = await _bc.groupFileService.checkFullpathFilenameExists(groupId:groupId, fullPathFilename:fullPathFilename);

if (result.statusCode == 200) {
    print("Success");
} else {
    print("Failed ${result.error['status_message'] ?? result.error}");
}
```

**Roblox:**

```lua
local groupId = "dfsfsffsd"
local fullPathFilename = "cccc"

local callback = function(success, response)
    if success then
        print("Success")
    else
        print("Failed | " .. tostring(response.status_message))
    end
end

_bc.groupFile:checkFullpathFilenameExists(groupId, fullPathFilename, callback)
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
local groupId = "dfsfsffsd"
local fullPathFilename = "cccc"

local callback = function(success, response)
    if success then
        print("Success")
    else
        print("Failed | " .. tostring(response.status_message))
    end
end

_bc.groupFile:checkFullpathFilenameExists(groupId, fullPathFilename, callback)
```

**Cloud Code:**

```cfscript
var groupId = "dfsfsffsd";
var fullPathFilename = "cccc";
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.checkFullpathFilenameExists(groupId, fullPathFilename);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "CHECK_FULLPATH_FILENAME_EXISTS",
  "data":
  {
    "groupId": "dfsfsffsd",
    "fullPathFilename": "cccc"
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "fileDetails": {
            "treeId": "d9e937cc-750f-4414-962c-838f1af3f34a",
            "fileName": "glog.json",
            "fileSize": 7051,
            "dateUploaded": 1677183768000,
            "etag": "08c580b36ee79773bfec4a3c51bd1b64",
            "acl": {
                "member": 2,
                "other": 0
            },
            "version": 1,
            "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/d9e937cc-750f-4414-962c-838f1af3f34a/6d938c22-3b8c-4b99-a913-2edafed71a83/V1/glog.json",
            "fileId": "6d938c22-3b8c-4b99-a913-2edafed71a83"
        },
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7",
        "exists": true
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/groupfile/copyfile.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/copyfile -->

# CopyFile

Copy a file.

| Service | Operation |
| ------- | --------- |
| groupFile | COPY_FILE |

## Method Parameters
Parameter | Description
--------- | -----------
groupId | The id of the group.
fileId | The id of the file.
version | The target version of the file.
newTreeId | The id of the destination folder.
treeVersion | The target version of the folder tree.
newFilename | The optional new file name.
overwriteIfPresent | Whether to allow overwrite of an existing file if present.

## Usage

**C#:**

```csharp
string groupId = "dfsfsffsd";
string fileId = "xxxx";
int version = 1;
string newTreeId = "guid";
int treeVersion = 1;
string newFilename = "gfile";
bool overwriteIfPresent = true;
SuccessCallback successCallback = (response, cbObject) =>
{
  Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
  Debug.Log(string.Format("Failed | {0}  {1}  {2}", status, code, error));
};

_bc.GroupFileService.CopyFile(groupId, fileId, version, newTreeId, treeVersion, newFilename, overwriteIfPresent, successCallback, failureCallback);
```

**C++:**

```cpp
const char *groupId = "dfsfsffsd";
const char *fileId = "xxxx";
int version = 1;
const char *newTreeId = "guid";
int treeVersion = 1;
const char *newFilename = "gfile";
bool overwriteIfPresent = true;

_bc->getGroupFileService()->copyFile(groupId, fileId, version, newTreeId, treeVersion, newFilename, overwriteIfPresent, this);
```

**Obj-C:**

```objectivec
NSString *groupId = @"dfsfsffsd";
NSString *fileId = @"xxxx";
int version = 1;
NSString *newTreeId = @"guid";
int treeVersion = 1;
NSString *newFilename = @"gfile";
bool overwriteIfPresent = true;
BCCompletionBlock successBlock;      // define callback
BCErrorCompletionBlock failureBlock; // define callback

[[_bc groupFileService] copyFile:groupId
                        fileId:fileId
                       version:version
                     newTreeId:newTreeId
                   treeVersion:treeVersion
                   newFilename:newFilename
            overwriteIfPresent:overwriteIfPresent
               completionBlock:successBlock
          errorCompletionBlock:failureBlock
                      cbObject:nil];
```

**Java:**

```java
String groupId = "dfsfsffsd";
String fileId = "xxxx";
int version = 1;
String newTreeId = "guid";
int treeVersion = 1;
String newFilename = "gfile";
bool overwriteIfPresent = true;
this; // implements IServerCallback

_bc.getGroupFileService().copyFile(groupId, fileId, version, newTreeId, treeVersion, newFilename, overwriteIfPresent, this);

public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
  System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
  System.out.print(String.format("Failed | %d %d %s", statusCode,  reasonCode, jsonError.toString()));
}
```

**JavaScript:**

```javascript
var groupId = "dfsfsffsd";
var fileId = "xxxx";
var version = 1;
var newTreeId = "guid";
var treeVersion = 1;
var newFilename = "gfile";
var overwriteIfPresent = true;

_bc.groupFile.copyFile(groupId, fileId, version, newTreeId, treeVersion, newFilename, overwriteIfPresent, result =>
{
  var status = result.status;
  console.log(status + " : " + JSON.stringify(result, null, 2));
});
```

**Dart:**

```dart
var  groupId = "dfsfsffsd";
var  fileId = "xxxx";
var  version = 1;
var  newTreeId = "guid";
var  treeVersion = 1;
var  newFilename = "gfile";
var  overwriteIfPresent = true;

ServerResponse result = await _bc.groupFileService.copyFile(groupId:groupId, fileId:fileId, version:version, newTreeId:newTreeId, treeVersion:treeVersion, newFilename:newFilename, overwriteIfPresent:overwriteIfPresent);

if (result.statusCode == 200) {
    print("Success");
} else {
    print("Failed ${result.error['status_message'] ?? result.error}");
}
```

**Roblox:**

```lua
local groupId = "dfsfsffsd"
local fileId = "xxxx"
local version = 1
local newTreeId = "guid"
local treeVersion = 1
local newFilename = "gfile"
local overwriteIfPresent = true

local callback = function(success, response)
    if success then
        print("Success")
    else
        print("Failed | " .. tostring(response.status_message))
    end
end

_bc.groupFile:copyFile(groupId, fileId, version, newTreeId, treeVersion, newFilename, overwriteIfPresent, callback)
```

**GDScript:**

```gdscript
var group_id = "dfsfsffsd"
var file_id = "xxxx"
var version = 1
var new_tree_id = "guid"
var tree_version = 1
var new_filename = "gfile"
var overwrite_if_present = true

var result = await _bc.group_file_service.copy_file(group_id, file_id, version, new_tree_id, tree_version, new_filename, overwrite_if_present)

if result.status == 200:
	print("Success")
else:
	print("Failed: %s" % result.status_message)
```

**Lua:**

```lua
local groupId = "dfsfsffsd"
local fileId = "xxxx"
local version = 1
local newTreeId = "guid"
local treeVersion = 1
local newFilename = "gfile"
local overwriteIfPresent = true

local callback = function(success, response)
    if success then
        print("Success")
    else
        print("Failed | " .. tostring(response.status_message))
    end
end

_bc.groupFile:copyFile(groupId, fileId, version, newTreeId, treeVersion, newFilename, overwriteIfPresent, callback)
```

**Cloud Code:**

```cfscript
var groupId = "dfsfsffsd";
var fileId = "xxxx";
var version = 1;
var newTreeId = "guid";
var treeVersion = 1;
var newFilename = "gfile";
var overwriteIfPresent = true;
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.copyFile(groupId, fileId, version, newTreeId, treeVersion, newFilename, overwriteIfPresent);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "COPY_FILE",
  "data":
  {
    "groupId": "dfsfsffsd",
    "fileId": "xxxx",
    "version": 1,
    "newTreeId": "guid",
    "treeVersion": 1,
    "newFilename": "gfile",
    "overwriteIfPresent": true
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "fileDetails": {
            "treeId": "fb3431cd-6e2f-47f1-8100-8941abf6bb4f",
            "fileName": "glogcopy.json",
            "fileSize": 7051,
            "dateUploaded": 1677519200000,
            "etag": "173c2ac6f302869af8890ee32a8ccb90",
            "acl": {
                "member": 2,
                "other": 0
            },
            "version": 1,
            "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/fb3431cd-6e2f-47f1-8100-8941abf6bb4f/0554430e-51a1-44d4-b6f4-bffae67185dc/V1/glogcopy.json",
            "fileId": "0554430e-51a1-44d4-b6f4-bffae67185dc"
        },
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7"
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/groupfile/deletefile.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/deletefile -->

# DeleteFile

Delete a file.

| Service | Operation |
| ------- | --------- |
| groupFile | DELETE_FILE |

## Method Parameters
Parameter | Description
--------- | -----------
groupId | The id of the group.
fileId | The id of the file.
version | The target version of the file.
filename | The file name for verification purposes.

## Usage

**C#:**

```csharp
string groupId = "dfsfsffsd";
string fileId = "xxxx";
int version = 1;
string filename = "gfile";
SuccessCallback successCallback = (response, cbObject) =>
{
  Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
  Debug.Log(string.Format("Failed | {0}  {1}  {2}", status, code, error));
};

_bc.GroupFileService.DeleteFile(groupId, fileId, version, filename, successCallback, failureCallback);
```

**C++:**

```cpp
const char *groupId = "dfsfsffsd";
const char *fileId = "xxxx";
int version = 1;
const char *filename = "gfile";

_bc->getGroupFileService()->deleteFile(groupId, fileId, version, filename, this);
```

**Obj-C:**

```objectivec
NSString *groupId = @"dfsfsffsd";
NSString *fileId = @"xxxx";
int version = 1;
NSString *filename = @"gfile";
BCCompletionBlock successBlock;      // define callback
BCErrorCompletionBlock failureBlock; // define callback

[[_bc groupFileService] deleteFile:groupId
                        fileId:fileId
                       version:version
                      filename:filename
               completionBlock:successBlock
          errorCompletionBlock:failureBlock
                      cbObject:nil];
```

**Java:**

```java
String groupId = "dfsfsffsd";
String fileId = "xxxx";
int version = 1;
String filename = "gfile";
this; // implements IServerCallback

_bc.getGroupFileService().deleteFile(groupId, fileId, version, filename, this);

public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
  System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
  System.out.print(String.format("Failed | %d %d %s", statusCode,  reasonCode, jsonError.toString()));
}
```

**JavaScript:**

```javascript
var groupId = "dfsfsffsd";
var fileId = "xxxx";
var version = 1;
var filename = "gfile";

_bc.groupFile.deleteFile(groupId, fileId, version, filename, result =>
{
  var status = result.status;
  console.log(status + " : " + JSON.stringify(result, null, 2));
});
```

**Dart:**

```dart
var  groupId = "dfsfsffsd";
var  fileId = "xxxx";
var  version = 1;
var  filename = "gfile";

ServerResponse result = await _bc.groupFileService.deleteFile(groupId:groupId, fileId:fileId, version:version, filename:filename);

if (result.statusCode == 200) {
    print("Success");
} else {
    print("Failed ${result.error['status_message'] ?? result.error}");
}
```

**Roblox:**

```lua
local groupId = "dfsfsffsd"
local fileId = "xxxx"
local version = 1
local filename = "gfile"

local callback = function(success, response)
    if success then
        print("Success")
    else
        print("Failed | " .. tostring(response.status_message))
    end
end

_bc.groupFile:deleteFile(groupId, fileId, version, filename, callback)
```

**GDScript:**

```gdscript
var group_id = "dfsfsffsd"
var file_id = "xxxx"
var version = 1
var filename = "gfile"

var result = await _bc.group_file_service.delete_file(group_id, file_id, version, filename)

if result.status == 200:
	print("Success")
else:
	print("Failed: %s" % result.status_message)
```

**Lua:**

```lua
local groupId = "dfsfsffsd"
local fileId = "xxxx"
local version = 1
local filename = "gfile"

local callback = function(success, response)
    if success then
        print("Success")
    else
        print("Failed | " .. tostring(response.status_message))
    end
end

_bc.groupFile:deleteFile(groupId, fileId, version, filename, callback)
```

**Cloud Code:**

```cfscript
var groupId = "dfsfsffsd";
var fileId = "xxxx";
var version = 1;
var filename = "gfile";
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.deleteFile(groupId, fileId, version, filename);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "DELETE_FILE",
  "data":
  {
    "groupId": "dfsfsffsd",
    "fileId": "xxxx",
    "version": 1,
    "filename": "gfile"
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "fileDetails": {
            "treeId": "fb3431cd-6e2f-47f1-8100-8941abf6bb4f",
            "fileName": "glogcopy.json",
            "version": 1,
            "fileId": "0554430e-51a1-44d4-b6f4-bffae67185dc"
        },
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7"
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/groupfile/getcdnurl.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/getcdnurl -->

# GetCDNUrl

Return CDN url for file for clients that cannot handle redirect.

| Service | Operation |
| ------- | --------- |
| groupFile | GET_CDN_URL |

## Method Parameters
Parameter | Description
--------- | -----------
groupId | The id of the group.
fileId | The id of the file.

## Usage

**C#:**

```csharp
string groupId = "dfsfsffsd";
string fileId = "fdsgfg";
SuccessCallback successCallback = (response, cbObject) =>
{
  Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
  Debug.Log(string.Format("Failed | {0}  {1}  {2}", status, code, error));
};

_bc.GroupFileService.GetCDNUrl(groupId, fileId, successCallback, failureCallback);
```

**C++:**

```cpp
const char *groupId = "dfsfsffsd";
const char *fileId = "fdsgfg";

_bc->getGroupFileService()->getCDNUrl(groupId, fileId, this);
```

**Obj-C:**

```objectivec
NSString *groupId = @"dfsfsffsd";
NSString *fileId = @"fdsgfg";
BCCompletionBlock successBlock;      // define callback
BCErrorCompletionBlock failureBlock; // define callback

[[_bc groupFileService] getCDNUrl:groupId
                        fileId:fileId
               completionBlock:successBlock
          errorCompletionBlock:failureBlock
                      cbObject:nil];
```

**Java:**

```java
String groupId = "dfsfsffsd";
String fileId = "fdsgfg";
this; // implements IServerCallback

_bc.getGroupFileService().getCDNUrl(groupId, fileId, this);

public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
  System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
  System.out.print(String.format("Failed | %d %d %s", statusCode,  reasonCode, jsonError.toString()));
}
```

**JavaScript:**

```javascript
var groupId = "dfsfsffsd";
var fileId = "fdsgfg";

_bc.groupFile.getCDNUrl(groupId, fileId, result =>
{
  var status = result.status;
  console.log(status + " : " + JSON.stringify(result, null, 2));
});
```

**Dart:**

```dart
var  groupId = "dfsfsffsd";
var  fileId = "fdsgfg";

ServerResponse result = await _bc.groupFileService.getCDNUrl(groupId:groupId, fileId:fileId);

if (result.statusCode == 200) {
    print("Success");
} else {
    print("Failed ${result.error['status_message'] ?? result.error}");
}
```

**Roblox:**

```lua
local groupId = "dfsfsffsd"
local fileId = "fdsgfg"

local callback = function(success, response)
    if success then
        print("Success")
    else
        print("Failed | " .. tostring(response.status_message))
    end
end

_bc.groupFile:getCDNUrl(groupId, fileId, callback)
```

**GDScript:**

```gdscript
var group_id = "dfsfsffsd"
var file_id = "fdsgfg"

var result = await _bc.group_file_service.get_cdn_url(group_id, file_id)

if result.status == 200:
	print("Success")
else:
	print("Failed: %s" % result.status_message)
```

**Lua:**

```lua
local groupId = "dfsfsffsd"
local fileId = "fdsgfg"

local callback = function(success, response)
    if success then
        print("Success")
    else
        print("Failed | " .. tostring(response.status_message))
    end
end

_bc.groupFile:getCDNUrl(groupId, fileId, callback)
```

**Cloud Code:**

```cfscript
var groupId = "dfsfsffsd";
var fileId = "fdsgfg";
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.getCDNUrl(groupId, fileId);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "GET_CDN_URL",
  "data":
  {
    "groupId": "dfsfsffsd",
    "fileId": "fdsgfg"
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "cdnUrl": "https://cdn-2022-internal.braincloudservers.com/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/d9e937cc-750f-4414-962c-838f1af3f34a/6d938c22-3b8c-4b99-a913-2edafed71a83/V1/glog.json?Expires=1677524402&Signature=Cymd~D94yLPZy4CKyn7FwRxmIvOY9YaHGqL6sMoGCkK8EmZOxXcKAztYZPZRFZdyHlWMhF8lpwasJFxiq6oOAwSEsjtQrHzs4tzO17QBzoLHabqH37H1Rre2LybmdIgVu5h7k3iFuggBvXt5QR1oTMEZPJ1Wn5TAaByj0VywfXkx2eXxKnIBm1JkccjP~IAjC9may22QduZNWivTQuu2jZG5bdjq3x96BWUMbgON2XWfyZCqSV4OFKeIN2LCc-QR2OvL6x-4VJF1nepBXOkvX-oC~WpkbEJ21ARZ9wtKhTubA~UAq0THmmR-PZb070NeSdh4OYsEeDUSXraaob7E6Q__&Key-Pair-Id=KG07XY8JT6H1V",
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7",
        "appServerUrl": "https://api.internal.braincloudservers.com/files/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/d9e937cc-750f-4414-962c-838f1af3f34a/6d938c22-3b8c-4b99-a913-2edafed71a83/V1/glog.json"
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/groupfile/getfileinfo.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/getfileinfo -->

# GetFileInfo

Returns information on a file using fileId.

| Service | Operation |
| ------- | --------- |
| groupFile | GET_FILE_INFO |

## Method Parameters
Parameter | Description
--------- | -----------
groupId | The id of the group.
fileId | The id of the file.

## Usage

**C#:**

```csharp
string groupId = "dfsfsffsd";
string fileId = "guid";
SuccessCallback successCallback = (response, cbObject) =>
{
  Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
  Debug.Log(string.Format("Failed | {0}  {1}  {2}", status, code, error));
};

_bc.GroupFileService.GetFileInfo(groupId, fileId, successCallback, failureCallback);
```

**C++:**

```cpp
const char *groupId = "dfsfsffsd";
const char *fileId = "guid";

_bc->getGroupFileService()->getFileInfo(groupId, fileId, this);
```

**Obj-C:**

```objectivec
NSString *groupId = @"dfsfsffsd";
NSString *fileId = @"guid";
BCCompletionBlock successBlock;      // define callback
BCErrorCompletionBlock failureBlock; // define callback

[[_bc groupFileService] getFileInfo:groupId
                        fileId:fileId
               completionBlock:successBlock
          errorCompletionBlock:failureBlock
                      cbObject:nil];
```

**Java:**

```java
String groupId = "dfsfsffsd";
String fileId = "guid";
this; // implements IServerCallback

_bc.getGroupFileService().getFileInfo(groupId, fileId, this);

public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
  System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
  System.out.print(String.format("Failed | %d %d %s", statusCode,  reasonCode, jsonError.toString()));
}
```

**JavaScript:**

```javascript
var groupId = "dfsfsffsd";
var fileId = "guid";

_bc.groupFile.getFileInfo(groupId, fileId, result =>
{
  var status = result.status;
  console.log(status + " : " + JSON.stringify(result, null, 2));
});
```

**Dart:**

```dart
var  groupId = "dfsfsffsd";
var  fileId = "guid";

ServerResponse result = await _bc.groupFileService.getFileInfo(groupId:groupId, fileId:fileId);

if (result.statusCode == 200) {
    print("Success");
} else {
    print("Failed ${result.error['status_message'] ?? result.error}");
}
```

**Roblox:**

```lua
local groupId = "dfsfsffsd"
local fileId = "guid"

local callback = function(success, response)
    if success then
        print("Success")
    else
        print("Failed | " .. tostring(response.status_message))
    end
end

_bc.groupFile:getFileInfo(groupId, fileId, callback)
```

**GDScript:**

```gdscript
var group_id = "dfsfsffsd"
var file_id = "guid"

var result = await _bc.group_file_service.get_file_info(group_id, file_id)

if result.status == 200:
	print("Success")
else:
	print("Failed: %s" % result.status_message)
```

**Lua:**

```lua
local groupId = "dfsfsffsd"
local fileId = "guid"

local callback = function(success, response)
    if success then
        print("Success")
    else
        print("Failed | " .. tostring(response.status_message))
    end
end

_bc.groupFile:getFileInfo(groupId, fileId, callback)
```

**Cloud Code:**

```cfscript
var groupId = "dfsfsffsd";
var fileId = "guid";
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.getFileInfo(groupId, fileId);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "GET_FILE_INFO",
  "data":
  {
    "groupId": "dfsfsffsd",
    "fileId": "guid"
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "fileDetails": {
            "treeId": "d9e937cc-750f-4414-962c-838f1af3f34a",
            "fileName": "glog.json",
            "fileSize": 7051,
            "dateUploaded": 1677183768000,
            "etag": "08c580b36ee79773bfec4a3c51bd1b64",
            "acl": {
                "member": 2,
                "other": 0
            },
            "version": 1,
            "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/d9e937cc-750f-4414-962c-838f1af3f34a/6d938c22-3b8c-4b99-a913-2edafed71a83/V1/glog.json",
            "fileId": "6d938c22-3b8c-4b99-a913-2edafed71a83"
        },
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7"
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/groupfile/getfileinfosimple.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/getfileinfosimple -->

# GetFileInfoSimple

Returns information on a file using path and name.

| Service | Operation |
| ------- | --------- |
| groupFile | GET_FILE_INFO_SIMPLE |

## Method Parameters
Parameter | Description
--------- | -----------
groupId | The id of the group.
folderPath | The folder path.
filename | The file name.

## Usage

**C#:**

```csharp
string groupId = "dfsfsffsd";
string folderPath = "";
string filename = "cccc";
SuccessCallback successCallback = (response, cbObject) =>
{
  Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
  Debug.Log(string.Format("Failed | {0}  {1}  {2}", status, code, error));
};

_bc.GroupFileService.GetFileInfoSimple(groupId, folderPath, filename, successCallback, failureCallback);
```

**C++:**

```cpp
const char *groupId = "dfsfsffsd";
const char *folderPath = "";
const char *filename = "cccc";

_bc->getGroupFileService()->getFileInfoSimple(groupId, folderPath, filename, this);
```

**Obj-C:**

```objectivec
NSString *groupId = @"dfsfsffsd";
NSString *folderPath = @"";
NSString *filename = @"cccc";
BCCompletionBlock successBlock;      // define callback
BCErrorCompletionBlock failureBlock; // define callback

[[_bc groupFileService] getFileInfoSimple:groupId
                    folderPath:folderPath
                      filename:filename
               completionBlock:successBlock
          errorCompletionBlock:failureBlock
                      cbObject:nil];
```

**Java:**

```java
String groupId = "dfsfsffsd";
String folderPath = "";
String filename = "cccc";
this; // implements IServerCallback

_bc.getGroupFileService().getFileInfoSimple(groupId, folderPath, filename, this);

public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
  System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
  System.out.print(String.format("Failed | %d %d %s", statusCode,  reasonCode, jsonError.toString()));
}
```

**JavaScript:**

```javascript
var groupId = "dfsfsffsd";
var folderPath = "";
var filename = "cccc";

_bc.groupFile.getFileInfoSimple(groupId, folderPath, filename, result =>
{
  var status = result.status;
  console.log(status + " : " + JSON.stringify(result, null, 2));
});
```

**Dart:**

```dart
var  groupId = "dfsfsffsd";
var  folderPath = "";
var  filename = "cccc";

ServerResponse result = await _bc.groupFileService.getFileInfoSimple(groupId:groupId, folderPath:folderPath, filename:filename);

if (result.statusCode == 200) {
    print("Success");
} else {
    print("Failed ${result.error['status_message'] ?? result.error}");
}
```

**Roblox:**

```lua
local groupId = "dfsfsffsd"
local folderPath = ""
local filename = "cccc"

local callback = function(success, response)
    if success then
        print("Success")
    else
        print("Failed | " .. tostring(response.status_message))
    end
end

_bc.groupFile:getFileInfoSimple(groupId, folderPath, filename, callback)
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
local groupId = "dfsfsffsd"
local folderPath = ""
local filename = "cccc"

local callback = function(success, response)
    if success then
        print("Success")
    else
        print("Failed | " .. tostring(response.status_message))
    end
end

_bc.groupFile:getFileInfoSimple(groupId, folderPath, filename, callback)
```

**Cloud Code:**

```cfscript
var groupId = "dfsfsffsd";
var folderPath = "";
var filename = "cccc";
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.getFileInfoSimple(groupId, folderPath, filename);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "GET_FILE_INFO_SIMPLE",
  "data":
  {
    "groupId": "dfsfsffsd",
    "folderPath": "",
    "filename": "cccc"
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "fileDetails": {
            "treeId": "d9e937cc-750f-4414-962c-838f1af3f34a",
            "fileName": "glog.json",
            "fileSize": 7051,
            "dateUploaded": 1677183768000,
            "etag": "08c580b36ee79773bfec4a3c51bd1b64",
            "acl": {
                "member": 2,
                "other": 0
            },
            "version": 1,
            "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/d9e937cc-750f-4414-962c-838f1af3f34a/6d938c22-3b8c-4b99-a913-2edafed71a83/V1/glog.json",
            "fileId": "6d938c22-3b8c-4b99-a913-2edafed71a83"
        },
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7"
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/groupfile/getfilelist.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/getfilelist -->

# GetFileList

Returns a list of files.

| Service | Operation |
| ------- | --------- |
| groupFile | GET_FILE_LIST |

## Method Parameters
Parameter | Description
--------- | -----------
groupId | The id of the group.
folderPath | The folder path.
recurse | Whether to recurse beyond the starting folder.

## Usage

**C#:**

```csharp
string groupId = "dfsfsffsd";
string folderPath = "";
bool recurse = true;
SuccessCallback successCallback = (response, cbObject) =>
{
  Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
  Debug.Log(string.Format("Failed | {0}  {1}  {2}", status, code, error));
};

_bc.GroupFileService.GetFileList(groupId, folderPath, recurse, successCallback, failureCallback);
```

**C++:**

```cpp
const char *groupId = "dfsfsffsd";
const char *folderPath = "";
bool recurse = true;

_bc->getGroupFileService()->getFileList(groupId, folderPath, recurse, this);
```

**Obj-C:**

```objectivec
NSString *groupId = @"dfsfsffsd";
NSString *folderPath = @"";
bool recurse = true;
BCCompletionBlock successBlock;      // define callback
BCErrorCompletionBlock failureBlock; // define callback

[[_bc groupFileService] getFileList:groupId
                    folderPath:folderPath
                       recurse:recurse
               completionBlock:successBlock
          errorCompletionBlock:failureBlock
                      cbObject:nil];
```

**Java:**

```java
String groupId = "dfsfsffsd";
String folderPath = "";
bool recurse = true;
this; // implements IServerCallback

_bc.getGroupFileService().getFileList(groupId, folderPath, recurse, this);

public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
  System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
  System.out.print(String.format("Failed | %d %d %s", statusCode,  reasonCode, jsonError.toString()));
}
```

**JavaScript:**

```javascript
var groupId = "dfsfsffsd";
var folderPath = "";
var recurse = true;

_bc.groupFile.getFileList(groupId, folderPath, recurse, result =>
{
  var status = result.status;
  console.log(status + " : " + JSON.stringify(result, null, 2));
});
```

**Dart:**

```dart
var  groupId = "dfsfsffsd";
var  folderPath = "";
var  recurse = true;

ServerResponse result = await _bc.groupFileService.getFileList(groupId:groupId, folderPath:folderPath, recurse:recurse);

if (result.statusCode == 200) {
    print("Success");
} else {
    print("Failed ${result.error['status_message'] ?? result.error}");
}
```

**Roblox:**

```lua
local groupId = "dfsfsffsd"
local folderPath = ""
local recurse = true

local callback = function(success, response)
    if success then
        print("Success")
    else
        print("Failed | " .. tostring(response.status_message))
    end
end

_bc.groupFile:getFileList(groupId, folderPath, recurse, callback)
```

**GDScript:**

```gdscript
var group_id = "dfsfsffsd"
var folder_path = ""
var recurse = true

var result = await _bc.group_file_service.get_file_list(group_id, folder_path, recurse)

if result.status == 200:
	print("Success")
else:
	print("Failed: %s" % result.status_message)
```

**Lua:**

```lua
local groupId = "dfsfsffsd"
local folderPath = ""
local recurse = true

local callback = function(success, response)
    if success then
        print("Success")
    else
        print("Failed | " .. tostring(response.status_message))
    end
end

_bc.groupFile:getFileList(groupId, folderPath, recurse, callback)
```

**Cloud Code:**

```cfscript
var groupId = "dfsfsffsd";
var folderPath = "";
var recurse = true;
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.getFileList(groupId, folderPath, recurse);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "GET_FILE_LIST",
  "data":
  {
    "groupId": "dfsfsffsd",
    "folderPath": "",
    "recurse": true
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "treeVersion": 5,
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7",
        "fileList": {
            "folderPath": "/",
            "treeId": "",
            "folders": {
                "gpathcopy": {
                    "folderPath": "/gpathcopy/",
                    "treeId": "40479c72-b46b-4c05-902c-239ada116acd",
                    "folders": {
                        "gpathcopy": {
                            "folderPath": "/gpathcopy/gpathcopy/",
                            "treeId": "fb3431cd-6e2f-47f1-8100-8941abf6bb4f",
                            "folders": {},
                            "name": "gpathcopy",
                            "files": {
                                "glogcopy.json": {
                                    "fileName": "glogcopy.json",
                                    "fileSize": 7051,
                                    "dateUploaded": 1677521119000,
                                    "acl": {
                                        "member": 2,
                                        "other": 0
                                    },
                                    "version": 2,
                                    "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/fb3431cd-6e2f-47f1-8100-8941abf6bb4f/6d938c22-3b8c-4b99-a913-2edafed71a83/V2/glogcopy.json",
                                    "fileId": "6d938c22-3b8c-4b99-a913-2edafed71a83"
                                },
                                "glogcopy1.json": {
                                    "fileName": "glogcopy1.json",
                                    "fileSize": 7051,
                                    "dateUploaded": 1677527426000,
                                    "acl": {
                                        "member": 2,
                                        "other": 0
                                    },
                                    "version": 1,
                                    "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/fb3431cd-6e2f-47f1-8100-8941abf6bb4f/4fde0d32-c866-473b-bee1-a4565f8d289b/V1/glogcopy1.json",
                                    "fileId": "4fde0d32-c866-473b-bee1-a4565f8d289b"
                                }
                            },
                            "totalFileSize": 14102,
                            "acl": {
                                "member": 2,
                                "other": 0
                            },
                            "totalFileCount": 2,
                            "desc": "desc"
                        }
                    },
                    "name": "gpathcopy",
                    "files": {
                        "glog1newname.json": {
                            "fileName": "glog1newname.json",
                            "fileSize": 8199,
                            "dateUploaded": 1677526746000,
                            "acl": {
                                "member": 2,
                                "other": 0
                            },
                            "version": 2,
                            "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/40479c72-b46b-4c05-902c-239ada116acd/4c924070-db15-47d4-a44a-be496bb49f66/V2/glog1newname.json",
                            "fileId": "4c924070-db15-47d4-a44a-be496bb49f66"
                        }
                    },
                    "totalFileSize": 22301,
                    "acl": {
                        "member": 2,
                        "other": 0
                    },
                    "totalFileCount": 3,
                    "desc": ""
                },
                "gpath": {
                    "folderPath": "/gpath/",
                    "treeId": "59533e64-abc0-4f04-976b-8f395073ea2e",
                    "folders": {
                        "gpath": {
                            "folderPath": "/gpath/gpath/",
                            "treeId": "d9e937cc-750f-4414-962c-838f1af3f34a",
                            "folders": {},
                            "name": "gpath",
                            "files": {},
                            "totalFileSize": 0,
                            "acl": {
                                "member": 2,
                                "other": 0
                            },
                            "totalFileCount": 0,
                            "desc": "desc"
                        }
                    },
                    "name": "gpath",
                    "files": {},
                    "totalFileSize": 0,
                    "acl": {
                        "member": 2,
                        "other": 0
                    },
                    "totalFileCount": 0,
                    "desc": ""
                },
                "foldername": {
                    "folderPath": "/foldername/",
                    "treeId": "97446e50-4e02-49f6-8c86-807137620249",
                    "folders": {
                        "subfoldername": {
                            "folderPath": "/foldername/subfoldername/",
                            "treeId": "625ab492-fad9-4aa6-b174-50ac4344de81",
                            "folders": {},
                            "name": "subfoldername",
                            "files": {
                                "glogcopy1sub.json": {
                                    "fileName": "glogcopy1sub.json",
                                    "fileSize": 7051,
                                    "dateUploaded": 1677528007000,
                                    "acl": {
                                        "member": 2,
                                        "other": 0
                                    },
                                    "version": 1,
                                    "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/625ab492-fad9-4aa6-b174-50ac4344de81/7fcd9c06-c02f-43c7-8df7-db3d4f8207f0/V1/glogcopy1sub.json",
                                    "fileId": "7fcd9c06-c02f-43c7-8df7-db3d4f8207f0"
                                }
                            },
                            "totalFileSize": 7051,
                            "acl": {
                                "member": 2,
                                "other": 0
                            },
                            "totalFileCount": 1,
                            "desc": "subfolderdesc"
                        }
                    },
                    "name": "foldername",
                    "files": {},
                    "totalFileSize": 7051,
                    "acl": {
                        "member": 2,
                        "other": 0
                    },
                    "totalFileCount": 1,
                    "desc": "folderdesc"
                }
            },
            "name": "",
            "files": {
                "glogroot.json": {
                    "fileName": "glogroot.json",
                    "fileSize": 7051,
                    "dateUploaded": 1677528268000,
                    "acl": {
                        "member": 2,
                        "other": 0
                    },
                    "version": 1,
                    "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/df272294-b0ba-4840-90b7-bc97c4c0ce9b/V1/glogroot.json",
                    "fileId": "df272294-b0ba-4840-90b7-bc97c4c0ce9b"
                }
            },
            "totalFileSize": 36403,
            "acl": {
                "member": 2,
                "other": 0
            },
            "totalFileCount": 5,
            "desc": null
        }
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/groupfile/index.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile -->

# Group File

**Group Files** add the ability for Groups to own files, which are similar to Group Entities -- in that they are associated with, and potentially private to, a specific group.

Group files support ACL permissions are similar to Group Entities - so that access permissions can be specified according to "owner", "member" or "other".

Group Files features include:

* folder structure within a group
* ACL permissions at folder and file levels
* operations for creating, moving and deleting folders
* operations for moving, copying and deleting files
* ability to copy/move user files to group files
  
> **Tip:** Like user files, group files will not be migrated to downstream apps during deployment.

### API Summary

#### File Management for group members
* [CheckFilenameExists](/api/capi/groupfile/checkfilenameexists) - Check if filename exists for provided path and name.
* [CheckFullpathFilenameExists](/api/capi/groupfile/checkfullpathfilenameexists) - Check if filename exists for provided full path name.
* [GetFileInfo](/api/capi/groupfile/getfileinfo) - Returns information on a file using fileId.
* [GetFileInfoSimple](/api/capi/groupfile/getfileinfosimple) - Returns information on a file using path and name.
* [GetFileList](/api/capi/groupfile/getfilelist) - Returns a list of files.
* [GetCDNUrl](/api/capi/groupfile/getcdnurl) - Return CDN url for file for clients that cannot handle redirect.
* [UpdateFileInfo](/api/capi/groupfile/updatefileinfo) - Returns information on a file using fileId.
* [CopyFile](/api/capi/groupfile/copyfile) - Copy a file.
* [MoveFile](/api/capi/groupfile/movefile) - Move a file.
* [DeleteFile](/api/capi/groupfile/deletefile) - Delete a file.
* [MoveUserToGroupFile](/api/capi/groupfile/moveusertogroupfile) - Move a file from user space to group space.

#### Bypassing ACL for System Calls
* [SysCheckFilenameExists](/api/capi/groupfile/syscheckfilenameexists) - Check if filename exists for provided path and name.
* [SysCheckFullpathFilenameExists](/api/capi/groupfile/syscheckfullpathfilenameexists) - Check if filename exists for provided full path name.
* [SysGetFileInfo](/api/capi/groupfile/sysgetfileinfo) - Returns information on a file using fileId.
* [SysGetFileInfoSimple](/api/capi/groupfile/sysgetfileinfosimple) - Returns information on a file using path and name.
* [SysGetFileList](/api/capi/groupfile/sysgetfilelist) - Returns a list of files.
* [SysGetCDNUrl](/api/capi/groupfile/sysgetcdnurl) - Return CDN url for file for clients that cannot handle redirect.
* [SysUpdateFileInfo](/api/capi/groupfile/sysupdatefileinfo) - Returns information on a file using fileId.
* [SysCopyFile](/api/capi/groupfile/syscopyfile) - Copy a file.
* [SysMoveFile](/api/capi/groupfile/sysmovefile) - Move a file.
* [SysDeleteFile](/api/capi/groupfile/sysdeletefile) - Delete a file.
* [SysMoveUserToGroupFile](/api/capi/groupfile/sysmoveusertogroupfile) - Move a file from user space to group space.

### Folder Management for System Calls
* [SysCreateFolder](/api/capi/groupfile/syscreatefolder) - Create a folder in the global file tree.
* [SysMoveFolder](/api/capi/groupfile/sysmovefolder) - Move a folder in the global file tree.
* [SysUpdateFolder](/api/capi/groupfile/sysupdatefolder) - Update a folder in the group file tree.
* [SysLookupFolder](/api/capi/groupfile/syslookupfolder) - Retrieves tree id of specified folder.
* [SysDeleteFolder](/api/capi/groupfile/sysdeletefolder) - Delete a folder.


---

<!-- source: docs/api/2_capi/groupfile/movefile.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/movefile -->

# MoveFile

Move a file.

| Service | Operation |
| ------- | --------- |
| groupFile | MOVE_FILE |

## Method Parameters
Parameter | Description
--------- | -----------
groupId | The id of the group.
fileId | The id of the file.
version | The target version of the file.
newTreeId | The id of the destination folder.
treeVersion | The target version of the folder tree.
newFilename | The optional new file name.
overwriteIfPresent | Whether to allow overwrite of an existing file if present.

## Usage

**C#:**

```csharp
string groupId = "dfsfsffsd";
string fileId = "xxxx";
int version = 1;
string newTreeId = "guid";
int treeVersion = 1;
string newFilename = "gfile";
bool overwriteIfPresent = true;
SuccessCallback successCallback = (response, cbObject) =>
{
  Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
  Debug.Log(string.Format("Failed | {0}  {1}  {2}", status, code, error));
};

_bc.GroupFileService.MoveFile(groupId, fileId, version, newTreeId, treeVersion, newFilename, overwriteIfPresent, successCallback, failureCallback);
```

**C++:**

```cpp
const char *groupId = "dfsfsffsd";
const char *fileId = "xxxx";
int version = 1;
const char *newTreeId = "guid";
int treeVersion = 1;
const char *newFilename = "gfile";
bool overwriteIfPresent = true;

_bc->getGroupFileService()->moveFile(groupId, fileId, version, newTreeId, treeVersion, newFilename, overwriteIfPresent, this);
```

**Obj-C:**

```objectivec
NSString *groupId = @"dfsfsffsd";
NSString *fileId = @"xxxx";
int version = 1;
NSString *newTreeId = @"guid";
int treeVersion = 1;
NSString *newFilename = @"gfile";
bool overwriteIfPresent = true;
BCCompletionBlock successBlock;      // define callback
BCErrorCompletionBlock failureBlock; // define callback

[[_bc groupFileService] moveFile:groupId
                        fileId:fileId
                       version:version
                     newTreeId:newTreeId
                   treeVersion:treeVersion
                   newFilename:newFilename
            overwriteIfPresent:overwriteIfPresent
               completionBlock:successBlock
          errorCompletionBlock:failureBlock
                      cbObject:nil];
```

**Java:**

```java
String groupId = "dfsfsffsd";
String fileId = "xxxx";
int version = 1;
String newTreeId = "guid";
int treeVersion = 1;
String newFilename = "gfile";
bool overwriteIfPresent = true;
this; // implements IServerCallback

_bc.getGroupFileService().moveFile(groupId, fileId, version, newTreeId, treeVersion, newFilename, overwriteIfPresent, this);

public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
  System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
  System.out.print(String.format("Failed | %d %d %s", statusCode,  reasonCode, jsonError.toString()));
}
```

**JavaScript:**

```javascript
var groupId = "dfsfsffsd";
var fileId = "xxxx";
var version = 1;
var newTreeId = "guid";
var treeVersion = 1;
var newFilename = "gfile";
var overwriteIfPresent = true;

_bc.groupFile.moveFile(groupId, fileId, version, newTreeId, treeVersion, newFilename, overwriteIfPresent, result =>
{
  var status = result.status;
  console.log(status + " : " + JSON.stringify(result, null, 2));
});
```

**Dart:**

```dart
var  groupId = "dfsfsffsd";
var  fileId = "xxxx";
var  version = 1;
var  newTreeId = "guid";
var  treeVersion = 1;
var  newFilename = "gfile";
var  overwriteIfPresent = true;

ServerResponse result = await _bc.groupFileService.moveFile(groupId:groupId, fileId:fileId, version:version, newTreeId:newTreeId, treeVersion:treeVersion, newFilename:newFilename, overwriteIfPresent:overwriteIfPresent);

if (result.statusCode == 200) {
    print("Success");
} else {
    print("Failed ${result.error['status_message'] ?? result.error}");
}
```

**Roblox:**

```lua
local groupId = "dfsfsffsd"
local fileId = "xxxx"
local version = 1
local newTreeId = "guid"
local treeVersion = 1
local newFilename = "gfile"
local overwriteIfPresent = true

local callback = function(success, response)
    if success then
        print("Success")
    else
        print("Failed | " .. tostring(response.status_message))
    end
end

_bc.groupFile:moveFile(groupId, fileId, version, newTreeId, treeVersion, newFilename, overwriteIfPresent, callback)
```

**GDScript:**

```gdscript
var group_id = "dfsfsffsd"
var file_id = "xxxx"
var version = 1
var new_tree_id = "guid"
var tree_version = 1
var new_filename = "gfile"
var overwrite_if_present = true

var result = await _bc.group_file_service.move_file(group_id, file_id, version, new_tree_id, tree_version, new_filename, overwrite_if_present)

if result.status == 200:
	print("Success")
else:
	print("Failed: %s" % result.status_message)
```

**Lua:**

```lua
local groupId = "dfsfsffsd"
local fileId = "xxxx"
local version = 1
local newTreeId = "guid"
local treeVersion = 1
local newFilename = "gfile"
local overwriteIfPresent = true

local callback = function(success, response)
    if success then
        print("Success")
    else
        print("Failed | " .. tostring(response.status_message))
    end
end

_bc.groupFile:moveFile(groupId, fileId, version, newTreeId, treeVersion, newFilename, overwriteIfPresent, callback)
```

**Cloud Code:**

```cfscript
var groupId = "dfsfsffsd";
var fileId = "xxxx";
var version = 1;
var newTreeId = "guid";
var treeVersion = 1;
var newFilename = "gfile";
var overwriteIfPresent = true;
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.moveFile(groupId, fileId, version, newTreeId, treeVersion, newFilename, overwriteIfPresent);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "MOVE_FILE",
  "data":
  {
    "groupId": "dfsfsffsd",
    "fileId": "xxxx",
    "version": 1,
    "newTreeId": "guid",
    "treeVersion": 1,
    "newFilename": "gfile",
    "overwriteIfPresent": true
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "fileDetails": {
            "treeId": "fb3431cd-6e2f-47f1-8100-8941abf6bb4f",
            "fileName": "glognewname.json",
            "fileSize": 7051,
            "dateUploaded": 1677521119000,
            "etag": "a6f4cd3c065aed36227d3582adc5d952",
            "acl": {
                "member": 2,
                "other": 0
            },
            "version": 2,
            "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/fb3431cd-6e2f-47f1-8100-8941abf6bb4f/6d938c22-3b8c-4b99-a913-2edafed71a83/V2/glogcopy.json",
            "fileId": "6d938c22-3b8c-4b99-a913-2edafed71a83"
        },
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7"
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/groupfile/moveusertogroupfile.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/moveusertogroupfile -->

# MoveUserToGroupFile

Move a file from user space to group space.

| Service | Operation |
| ------- | --------- |
| groupFile | MOVE_USER_TO_GROUP_FILE |

## Method Parameters
Parameter | Description
--------- | -----------
userCloudPath | The user file folder.
userCloudFilename | The user file name.
groupId | The id of the group.
groupTreeId | The id of the destination folder.
groupFilename | The group file name.
overwriteIfPresent | Whether to allow overwrite of an existing file if present.
groupFileAcl | The acl of the new group file.

## Usage

**C#:**

```csharp
string userCloudPath = "dir1/dir2";
string userCloudFilename = "file";
string groupId = "dfsfsffsd";
string groupTreeId = "gpath";
string groupFilename = "gfile";
bool overwriteIfPresent = true;
string groupFileAcl = "{ \"member\": 2, \"other\": 0 }";
SuccessCallback successCallback = (response, cbObject) =>
{
  Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
  Debug.Log(string.Format("Failed | {0}  {1}  {2}", status, code, error));
};

_bc.GroupFileService.MoveUserToGroupFile(userCloudPath, userCloudFilename, groupId, groupTreeId, groupFilename, overwriteIfPresent, groupFileAcl, successCallback, failureCallback);
```

**C++:**

```cpp
const char *userCloudPath = "dir1/dir2";
const char *userCloudFilename = "file";
const char *groupId = "dfsfsffsd";
const char *groupTreeId = "gpath";
const char *groupFilename = "gfile";
bool overwriteIfPresent = true;
const char *groupFileAcl = "{ \"member\": 2, \"other\": 0 }";

_bc->getGroupFileService()->moveUserToGroupFile(userCloudPath, userCloudFilename, groupId, groupTreeId, groupFilename, overwriteIfPresent, groupFileAcl, this);
```

**Obj-C:**

```objectivec
NSString *userCloudPath = @"dir1/dir2";
NSString *userCloudFilename = @"file";
NSString *groupId = @"dfsfsffsd";
NSString *groupTreeId = @"gpath";
NSString *groupFilename = @"gfile";
bool overwriteIfPresent = true;
NSString *groupFileAcl = "{ \"member\": 2, \"other\": 0 }";
BCCompletionBlock successBlock;      // define callback
BCErrorCompletionBlock failureBlock; // define callback

[[_bc groupFileService] moveUserToGroupFile:
                 userCloudPath:userCloudPath
             userCloudFilename:userCloudFilename
                       groupId:groupId
                   groupTreeId:groupTreeId
                 groupFilename:groupFilename
            overwriteIfPresent:overwriteIfPresent
                  groupFileAcl:groupFileAcl
               completionBlock:successBlock
          errorCompletionBlock:failureBlock
                      cbObject:nil];
```

**Java:**

```java
String userCloudPath = "dir1/dir2";
String userCloudFilename = "file";
String groupId = "dfsfsffsd";
String groupTreeId = "gpath";
String groupFilename = "gfile";
bool overwriteIfPresent = true;
String groupFileAcl = "{ \"member\": 2, \"other\": 0 }";
this; // implements IServerCallback

_bc.getGroupFileService().moveUserToGroupFile(userCloudPath, userCloudFilename, groupId, groupTreeId, groupFilename, overwriteIfPresent, groupFileAcl, this);

public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
  System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
  System.out.print(String.format("Failed | %d %d %s", statusCode,  reasonCode, jsonError.toString()));
}
```

**JavaScript:**

```javascript
var userCloudPath = "dir1/dir2";
var userCloudFilename = "file";
var groupId = "dfsfsffsd";
var groupTreeId = "gpath";
var groupFilename = "gfile";
var overwriteIfPresent = true;
var groupFileAcl = {
  "member": 2,
  "other": 0
};

_bc.groupFile.moveUserToGroupFile(userCloudPath, userCloudFilename, groupId, groupTreeId, groupFilename, overwriteIfPresent, groupFileAcl, result =>
{
  var status = result.status;
  console.log(status + " : " + JSON.stringify(result, null, 2));
});
```

**Dart:**

```dart
var  userCloudPath = "dir1/dir2";
var  userCloudFilename = "file";
var  groupId = "dfsfsffsd";
var  groupTreeId = "gpath";
var  groupFilename = "gfile";
var  overwriteIfPresent = true;
var  groupFileAcl = {
  "member": 2,
  "other": 0
};

ServerResponse result = await _bc.groupFileService.moveUserToGroupFile(userCloudPath:userCloudPath, userCloudFilename:userCloudFilename, groupId:groupId, groupTreeId:groupTreeId, groupFilename:groupFilename, overwriteIfPresent:overwriteIfPresent, groupFileAcl:groupFileAcl);

if (result.statusCode == 200) {
    print("Success");
} else {
    print("Failed ${result.error['status_message'] ?? result.error}");
}
```

**Roblox:**

```lua
local userCloudPath = "dir1/dir2"
local userCloudFilename = "file"
local groupId = "dfsfsffsd"
local groupTreeId = "gpath"
local groupFilename = "gfile"
local overwriteIfPresent = true
local groupFileAcl = {
  member = 2,
  other = 0
}

local callback = function(success, response)
    if success then
        print("Success")
    else
        print("Failed | " .. tostring(response.status_message))
    end
end

_bc.groupFile:moveUserToGroupFile(userCloudPath, userCloudFilename, groupId, groupTreeId, groupFilename, groupFileAcl, overwriteIfPresent, callback)
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
local userCloudPath = "dir1/dir2"
local userCloudFilename = "file"
local groupId = "dfsfsffsd"
local groupTreeId = "gpath"
local groupFilename = "gfile"
local groupFileAcl = { member = 2, other = 0 }
local overwriteIfPresent = true

local callback = function(success, response)
    if success then
        print("Success")
    else
        print("Failed | " .. tostring(response.status_message))
    end
end

_bc.groupFile:moveUserToGroupFile(userCloudPath, userCloudFilename, groupId, groupTreeId, groupFilename, groupFileAcl, overwriteIfPresent, callback)
```

**Cloud Code:**

```cfscript
var userCloudPath = "dir1/dir2";
var userCloudFilename = "file";
var groupId = "dfsfsffsd";
var groupTreeId = "gpath";
var groupFilename = "gfile";
var overwriteIfPresent = true;
var groupFileAcl = {
  "member": 2,
  "other": 0
};
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.moveUserToGroupFile(userCloudPath, userCloudFilename, groupId, groupTreeId, groupFilename, overwriteIfPresent, groupFileAcl);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "MOVE_USER_TO_GROUP_FILE",
  "data":
  {
    "userCloudPath": "dir1/dir2",
    "userCloudFilename": "file",
    "groupId": "dfsfsffsd",
    "groupTreeId": "gpath",
    "groupFilename": "gfile",
    "overwriteIfPresent": true,
    "groupFileAcl": {
      "member": 2,
      "other": 0
    }
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "fileDetails": {
            "treeId": "40479c72-b46b-4c05-902c-239ada116acd",
            "fileName": "glog1.json",
            "fileSize": 8199,
            "dateUploaded": 1677526746000,
            "etag": "93acc8568cee7d0d0836ff6b63b549ab",
            "acl": {
                "member": 2,
                "other": 0
            },
            "version": 1,
            "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/40479c72-b46b-4c05-902c-239ada116acd/4c924070-db15-47d4-a44a-be496bb49f66/V1/glog1.json",
            "fileId": "4c924070-db15-47d4-a44a-be496bb49f66"
        },
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7"
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/groupfile/syscheckfilenameexists.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/syscheckfilenameexists -->

# SysCheckFilenameExists

Check if filename exists for provided path and name.

| Service | Operation |
| ------- | --------- |
| groupFile | SYS_CHECK_FILENAME_EXISTS |

## Method Parameters
Parameter | Description
--------- | -----------
groupId | The id of the group.
folderPath | The folder path.
filename | The file name.

## Usage

**C#:**

```csharp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**C++:**

```cpp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Obj-C:**

```objectivec
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Java:**

```java
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**JavaScript:**

```javascript
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Dart:**

```dart
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- Cloud Code only. To view example, switch to the Cloud Code tab
```

**Cloud Code:**

```cfscript
var groupId = "dfsfsffsd";
var folderPath = "";
var filename = "cccc";
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.sysCheckFilenameExists(groupId, folderPath, filename);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "SYS_CHECK_FILENAME_EXISTS",
  "data":
  {
    "groupId": "dfsfsffsd",
    "folderPath": "",
    "filename": "cccc"
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "fileDetails": {
            "treeId": "fb3431cd-6e2f-47f1-8100-8941abf6bb4f",
            "fileName": "glogcopy.json",
            "fileSize": 7051,
            "dateUploaded": 1677521119000,
            "etag": "a6f4cd3c065aed36227d3582adc5d952",
            "acl": {
                "member": 2,
                "other": 0
            },
            "version": 2,
            "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/fb3431cd-6e2f-47f1-8100-8941abf6bb4f/6d938c22-3b8c-4b99-a913-2edafed71a83/V2/glogcopy.json",
            "fileId": "6d938c22-3b8c-4b99-a913-2edafed71a83"
        },
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7",
        "exists": true
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/groupfile/syscheckfullpathfilenameexists.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/syscheckfullpathfilenameexists -->

# SysCheckFullpathFilenameExists

Check if filename exists for provided full path name.

| Service | Operation |
| ------- | --------- |
| groupFile | SYS_CHECK_FULLPATH_FILENAME_EXISTS |

## Method Parameters
Parameter | Description
--------- | -----------
groupId | The id of the group.
fullPathFilename | The full file name with path.

## Usage

**C#:**

```csharp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**C++:**

```cpp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Obj-C:**

```objectivec
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Java:**

```java
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**JavaScript:**

```javascript
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Dart:**

```dart
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- Cloud Code only. To view example, switch to the Cloud Code tab
```

**Cloud Code:**

```cfscript
var groupId = "dfsfsffsd";
var fullPathFilename = "cccc";
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.sysCheckFullpathFilenameExists(groupId, fullPathFilename);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "SYS_CHECK_FULLPATH_FILENAME_EXISTS",
  "data":
  {
    "groupId": "dfsfsffsd",
    "fullPathFilename": "cccc"
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "fileDetails": {
            "treeId": "d9e937cc-750f-4414-962c-838f1af3f34a",
            "fileName": "glog.json",
            "fileSize": 7051,
            "dateUploaded": 1677183768000,
            "etag": "08c580b36ee79773bfec4a3c51bd1b64",
            "acl": {
                "member": 2,
                "other": 0
            },
            "version": 1,
            "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/d9e937cc-750f-4414-962c-838f1af3f34a/6d938c22-3b8c-4b99-a913-2edafed71a83/V1/glog.json",
            "fileId": "6d938c22-3b8c-4b99-a913-2edafed71a83"
        },
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7",
        "exists": true
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/groupfile/syscopyfile.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/syscopyfile -->

# SysCopyFile

Copy a file.

| Service | Operation |
| ------- | --------- |
| groupFile | SYS_COPY_FILE |

## Method Parameters
Parameter | Description
--------- | -----------
groupId | The id of the group.
fileId | The id of the file.
version | The target version of the file.
newTreeId | The id of the destination folder.
treeVersion | The target version of the folder tree.
newFilename | The optional new file name.
overwriteIfPresent | Whether to allow overwrite of an existing file if present.

## Usage

**C#:**

```csharp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**C++:**

```cpp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Obj-C:**

```objectivec
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Java:**

```java
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**JavaScript:**

```javascript
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Dart:**

```dart
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- Cloud Code only. To view example, switch to the Cloud Code tab
```

**Cloud Code:**

```cfscript
var groupId = "dfsfsffsd";
var fileId = "xxxx";
var version = 1;
var newTreeId = "guid";
var treeVersion = 1;
var newFilename = "gfile";
var overwriteIfPresent = true;
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.sysCopyFile(groupId, fileId, version, newTreeId, treeVersion, newFilename, overwriteIfPresent);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "SYS_COPY_FILE",
  "data":
  {
    "groupId": "dfsfsffsd",
    "fileId": "xxxx",
    "version": 1,
    "newTreeId": "guid",
    "treeVersion": 1,
    "newFilename": "gfile",
    "overwriteIfPresent": true
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "fileDetails": {
            "treeId": "fb3431cd-6e2f-47f1-8100-8941abf6bb4f",
            "fileName": "glogcopy.json",
            "fileSize": 7051,
            "dateUploaded": 1677519200000,
            "etag": "173c2ac6f302869af8890ee32a8ccb90",
            "acl": {
                "member": 2,
                "other": 0
            },
            "version": 1,
            "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/fb3431cd-6e2f-47f1-8100-8941abf6bb4f/0554430e-51a1-44d4-b6f4-bffae67185dc/V1/glogcopy.json",
            "fileId": "0554430e-51a1-44d4-b6f4-bffae67185dc"
        },
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7"
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/groupfile/syscreatefolder.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/syscreatefolder -->

# SysCreateFolder

Create a folder in the global file tree.

| Service | Operation |
| ------- | --------- |
| groupFile | SYS_CREATE_FOLDER |

## Method Parameters
Parameter | Description
--------- | -----------
groupId | The id of the group.
folderPath | The folder path.
treeVersion | The target version of the folder tree.
name | The new folder name.
desc | The new folder description.
createInterimDirectories | Whether to automatically create folders if needed.
groupFolderAcl | The acl of the new group folder.

## Usage

**C#:**

```csharp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**C++:**

```cpp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Obj-C:**

```objectivec
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Java:**

```java
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**JavaScript:**

```javascript
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Dart:**

```dart
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- Cloud Code only. To view example, switch to the Cloud Code tab
```

**Cloud Code:**

```cfscript
var groupId = "dfsfsffsd";
var folderPath = "xxxx";
var treeVersion = 1;
var name = "fname";
var desc = "desc";
var createInterimDirectories = true;
var groupFolderAcl = {
  "member": 2,
  "other": 0
};
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.sysCreateFolder(groupId, folderPath, treeVersion, name, desc, createInterimDirectories, groupFolderAcl);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "SYS_CREATE_FOLDER",
  "data":
  {
    "groupId": "dfsfsffsd",
    "folderPath": "xxxx",
    "treeVersion": 1,
    "name": "fname",
    "desc": "desc",
    "createInterimDirectories": true,
    "groupFolderAcl": {
      "member": 2,
      "other": 0
    }
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7",
        "groupFileTree": {
            "treeVersion": 3,
            "tree": [
                {
                    "treeId": "59533e64-abc0-4f04-976b-8f395073ea2e",
                    "children": [
                        {
                            "treeId": "d9e937cc-750f-4414-962c-838f1af3f34a",
                            "children": null,
                            "name": "gpath",
                            "acl": {
                                "member": 2,
                                "other": 0
                            },
                            "type": "Folder",
                            "ownerId": null,
                            "desc": "desc"
                        }
                    ],
                    "name": "gpath",
                    "acl": {
                        "member": 2,
                        "other": 0
                    },
                    "type": "Folder",
                    "ownerId": null,
                    "desc": ""
                },
                {
                    "treeId": "40479c72-b46b-4c05-902c-239ada116acd",
                    "children": [
                        {
                            "treeId": "fb3431cd-6e2f-47f1-8100-8941abf6bb4f",
                            "children": null,
                            "name": "gpathcopy",
                            "acl": {
                                "member": 2,
                                "other": 0
                            },
                            "type": "Folder",
                            "ownerId": null,
                            "desc": "desc"
                        }
                    ],
                    "name": "gpathcopy",
                    "acl": {
                        "member": 2,
                        "other": 0
                    },
                    "type": "Folder",
                    "ownerId": null,
                    "desc": ""
                }
            ],
            "acl": {
                "member": 2,
                "other": 0
            }
        },
        "createdTreeId": "fb3431cd-6e2f-47f1-8100-8941abf6bb4f"
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/groupfile/sysdeletefile.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/sysdeletefile -->

# SysDeleteFile

Delete a file.

| Service | Operation |
| ------- | --------- |
| groupFile | SYS_DELETE_FILE |

## Method Parameters
Parameter | Description
--------- | -----------
groupId | The id of the group.
fileId | The id of the file.
version | The target version of the file.
filename | The file name for verification purposes.

## Usage

**C#:**

```csharp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**C++:**

```cpp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Obj-C:**

```objectivec
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Java:**

```java
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**JavaScript:**

```javascript
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Dart:**

```dart
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- Cloud Code only. To view example, switch to the Cloud Code tab
```

**Cloud Code:**

```cfscript
var groupId = "dfsfsffsd";
var fileId = "xxxx";
var version = 1;
var filename = "gfile";
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.sysDeleteFile(groupId, fileId, version, filename);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "SYS_DELETE_FILE",
  "data":
  {
    "groupId": "dfsfsffsd",
    "fileId": "xxxx",
    "version": 1,
    "filename": "gfile"
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "fileDetails": {
            "treeId": "fb3431cd-6e2f-47f1-8100-8941abf6bb4f",
            "fileName": "glogcopy.json",
            "version": 1,
            "fileId": "0554430e-51a1-44d4-b6f4-bffae67185dc"
        },
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7"
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/groupfile/sysdeletefolder.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/sysdeletefolder -->

# SysDeleteFolder

Delete a folder.

| Service | Operation |
| ------- | --------- |
| groupFile | SYS_DELETE_FOLDER |

## Method Parameters
Parameter | Description
--------- | -----------
groupId | The id of the group.
treeId | The id of the folder to delete.
folderPath | The folder path.
treeVersion | The target version of the folder tree.
force | Whether to delete non-empty folders, sub-folders and their files.

## Usage

**C#:**

```csharp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**C++:**

```cpp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Obj-C:**

```objectivec
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Java:**

```java
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**JavaScript:**

```javascript
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Dart:**

```dart
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- Cloud Code only. To view example, switch to the Cloud Code tab
```

**Cloud Code:**

```cfscript
var groupId = "dfsfsffsd";
var treeId = "xxxx";
var folderPath = "fname";
var treeVersion = 1;
var force = true;
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.sysDeleteFolder(groupId, treeId, folderPath, treeVersion, force);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "SYS_DELETE_FOLDER",
  "data":
  {
    "groupId": "dfsfsffsd",
    "treeId": "xxxx",
    "folderPath": "fname",
    "treeVersion": 1,
    "force": true
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "deletedFiles": [
            {
                "treeId": "fb3431cd-6e2f-47f1-8100-8941abf6bb4f",
                "fileName": "glogcopy.json",
                "version": 2,
                "fileId": "6d938c22-3b8c-4b99-a913-2edafed71a83"
            },
            {
                "treeId": "fb3431cd-6e2f-47f1-8100-8941abf6bb4f",
                "fileName": "glogcopy1.json",
                "version": 1,
                "fileId": "4fde0d32-c866-473b-bee1-a4565f8d289b"
            }
        ],
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7",
        "groupFileTree": {
            "treeVersion": 6,
            "tree": [
                {
                    "treeId": "59533e64-abc0-4f04-976b-8f395073ea2e",
                    "children": [
                        {
                            "treeId": "d9e937cc-750f-4414-962c-838f1af3f34a",
                            "children": null,
                            "name": "gpath",
                            "acl": {
                                "member": 2,
                                "other": 0
                            },
                            "type": "Folder",
                            "ownerId": null,
                            "desc": "desc"
                        }
                    ],
                    "name": "gpath",
                    "acl": {
                        "member": 2,
                        "other": 0
                    },
                    "type": "Folder",
                    "ownerId": null,
                    "desc": ""
                },
                {
                    "treeId": "40479c72-b46b-4c05-902c-239ada116acd",
                    "children": null,
                    "name": "gpathcopy",
                    "acl": {
                        "member": 2,
                        "other": 0
                    },
                    "type": "Folder",
                    "ownerId": null,
                    "desc": ""
                },
                {
                    "treeId": "97446e50-4e02-49f6-8c86-807137620249",
                    "children": [
                        {
                            "treeId": "625ab492-fad9-4aa6-b174-50ac4344de81",
                            "children": null,
                            "name": "subfoldername",
                            "acl": {
                                "member": 2,
                                "other": 0
                            },
                            "type": "Folder",
                            "ownerId": null,
                            "desc": "subfolderdesc"
                        }
                    ],
                    "name": "foldername",
                    "acl": {
                        "member": 2,
                        "other": 0
                    },
                    "type": "Folder",
                    "ownerId": null,
                    "desc": "folderdesc"
                }
            ],
            "acl": {
                "member": 2,
                "other": 0
            }
        }
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/groupfile/sysgetcdnurl.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/sysgetcdnurl -->

# SysGetCDNUrl

Return CDN url for file for clients that cannot handle redirect.

| Service | Operation |
| ------- | --------- |
| groupFile | SYS_GET_CDN_URL |

## Method Parameters
Parameter | Description
--------- | -----------
groupId | The id of the group.
fileId | The id of the file.

## Usage

**C#:**

```csharp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**C++:**

```cpp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Obj-C:**

```objectivec
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Java:**

```java
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**JavaScript:**

```javascript
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Dart:**

```dart
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- Cloud Code only. To view example, switch to the Cloud Code tab
```

**Cloud Code:**

```cfscript
var groupId = "dfsfsffsd";
var fileId = "fdsgfg";
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.sysGetCDNUrl(groupId, fileId);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "SYS_GET_CDN_URL",
  "data":
  {
    "groupId": "dfsfsffsd",
    "fileId": "fdsgfg"
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "cdnUrl": "https://cdn-2022-internal.braincloudservers.com/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/d9e937cc-750f-4414-962c-838f1af3f34a/6d938c22-3b8c-4b99-a913-2edafed71a83/V1/glog.json?Expires=1677524402&Signature=Cymd~D94yLPZy4CKyn7FwRxmIvOY9YaHGqL6sMoGCkK8EmZOxXcKAztYZPZRFZdyHlWMhF8lpwasJFxiq6oOAwSEsjtQrHzs4tzO17QBzoLHabqH37H1Rre2LybmdIgVu5h7k3iFuggBvXt5QR1oTMEZPJ1Wn5TAaByj0VywfXkx2eXxKnIBm1JkccjP~IAjC9may22QduZNWivTQuu2jZG5bdjq3x96BWUMbgON2XWfyZCqSV4OFKeIN2LCc-QR2OvL6x-4VJF1nepBXOkvX-oC~WpkbEJ21ARZ9wtKhTubA~UAq0THmmR-PZb070NeSdh4OYsEeDUSXraaob7E6Q__&Key-Pair-Id=KG07XY8JT6H1V",
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7",
        "appServerUrl": "https://api.internal.braincloudservers.com/files/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/d9e937cc-750f-4414-962c-838f1af3f34a/6d938c22-3b8c-4b99-a913-2edafed71a83/V1/glog.json"
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/groupfile/sysgetfileinfo.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/sysgetfileinfo -->

# SysGetFileInfo

Returns information on a file using fileId.

| Service | Operation |
| ------- | --------- |
| groupFile | SYS_GET_FILE_INFO |

## Method Parameters
Parameter | Description
--------- | -----------
groupId | The id of the group.
fileId | The id of the file.

## Usage

**C#:**

```csharp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**C++:**

```cpp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Obj-C:**

```objectivec
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Java:**

```java
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**JavaScript:**

```javascript
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Dart:**

```dart
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- Cloud Code only. To view example, switch to the Cloud Code tab
```

**Cloud Code:**

```cfscript
var groupId = "dfsfsffsd";
var fileId = "guid";
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.sysGetFileInfo(groupId, fileId);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "SYS_GET_FILE_INFO",
  "data":
  {
    "groupId": "dfsfsffsd",
    "fileId": "guid"
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "fileDetails": {
            "treeId": "d9e937cc-750f-4414-962c-838f1af3f34a",
            "fileName": "glog.json",
            "fileSize": 7051,
            "dateUploaded": 1677183768000,
            "etag": "08c580b36ee79773bfec4a3c51bd1b64",
            "acl": {
                "member": 2,
                "other": 0
            },
            "version": 1,
            "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/d9e937cc-750f-4414-962c-838f1af3f34a/6d938c22-3b8c-4b99-a913-2edafed71a83/V1/glog.json",
            "fileId": "6d938c22-3b8c-4b99-a913-2edafed71a83"
        },
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7"
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/groupfile/sysgetfileinfosimple.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/sysgetfileinfosimple -->

# SysGetFileInfoSimple

Returns information on a file using path and name.

| Service | Operation |
| ------- | --------- |
| groupFile | SYS_GET_FILE_INFO_SIMPLE |

## Method Parameters
Parameter | Description
--------- | -----------
groupId | The id of the group.
folderPath | The folder path.
filename | The file name.

## Usage

**C#:**

```csharp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**C++:**

```cpp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Obj-C:**

```objectivec
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Java:**

```java
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**JavaScript:**

```javascript
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Dart:**

```dart
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- Cloud Code only. To view example, switch to the Cloud Code tab
```

**Cloud Code:**

```cfscript
var groupId = "dfsfsffsd";
var folderPath = "";
var filename = "cccc";
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.sysGetFileInfoSimple(groupId, folderPath, filename);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "SYS_GET_FILE_INFO_SIMPLE",
  "data":
  {
    "groupId": "dfsfsffsd",
    "folderPath": "",
    "filename": "cccc"
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "fileDetails": {
            "treeId": "d9e937cc-750f-4414-962c-838f1af3f34a",
            "fileName": "glog.json",
            "fileSize": 7051,
            "dateUploaded": 1677183768000,
            "etag": "08c580b36ee79773bfec4a3c51bd1b64",
            "acl": {
                "member": 2,
                "other": 0
            },
            "version": 1,
            "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/d9e937cc-750f-4414-962c-838f1af3f34a/6d938c22-3b8c-4b99-a913-2edafed71a83/V1/glog.json",
            "fileId": "6d938c22-3b8c-4b99-a913-2edafed71a83"
        },
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7"
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/groupfile/sysgetfilelist.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/sysgetfilelist -->

# SysGetFileList

Returns a list of files.

| Service | Operation |
| ------- | --------- |
| groupFile | SYS_GET_FILE_LIST |

## Method Parameters
Parameter | Description
--------- | -----------
groupId | The id of the group.
folderPath | The folder path.
recurse | Whether to recurse beyond the starting folder.

## Usage

**C#:**

```csharp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**C++:**

```cpp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Obj-C:**

```objectivec
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Java:**

```java
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**JavaScript:**

```javascript
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Dart:**

```dart
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- Cloud Code only. To view example, switch to the Cloud Code tab
```

**Cloud Code:**

```cfscript
var groupId = "dfsfsffsd";
var folderPath = "";
var recurse = true;
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.sysGetFileList(groupId, folderPath, recurse);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "SYS_GET_FILE_LIST",
  "data":
  {
    "groupId": "dfsfsffsd",
    "folderPath": "",
    "recurse": true
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "treeVersion": 5,
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7",
        "fileList": {
            "folderPath": "/",
            "treeId": "",
            "folders": {
                "gpathcopy": {
                    "folderPath": "/gpathcopy/",
                    "treeId": "40479c72-b46b-4c05-902c-239ada116acd",
                    "folders": {
                        "gpathcopy": {
                            "folderPath": "/gpathcopy/gpathcopy/",
                            "treeId": "fb3431cd-6e2f-47f1-8100-8941abf6bb4f",
                            "folders": {},
                            "name": "gpathcopy",
                            "files": {
                                "glogcopy.json": {
                                    "fileName": "glogcopy.json",
                                    "fileSize": 7051,
                                    "dateUploaded": 1677521119000,
                                    "acl": {
                                        "member": 2,
                                        "other": 0
                                    },
                                    "version": 2,
                                    "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/fb3431cd-6e2f-47f1-8100-8941abf6bb4f/6d938c22-3b8c-4b99-a913-2edafed71a83/V2/glogcopy.json",
                                    "fileId": "6d938c22-3b8c-4b99-a913-2edafed71a83"
                                },
                                "glogcopy1.json": {
                                    "fileName": "glogcopy1.json",
                                    "fileSize": 7051,
                                    "dateUploaded": 1677527426000,
                                    "acl": {
                                        "member": 2,
                                        "other": 0
                                    },
                                    "version": 1,
                                    "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/fb3431cd-6e2f-47f1-8100-8941abf6bb4f/4fde0d32-c866-473b-bee1-a4565f8d289b/V1/glogcopy1.json",
                                    "fileId": "4fde0d32-c866-473b-bee1-a4565f8d289b"
                                }
                            },
                            "totalFileSize": 14102,
                            "acl": {
                                "member": 2,
                                "other": 0
                            },
                            "totalFileCount": 2,
                            "desc": "desc"
                        }
                    },
                    "name": "gpathcopy",
                    "files": {
                        "glog1newname.json": {
                            "fileName": "glog1newname.json",
                            "fileSize": 8199,
                            "dateUploaded": 1677526746000,
                            "acl": {
                                "member": 2,
                                "other": 0
                            },
                            "version": 2,
                            "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/40479c72-b46b-4c05-902c-239ada116acd/4c924070-db15-47d4-a44a-be496bb49f66/V2/glog1newname.json",
                            "fileId": "4c924070-db15-47d4-a44a-be496bb49f66"
                        }
                    },
                    "totalFileSize": 22301,
                    "acl": {
                        "member": 2,
                        "other": 0
                    },
                    "totalFileCount": 3,
                    "desc": ""
                },
                "gpath": {
                    "folderPath": "/gpath/",
                    "treeId": "59533e64-abc0-4f04-976b-8f395073ea2e",
                    "folders": {
                        "gpath": {
                            "folderPath": "/gpath/gpath/",
                            "treeId": "d9e937cc-750f-4414-962c-838f1af3f34a",
                            "folders": {},
                            "name": "gpath",
                            "files": {},
                            "totalFileSize": 0,
                            "acl": {
                                "member": 2,
                                "other": 0
                            },
                            "totalFileCount": 0,
                            "desc": "desc"
                        }
                    },
                    "name": "gpath",
                    "files": {},
                    "totalFileSize": 0,
                    "acl": {
                        "member": 2,
                        "other": 0
                    },
                    "totalFileCount": 0,
                    "desc": ""
                },
                "foldername": {
                    "folderPath": "/foldername/",
                    "treeId": "97446e50-4e02-49f6-8c86-807137620249",
                    "folders": {
                        "subfoldername": {
                            "folderPath": "/foldername/subfoldername/",
                            "treeId": "625ab492-fad9-4aa6-b174-50ac4344de81",
                            "folders": {},
                            "name": "subfoldername",
                            "files": {
                                "glogcopy1sub.json": {
                                    "fileName": "glogcopy1sub.json",
                                    "fileSize": 7051,
                                    "dateUploaded": 1677528007000,
                                    "acl": {
                                        "member": 2,
                                        "other": 0
                                    },
                                    "version": 1,
                                    "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/625ab492-fad9-4aa6-b174-50ac4344de81/7fcd9c06-c02f-43c7-8df7-db3d4f8207f0/V1/glogcopy1sub.json",
                                    "fileId": "7fcd9c06-c02f-43c7-8df7-db3d4f8207f0"
                                }
                            },
                            "totalFileSize": 7051,
                            "acl": {
                                "member": 2,
                                "other": 0
                            },
                            "totalFileCount": 1,
                            "desc": "subfolderdesc"
                        }
                    },
                    "name": "foldername",
                    "files": {},
                    "totalFileSize": 7051,
                    "acl": {
                        "member": 2,
                        "other": 0
                    },
                    "totalFileCount": 1,
                    "desc": "folderdesc"
                }
            },
            "name": "",
            "files": {
                "glogroot.json": {
                    "fileName": "glogroot.json",
                    "fileSize": 7051,
                    "dateUploaded": 1677528268000,
                    "acl": {
                        "member": 2,
                        "other": 0
                    },
                    "version": 1,
                    "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/df272294-b0ba-4840-90b7-bc97c4c0ce9b/V1/glogroot.json",
                    "fileId": "df272294-b0ba-4840-90b7-bc97c4c0ce9b"
                }
            },
            "totalFileSize": 36403,
            "acl": {
                "member": 2,
                "other": 0
            },
            "totalFileCount": 5,
            "desc": null
        }
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/groupfile/syslookupfolder.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/syslookupfolder -->

# SysLookupFolder

Retrieves tree id of specified folder.

| Service | Operation |
| ------- | --------- |
| groupFile | SYS_LOOKUP_FOLDER |

## Method Parameters
Parameter | Description
--------- | -----------
groupId | The id of the group.
fullFolderPath | The full folder path.

## Usage

**C#:**

```csharp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**C++:**

```cpp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Obj-C:**

```objectivec
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Java:**

```java
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**JavaScript:**

```javascript
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Dart:**

```dart
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- Cloud Code only. To view example, switch to the Cloud Code tab
```

**Cloud Code:**

```cfscript
var groupId = "dfsfsffsd";
var fullFolderPath = "dir1/dir2";
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.sysLookupFolder(groupId, fullFolderPath);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "SYS_LOOKUP_FOLDER",
  "data":
  {
    "groupId": "dfsfsffsd",
    "fullFolderPath": "dir1/dir2"
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "folderPath": "foldername/subfoldername",
        "treeId": "625ab492-fad9-4aa6-b174-50ac4344de81",
        "treeVersion": 5,
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7"
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/groupfile/sysmovefile.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/sysmovefile -->

# SysMoveFile

Move a file.

| Service | Operation |
| ------- | --------- |
| groupFile | SYS_MOVE_FILE |

## Method Parameters
Parameter | Description
--------- | -----------
groupId | The id of the group.
fileId | The id of the file.
version | The target version of the file.
newTreeId | The id of the destination folder.
treeVersion | The target version of the folder tree.
newFilename | The optional new file name.
overwriteIfPresent | Whether to allow overwrite of an existing file if present.

## Usage

**C#:**

```csharp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**C++:**

```cpp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Obj-C:**

```objectivec
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Java:**

```java
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**JavaScript:**

```javascript
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Dart:**

```dart
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- Cloud Code only. To view example, switch to the Cloud Code tab
```

**Cloud Code:**

```cfscript
var groupId = "dfsfsffsd";
var fileId = "xxxx";
var version = 1;
var newTreeId = "guid";
var treeVersion = 1;
var newFilename = "gfile";
var overwriteIfPresent = true;
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.sysMoveFile(groupId, fileId, version, newTreeId, treeVersion, newFilename, overwriteIfPresent);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "SYS_MOVE_FILE",
  "data":
  {
    "groupId": "dfsfsffsd",
    "fileId": "xxxx",
    "version": 1,
    "newTreeId": "guid",
    "treeVersion": 1,
    "newFilename": "gfile",
    "overwriteIfPresent": true
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "fileDetails": {
            "treeId": "fb3431cd-6e2f-47f1-8100-8941abf6bb4f",
            "fileName": "glognewname.json",
            "fileSize": 7051,
            "dateUploaded": 1677521119000,
            "etag": "a6f4cd3c065aed36227d3582adc5d952",
            "acl": {
                "member": 2,
                "other": 0
            },
            "version": 2,
            "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/fb3431cd-6e2f-47f1-8100-8941abf6bb4f/6d938c22-3b8c-4b99-a913-2edafed71a83/V2/glogcopy.json",
            "fileId": "6d938c22-3b8c-4b99-a913-2edafed71a83"
        },
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7"
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/groupfile/sysmovefolder.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/sysmovefolder -->

# SysMoveFolder

Move a folder in the global file tree.

| Service | Operation |
| ------- | --------- |
| groupFile | SYS_MOVE_FOLDER |

## Method Parameters
Parameter | Description
--------- | -----------
groupId | The id of the group.
treeId | The id of the source folder.
treeVersion | The target version of the folder tree.
newFolderPath | The destination folder path.
updatedName | The optional new name of the folder.
createInterimDirectories | Whether to automatically create folders if needed.

## Usage

**C#:**

```csharp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**C++:**

```cpp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Obj-C:**

```objectivec
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Java:**

```java
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**JavaScript:**

```javascript
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Dart:**

```dart
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- Cloud Code only. To view example, switch to the Cloud Code tab
```

**Cloud Code:**

```cfscript
var groupId = "dfsfsffsd";
var treeId = "guid";
var treeVersion = 1;
var newFolderPath = "xxxx";
var updatedName = "fname";
var createInterimDirectories = true;
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.sysMoveFolder(groupId, treeId, treeVersion, newFolderPath, updatedName, createInterimDirectories);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "SYS_MOVE_FOLDER",
  "data":
  {
    "groupId": "dfsfsffsd",
    "treeId": "guid",
    "treeVersion": 1,
    "newFolderPath": "xxxx",
    "updatedName": "fname",
    "createInterimDirectories": true
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7",
        "groupFileTree": {
            "treeVersion": 7,
            "tree": [
                {
                    "treeId": "59533e64-abc0-4f04-976b-8f395073ea2e",
                    "children": [
                        {
                            "treeId": "d9e937cc-750f-4414-962c-838f1af3f34a",
                            "children": null,
                            "name": "gpath",
                            "acl": {
                                "member": 2,
                                "other": 0
                            },
                            "type": "Folder",
                            "ownerId": null,
                            "desc": "desc"
                        }
                    ],
                    "name": "gpath",
                    "acl": {
                        "member": 2,
                        "other": 0
                    },
                    "type": "Folder",
                    "ownerId": null,
                    "desc": ""
                },
                {
                    "treeId": "97446e50-4e02-49f6-8c86-807137620249",
                    "children": [
                        {
                            "treeId": "625ab492-fad9-4aa6-b174-50ac4344de81",
                            "children": null,
                            "name": "subfoldername",
                            "acl": {
                                "member": 2,
                                "other": 0
                            },
                            "type": "Folder",
                            "ownerId": null,
                            "desc": "subfolderdesc"
                        }
                    ],
                    "name": "foldername",
                    "acl": {
                        "member": 2,
                        "other": 0
                    },
                    "type": "Folder",
                    "ownerId": null,
                    "desc": "folderdesc"
                },
                {
                    "treeId": "4baff7ed-c5ce-4058-b4d9-2ef04a662ceb",
                    "children": [
                        {
                            "treeId": "40479c72-b46b-4c05-902c-239ada116acd",
                            "children": null,
                            "name": "movedfolder",
                            "acl": {
                                "member": 2,
                                "other": 0
                            },
                            "type": "Folder",
                            "ownerId": null,
                            "desc": ""
                        }
                    ],
                    "name": "subfoldername",
                    "acl": {
                        "member": 2,
                        "other": 0
                    },
                    "type": "Folder",
                    "ownerId": null,
                    "desc": ""
                }
            ],
            "acl": {
                "member": 2,
                "other": 0
            }
        }
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/groupfile/sysmoveusertogroupfile.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/sysmoveusertogroupfile -->

# SysMoveUserToGroupFile

Move a file from user space to group space.

| Service | Operation |
| ------- | --------- |
| groupFile | SYS_MOVE_USER_TO_GROUP_FILE |

## Method Parameters
Parameter | Description
--------- | -----------
userProfileId | The user file owner.
userCloudPath | The user file folder.
userCloudFilename | The user file name.
groupId | The id of the group.
groupTreeId | The id of the destination folder.
groupFilename | The group file name.
groupFileOwnerId | The optional owner id of of the new group file.
overwriteIfPresent | Whether to allow overwrite of an existing file if present.
groupFileAcl | The acl of the new group file.

## Usage

**C#:**

```csharp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**C++:**

```cpp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Obj-C:**

```objectivec
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Java:**

```java
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**JavaScript:**

```javascript
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Dart:**

```dart
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- Cloud Code only. To view example, switch to the Cloud Code tab
```

**Cloud Code:**

```cfscript
var userProfileId = "xxxx";
var userCloudPath = "dir1/dir2";
var userCloudFilename = "file";
var groupId = "dfsfsffsd";
var groupTreeId = "gpath";
var groupFilename = "gfile";
var groupFileOwnerId = "gfile";
var overwriteIfPresent = true;
var groupFileAcl = {
  "member": 2,
  "other": 0
};
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.sysMoveUserToGroupFile(userProfileId, userCloudPath, userCloudFilename, groupId, groupTreeId, groupFilename, groupFileOwnerId, overwriteIfPresent, groupFileAcl);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "SYS_MOVE_USER_TO_GROUP_FILE",
  "data":
  {
    "userProfileId": "xxxx",
    "userCloudPath": "dir1/dir2",
    "userCloudFilename": "file",
    "groupId": "dfsfsffsd",
    "groupTreeId": "gpath",
    "groupFilename": "gfile",
    "groupFileOwnerId": "gfile",
    "overwriteIfPresent": true,
    "groupFileAcl": {
      "member": 2,
      "other": 0
    }
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "fileDetails": {
            "treeId": "40479c72-b46b-4c05-902c-239ada116acd",
            "fileName": "glog1.json",
            "fileSize": 8199,
            "dateUploaded": 1677526746000,
            "etag": "93acc8568cee7d0d0836ff6b63b549ab",
            "acl": {
                "member": 2,
                "other": 0
            },
            "version": 1,
            "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/40479c72-b46b-4c05-902c-239ada116acd/4c924070-db15-47d4-a44a-be496bb49f66/V1/glog1.json",
            "fileId": "4c924070-db15-47d4-a44a-be496bb49f66"
        },
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7"
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/groupfile/sysupdatefileinfo.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/sysupdatefileinfo -->

# SysUpdateFileInfo

Returns information on a file using fileId.

| Service | Operation |
| ------- | --------- |
| groupFile | SYS_UPDATE_FILE_INFO |

## Method Parameters
Parameter | Description
--------- | -----------
groupId | The id of the group.
fileId | The id of the file.
version | The target version of the file.
newFilename | The optional new file name.
newAcl | The optional new acl.

## Usage

**C#:**

```csharp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**C++:**

```cpp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Obj-C:**

```objectivec
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Java:**

```java
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**JavaScript:**

```javascript
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Dart:**

```dart
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- Cloud Code only. To view example, switch to the Cloud Code tab
```

**Cloud Code:**

```cfscript
var groupId = "dfsfsffsd";
var fileId = "guid";
var version = 1;
var newFilename = "cccc";
var newAcl = {
  "member": 2,
  "other": 0
};
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.sysUpdateFileInfo(groupId, fileId, version, newFilename, newAcl);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "SYS_UPDATE_FILE_INFO",
  "data":
  {
    "groupId": "dfsfsffsd",
    "fileId": "guid",
    "version": 1,
    "newFilename": "cccc",
    "newAcl": {
      "member": 2,
      "other": 0
    }
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "fileDetails": {
            "treeId": "40479c72-b46b-4c05-902c-239ada116acd",
            "fileName": "glog1newname.json",
            "fileSize": 8199,
            "dateUploaded": 1677526746000,
            "etag": "93acc8568cee7d0d0836ff6b63b549ab",
            "acl": {
                "member": 2,
                "other": 0
            },
            "version": 2,
            "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/40479c72-b46b-4c05-902c-239ada116acd/4c924070-db15-47d4-a44a-be496bb49f66/V2/glog1newname.json",
            "fileId": "4c924070-db15-47d4-a44a-be496bb49f66"
        },
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7"
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/groupfile/sysupdatefolder.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/sysupdatefolder -->

# SysUpdateFolder

Update a folder in the group file tree.

| Service | Operation |
| ------- | --------- |
| groupFile | SYS_UPDATE_FOLDER |

## Method Parameters
Parameter | Description
--------- | -----------
groupId | The id of the group.
treeId | The id of the folder to update.
treeVersion | The target version of the folder tree.
updatedName | The optional new name of the folder.
updatedDesc | The optional new description of the folder.
updatedAcl | The optional new acl of the folder.

## Usage

**C#:**

```csharp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**C++:**

```cpp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Obj-C:**

```objectivec
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Java:**

```java
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**JavaScript:**

```javascript
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Dart:**

```dart
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- Cloud Code only. To view example, switch to the Cloud Code tab
```

**Cloud Code:**

```cfscript
var groupId = "dfsfsffsd";
var treeId = "guid";
var treeVersion = 1;
var updatedName = "fname";
var updatedDesc = "desc";
var updatedAcl = {
  "member": 2,
  "other": 0
};
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.sysUpdateFolder(groupId, treeId, treeVersion, updatedName, updatedDesc, updatedAcl);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "SYS_UPDATE_FOLDER",
  "data":
  {
    "groupId": "dfsfsffsd",
    "treeId": "guid",
    "treeVersion": 1,
    "updatedName": "fname",
    "updatedDesc": "desc",
    "updatedAcl": {
      "member": 2,
      "other": 0
    }
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7",
        "groupFileTree": {
            "treeVersion": 8,
            "tree": [
                {
                    "treeId": "59533e64-abc0-4f04-976b-8f395073ea2e",
                    "children": [
                        {
                            "treeId": "d9e937cc-750f-4414-962c-838f1af3f34a",
                            "children": null,
                            "name": "gpath",
                            "acl": {
                                "member": 2,
                                "other": 0
                            },
                            "type": "Folder",
                            "ownerId": null,
                            "desc": "desc"
                        }
                    ],
                    "name": "gpath",
                    "acl": {
                        "member": 2,
                        "other": 0
                    },
                    "type": "Folder",
                    "ownerId": null,
                    "desc": ""
                },
                {
                    "treeId": "97446e50-4e02-49f6-8c86-807137620249",
                    "children": [
                        {
                            "treeId": "625ab492-fad9-4aa6-b174-50ac4344de81",
                            "children": null,
                            "name": "subfoldername",
                            "acl": {
                                "member": 2,
                                "other": 0
                            },
                            "type": "Folder",
                            "ownerId": null,
                            "desc": "subfolderdesc"
                        }
                    ],
                    "name": "foldername",
                    "acl": {
                        "member": 2,
                        "other": 0
                    },
                    "type": "Folder",
                    "ownerId": null,
                    "desc": "folderdesc"
                },
                {
                    "treeId": "4baff7ed-c5ce-4058-b4d9-2ef04a662ceb",
                    "children": [
                        {
                            "treeId": "40479c72-b46b-4c05-902c-239ada116acd",
                            "children": null,
                            "name": "foldernewname",
                            "acl": {
                                "member": 1,
                                "other": 0
                            },
                            "type": "Folder",
                            "ownerId": null,
                            "desc": ""
                        }
                    ],
                    "name": "subfoldername",
                    "acl": {
                        "member": 2,
                        "other": 0
                    },
                    "type": "Folder",
                    "ownerId": null,
                    "desc": ""
                }
            ],
            "acl": {
                "member": 2,
                "other": 0
            }
        }
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/groupfile/updatefileinfo.md -->
<!-- url: https://docs.braincloudservers.com/api/capi/groupfile/updatefileinfo -->

# UpdateFileInfo

Returns information on a file using fileId.

| Service | Operation |
| ------- | --------- |
| groupFile | UPDATE_FILE_INFO |

## Method Parameters
Parameter | Description
--------- | -----------
groupId | The id of the group.
fileId | The id of the file.
version | The target version of the file.
newFilename | The optional new file name.
newAcl | The optional new acl.

## Usage

**C#:**

```csharp
string groupId = "dfsfsffsd";
string fileId = "guid";
int version = 1;
string newFilename = "cccc";
string newAcl = "{ \"member\": 2, \"other\": 0 }";
SuccessCallback successCallback = (response, cbObject) =>
{
  Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
  Debug.Log(string.Format("Failed | {0}  {1}  {2}", status, code, error));
};

_bc.GroupFileService.UpdateFileInfo(groupId, fileId, version, newFilename, newAcl, successCallback, failureCallback);
```

**C++:**

```cpp
const char *groupId = "dfsfsffsd";
const char *fileId = "guid";
int version = 1;
const char *newFilename = "cccc";
const char *newAcl = "{ \"member\": 2, \"other\": 0 }";

_bc->getGroupFileService()->updateFileInfo(groupId, fileId, version, newFilename, newAcl, this);
```

**Obj-C:**

```objectivec
NSString *groupId = @"dfsfsffsd";
NSString *fileId = @"guid";
int version = 1;
NSString *newFilename = @"cccc";
NSString *newAcl = "{ \"member\": 2, \"other\": 0 }";
BCCompletionBlock successBlock;      // define callback
BCErrorCompletionBlock failureBlock; // define callback

[[_bc groupFileService] updateFileInfo:
                       groupId:groupId
                        fileId:fileId
                       version:version
                   newFilename:newFilename
                        newAcl:newAcl
               completionBlock:successBlock
          errorCompletionBlock:failureBlock
                      cbObject:nil];
```

**Java:**

```java
String groupId = "dfsfsffsd";
String fileId = "guid";
int version = 1;
String newFilename = "cccc";
String newAcl = "{ \"member\": 2, \"other\": 0 }";
this; // implements IServerCallback

_bc.getGroupFileService().updateFileInfo(groupId, fileId, version, newFilename, newAcl, this);

public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
  System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
  System.out.print(String.format("Failed | %d %d %s", statusCode,  reasonCode, jsonError.toString()));
}
```

**JavaScript:**

```javascript
var groupId = "dfsfsffsd";
var fileId = "guid";
var version = 1;
var newFilename = "cccc";
var newAcl = {
  "member": 2,
  "other": 0
};

_bc.groupFile.updateFileInfo(groupId, fileId, version, newFilename, newAcl, result =>
{
  var status = result.status;
  console.log(status + " : " + JSON.stringify(result, null, 2));
});
```

**Dart:**

```dart
var  groupId = "dfsfsffsd";
var  fileId = "guid";
var  version = 1;
var  newFilename = "cccc";
var  newAcl = {
  "member": 2,
  "other": 0
};

ServerResponse result = await _bc.groupFileService.updateFileInfo(groupId:groupId, fileId:fileId, version:version, newFilename:newFilename, newAcl:newAcl);

if (result.statusCode == 200) {
    print("Success");
} else {
    print("Failed ${result.error['status_message'] ?? result.error}");
}
```

**Roblox:**

```lua
local groupId = "dfsfsffsd"
local fileId = "guid"
local version = 1
local newFilename = "cccc"
local newAcl = {
  member = 2,
  other = 0
}

local callback = function(success, response)
    if success then
        print("Success")
    else
        print("Failed | " .. tostring(response.status_message))
    end
end

_bc.groupFile:updateFileInfo(groupId, fileId, version, newFilename, newAcl, callback)
```

**GDScript:**

```gdscript
var group_id = "dfsfsffsd"
var file_id = "guid"
var version = 1
var new_filename = "cccc"
var new_acl = {
  "member": 2,
  "other": 0
}

var result = await _bc.group_file_service.update_file_info(group_id, file_id, version, new_filename, new_acl)

if result.status == 200:
	print("Success")
else:
	print("Failed: %s" % result.status_message)
```

**Lua:**

```lua
local groupId = "dfsfsffsd"
local fileId = "guid"
local version = 1
local newFilename = "cccc"
local newAcl = { member = 2, other = 0 }

local callback = function(success, response)
    if success then
        print("Success")
    else
        print("Failed | " .. tostring(response.status_message))
    end
end

_bc.groupFile:updateFileInfo(groupId, fileId, version, newFilename, newAcl, callback)
```

**Cloud Code:**

```cfscript
var groupId = "dfsfsffsd";
var fileId = "guid";
var version = 1;
var newFilename = "cccc";
var newAcl = {
  "member": 2,
  "other": 0
};
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.updateFileInfo(groupId, fileId, version, newFilename, newAcl);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "UPDATE_FILE_INFO",
  "data":
  {
    "groupId": "dfsfsffsd",
    "fileId": "guid",
    "version": 1,
    "newFilename": "cccc",
    "newAcl": {
      "member": 2,
      "other": 0
    }
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "fileDetails": {
            "treeId": "40479c72-b46b-4c05-902c-239ada116acd",
            "fileName": "glog1newname.json",
            "fileSize": 8199,
            "dateUploaded": 1677526746000,
            "etag": "93acc8568cee7d0d0836ff6b63b549ab",
            "acl": {
                "member": 2,
                "other": 0
            },
            "version": 2,
            "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/40479c72-b46b-4c05-902c-239ada116acd/4c924070-db15-47d4-a44a-be496bb49f66/V2/glog1newname.json",
            "fileId": "4c924070-db15-47d4-a44a-be496bb49f66"
        },
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7"
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/4_s2s/groupfile/index.md -->
<!-- url: https://docs.braincloudservers.com/api/s2s/groupfile -->

# Group File

**Group Files** add the ability for Groups to own files, which are similar to Group Entities -- in that they are associated with, and potentially private to, a specific group.

Group files support ACL permissions are similar to Group Entities - so that access permissions can be specified according to "owner", "member" or "other".

Group Files features include:

* folder structure within a group
* ACL permissions at folder and file levels
* operations for creating, moving and deleting folders
* operations for moving, copying and deleting files
* ability to copy/move user files to group files
  
> **Tip:** Like user files, group files will not be migrated to downstream apps during deployment.

### API Summary

#### Bypassing ACL for System Calls
* [SysCheckFilenameExists](/api/capi/groupfile/syscheckfilenameexists) - Check if filename exists for provided path and name.
* [SysCheckFullpathFilenameExists](/api/capi/groupfile/syscheckfullpathfilenameexists) - Check if filename exists for provided full path name.
* [SysGetFileInfo](/api/capi/groupfile/sysgetfileinfo) - Returns information on a file using fileId.
* [SysGetFileInfoSimple](/api/capi/groupfile/sysgetfileinfosimple) - Returns information on a file using path and name.
* [SysGetFileList](/api/capi/groupfile/sysgetfilelist) - Returns a list of files.
* [SysGetCDNUrl](/api/capi/groupfile/sysgetcdnurl) - Return CDN url for file for clients that cannot handle redirect.
* [SysUpdateFileInfo](/api/capi/groupfile/sysupdatefileinfo) - Returns information on a file using fileId.
* [SysCopyFile](/api/capi/groupfile/syscopyfile) - Copy a file.
* [SysMoveFile](/api/capi/groupfile/sysmovefile) - Move a file.
* [SysDeleteFile](/api/capi/groupfile/sysdeletefile) - Delete a file.
* [SysMoveUserToGroupFile](/api/capi/groupfile/sysmoveusertogroupfile) - Move a file from user space to group space.

### Folder Management for System Calls
* [SysCreateFolder](/api/capi/groupfile/syscreatefolder) - Create a folder in the global file tree.
* [SysMoveFolder](/api/capi/groupfile/sysmovefolder) - Move a folder in the global file tree.
* [SysUpdateFolder](/api/capi/groupfile/sysupdatefolder) - Update a folder in the group file tree.
* [SysLookupFolder](/api/capi/groupfile/syslookupfolder) - Retrieves tree id of specified folder.
* [SysDeleteFolder](/api/capi/groupfile/sysdeletefolder) - Delete a folder.

> **Tip:** All the client APIs that the names beigin with <strong>"Sys"</strong> <em>are</em> also available to S2S.
> For the usages of the S2S groupFile APIs (if they are not listed at this section),
> refer to brainCloud client [groupFile](/api/capi/groupfile) APIs.


---

<!-- source: docs/api/4_s2s/groupfile/syscheckfilenameexists.md -->
<!-- url: https://docs.braincloudservers.com/api/s2s/groupfile/syscheckfilenameexists -->

# SysCheckFilenameExists

Check if filename exists for provided path and name.

| Service | Operation |
| ------- | --------- |
| groupFile | SYS_CHECK_FILENAME_EXISTS |

## Method Parameters

| Parameter  | Description          |
| ---------- | -------------------- |
| groupId    | The id of the group. |
| folderPath | The folder path.     |
| filename   | The file name.       |

## Usage

**C#:**

```csharp
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**C++:**

```cpp
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Obj-C:**

```objectivec
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Java:**

```java
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**JavaScript:**

```javascript
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Dart:**

```dart
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Cloud Code:**

```cfscript
var groupId = "dfsfsffsd";
var folderPath = "";
var filename = "cccc";
var groupFileProxy = bridge.getGroupFileServiceProxy();

var postResult = groupFileProxy.sysCheckFilenameExists(groupId, folderPath, filename);
if (postResult.status == 200) {
  // Success!
}
```

**Raw:**

```r
{
  "service": "groupFile",
  "operation": "SYS_CHECK_FILENAME_EXISTS",
  "data":
  {
    "groupId": "dfsfsffsd",
    "folderPath": "",
    "filename": "cccc"
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "fileDetails": {
            "treeId": "fb3431cd-6e2f-47f1-8100-8941abf6bb4f",
            "fileName": "glogcopy.json",
            "fileSize": 7051,
            "dateUploaded": 1677521119000,
            "etag": "a6f4cd3c065aed36227d3582adc5d952",
            "acl": {
                "member": 2,
                "other": 0
            },
            "version": 2,
            "url": "https://api.internal.braincloudservers.com/groupfiles/bc/g/23782/gr/2bf538d1-19ea-4e14-9862-f979215e09b7/fb3431cd-6e2f-47f1-8100-8941abf6bb4f/6d938c22-3b8c-4b99-a913-2edafed71a83/V2/glogcopy.json",
            "fileId": "6d938c22-3b8c-4b99-a913-2edafed71a83"
        },
        "groupId": "2bf538d1-19ea-4e14-9862-f979215e09b7",
        "exists": true
    },
    "status": 200
}
```

</details>
