The FileRequests class provides methods that create file operation requests. Each method returns a new RestRequest object. Applications send this object to the Salesforce service to process the request. For example, the following code snippet calls the ownedFilesList() method to retrieve a RestRequest object. It then sends the RestRequest object to the server using RestClient.sendAsync():
Kotlin
1val ownedFilesRequest = FileRequests.ownedFilesList(null, null)2val client = this.client3client?.sendAsync(ownedFilesRequest, object : AsyncRequestCallback {4// Do something with the response5})
Java
1RestRequest ownedFilesRequest = FileRequests.ownedFilesList(null, null);2RestClient client = this.client;3client.sendAsync(ownedFilesRequest, new AsyncRequestCallback() {4// Do something with the response5});
This example passes null to the first parameter (userId). This value tells the ownedFilesList() method to use the ID of the context, or logged in, user. The second null, for the pageNum parameter, tells the method to fetch the first page of results.