Skip to content

Latest commit

 

History

History
402 lines (303 loc) · 12.8 KB

FilesApi.md

File metadata and controls

402 lines (303 loc) · 12.8 KB

ProcessMakerSDK.Api.FilesApi

All URIs are relative to http://localhost/api/1.0

Method HTTP request Description
CreateFile POST /requests/{request_id}/files Save a new media file
DeleteFile DELETE /requests/{request_id} Delete a media file
GetFiles GET /requests/{request_id}/files Returns the list of files associated to a request
GetFilesById GET /requests/{request_id}/files/{file_id} Get a file uploaded to a request
UpdateFile PUT /requests/{request_id}/files/{file_id} Update a media file

CreateFile

InlineResponse2003 CreateFile (string requestId, InlineObject inlineObject, int? mediaId = null, string media = null)

Save a new media file

Example

using System.Diagnostics;
using ProcessMakerSDK.Api;
using ProcessMakerSDK.Client;
using ProcessMakerSDK.Model;

namespace Example
{
    public class CreateFileExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://localhost/api/1.0";
            // Configure OAuth2 access token for authorization: pm_api_auth_code
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
            // Configure API key authorization: pm_api_key
            Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new FilesApi(Configuration.Default);
            var requestId = requestId_example;  // string | ID of the request
            var inlineObject = new InlineObject(); // InlineObject | 
            var mediaId = 56;  // int? | ID of the model to which the file will be associated (optional) 
            var media = media_example;  // string | Name of the class of the model (optional) 

            try
            {
                // Save a new media file
                InlineResponse2003 result = apiInstance.CreateFile(requestId, inlineObject, mediaId, media);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling FilesApi.CreateFile: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
requestId string ID of the request
inlineObject InlineObject
mediaId int? ID of the model to which the file will be associated [optional]
media string Name of the class of the model [optional]

Return type

InlineResponse2003

Authorization

pm_api_auth_code, pm_api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteFile

void DeleteFile (string requestId)

Delete a media file

Example

using System.Diagnostics;
using ProcessMakerSDK.Api;
using ProcessMakerSDK.Client;
using ProcessMakerSDK.Model;

namespace Example
{
    public class DeleteFileExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://localhost/api/1.0";
            // Configure OAuth2 access token for authorization: pm_api_auth_code
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
            // Configure API key authorization: pm_api_key
            Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new FilesApi(Configuration.Default);
            var requestId = requestId_example;  // string | ID of the request

            try
            {
                // Delete a media file
                apiInstance.DeleteFile(requestId);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling FilesApi.DeleteFile: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
requestId string ID of the request

Return type

void (empty response body)

Authorization

pm_api_auth_code, pm_api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetFiles

InlineResponse2002 GetFiles (string requestId, string filter = null, string orderBy = null, string orderDirection = null, int? perPage = null)

Returns the list of files associated to a request

Example

using System.Diagnostics;
using ProcessMakerSDK.Api;
using ProcessMakerSDK.Client;
using ProcessMakerSDK.Model;

namespace Example
{
    public class GetFilesExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://localhost/api/1.0";
            // Configure OAuth2 access token for authorization: pm_api_auth_code
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
            // Configure API key authorization: pm_api_key
            Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new FilesApi(Configuration.Default);
            var requestId = requestId_example;  // string | ID of the request
            var filter = filter_example;  // string | Filter results by string. Searches Name, Description, and Status. Status must match exactly. Others can be a substring. (optional) 
            var orderBy = orderBy_example;  // string | Field to order results by (optional) 
            var orderDirection = orderDirection_example;  // string |  (optional)  (default to asc)
            var perPage = 56;  // int? |  (optional) 

            try
            {
                // Returns the list of files associated to a request
                InlineResponse2002 result = apiInstance.GetFiles(requestId, filter, orderBy, orderDirection, perPage);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling FilesApi.GetFiles: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
requestId string ID of the request
filter string Filter results by string. Searches Name, Description, and Status. Status must match exactly. Others can be a substring. [optional]
orderBy string Field to order results by [optional]
orderDirection string [optional] [default to asc]
perPage int? [optional]

Return type

InlineResponse2002

Authorization

pm_api_auth_code, pm_api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetFilesById

Groups GetFilesById (string fileId, string requestId)

Get a file uploaded to a request

Example

using System.Diagnostics;
using ProcessMakerSDK.Api;
using ProcessMakerSDK.Client;
using ProcessMakerSDK.Model;

namespace Example
{
    public class GetFilesByIdExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://localhost/api/1.0";
            // Configure OAuth2 access token for authorization: pm_api_auth_code
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
            // Configure API key authorization: pm_api_key
            Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new FilesApi(Configuration.Default);
            var fileId = fileId_example;  // string | ID of the file to return
            var requestId = requestId_example;  // string | ID of the request

            try
            {
                // Get a file uploaded to a request
                Groups result = apiInstance.GetFilesById(fileId, requestId);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling FilesApi.GetFilesById: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
fileId string ID of the file to return
requestId string ID of the request

Return type

Groups

Authorization

pm_api_auth_code, pm_api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateFile

InlineResponse2004 UpdateFile (string fileId, string requestId, InlineObject1 inlineObject1)

Update a media file

Example

using System.Diagnostics;
using ProcessMakerSDK.Api;
using ProcessMakerSDK.Client;
using ProcessMakerSDK.Model;

namespace Example
{
    public class UpdateFileExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://localhost/api/1.0";
            // Configure OAuth2 access token for authorization: pm_api_auth_code
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
            // Configure API key authorization: pm_api_key
            Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new FilesApi(Configuration.Default);
            var fileId = fileId_example;  // string | ID of the file to update
            var requestId = requestId_example;  // string | ID of the request
            var inlineObject1 = new InlineObject1(); // InlineObject1 | 

            try
            {
                // Update a media file
                InlineResponse2004 result = apiInstance.UpdateFile(fileId, requestId, inlineObject1);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling FilesApi.UpdateFile: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
fileId string ID of the file to update
requestId string ID of the request
inlineObject1 InlineObject1

Return type

InlineResponse2004

Authorization

pm_api_auth_code, pm_api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]