Skip to content

Latest commit

 

History

History
370 lines (291 loc) · 12.5 KB

FilesApi.md

File metadata and controls

370 lines (291 loc) · 12.5 KB

sib_api_v3_sdk.Api.FilesApi

All URIs are relative to https://api.sendinblue.com/v3

Method HTTP request Description
CrmFilesGet GET /crm/files Get all files
CrmFilesIdDataGet GET /crm/files/{id}/data Get file details
CrmFilesIdDelete DELETE /crm/files/{id} Delete a file
CrmFilesIdGet GET /crm/files/{id} Download a file
CrmFilesPost POST /crm/files Upload a file

CrmFilesGet

FileList CrmFilesGet (string entity = null, string entityIds = null, int? dateFrom = null, int? dateTo = null, long? offset = null, long? limit = null, string sort = null)

Get all files

Example

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

namespace Example
{
    public class CrmFilesGetExample
    {
        public void main()
        {
            // Configure API key authorization: api-key
            Configuration.Default.AddApiKey("api-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("api-key", "Bearer");
            // Configure API key authorization: partner-key
            Configuration.Default.AddApiKey("partner-key", "YOUR_PARTNER_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("partner-key", "Bearer");

            var apiInstance = new FilesApi();
            var entity = entity_example;  // string | Filter by file entity type (optional) 
            var entityIds = entityIds_example;  // string | Filter by file entity IDs (optional) 
            var dateFrom = 56;  // int? | dateFrom to date range filter type (timestamp in milliseconds) (optional) 
            var dateTo = 56;  // int? | dateTo to date range filter type (timestamp in milliseconds) (optional) 
            var offset = 789;  // long? | Index of the first document of the page (optional) 
            var limit = 789;  // long? | Number of documents per page (optional)  (default to 50)
            var sort = sort_example;  // string | Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional) 

            try
            {
                // Get all files
                FileList result = apiInstance.CrmFilesGet(entity, entityIds, dateFrom, dateTo, offset, limit, sort);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling FilesApi.CrmFilesGet: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
entity string Filter by file entity type [optional]
entityIds string Filter by file entity IDs [optional]
dateFrom int? dateFrom to date range filter type (timestamp in milliseconds) [optional]
dateTo int? dateTo to date range filter type (timestamp in milliseconds) [optional]
offset long? Index of the first document of the page [optional]
limit long? Number of documents per page [optional] [default to 50]
sort string Sort the results in the ascending/descending order. Default order is descending by creation if `sort` is not passed [optional]

Return type

FileList

Authorization

api-key, partner-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]

CrmFilesIdDataGet

FileData CrmFilesIdDataGet (string id)

Get file details

Example

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

namespace Example
{
    public class CrmFilesIdDataGetExample
    {
        public void main()
        {
            // Configure API key authorization: api-key
            Configuration.Default.AddApiKey("api-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("api-key", "Bearer");
            // Configure API key authorization: partner-key
            Configuration.Default.AddApiKey("partner-key", "YOUR_PARTNER_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("partner-key", "Bearer");

            var apiInstance = new FilesApi();
            var id = id_example;  // string | File id to get file data.

            try
            {
                // Get file details
                FileData result = apiInstance.CrmFilesIdDataGet(id);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling FilesApi.CrmFilesIdDataGet: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
id string File id to get file data.

Return type

FileData

Authorization

api-key, partner-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]

CrmFilesIdDelete

void CrmFilesIdDelete (string id)

Delete a file

Example

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

namespace Example
{
    public class CrmFilesIdDeleteExample
    {
        public void main()
        {
            // Configure API key authorization: api-key
            Configuration.Default.AddApiKey("api-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("api-key", "Bearer");
            // Configure API key authorization: partner-key
            Configuration.Default.AddApiKey("partner-key", "YOUR_PARTNER_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("partner-key", "Bearer");

            var apiInstance = new FilesApi();
            var id = id_example;  // string | File id to delete.

            try
            {
                // Delete a file
                apiInstance.CrmFilesIdDelete(id);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling FilesApi.CrmFilesIdDelete: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
id string File id to delete.

Return type

void (empty response body)

Authorization

api-key, partner-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]

CrmFilesIdGet

FileDownloadableLink CrmFilesIdGet (string id)

Download a file

Example

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

namespace Example
{
    public class CrmFilesIdGetExample
    {
        public void main()
        {
            // Configure API key authorization: api-key
            Configuration.Default.AddApiKey("api-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("api-key", "Bearer");
            // Configure API key authorization: partner-key
            Configuration.Default.AddApiKey("partner-key", "YOUR_PARTNER_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("partner-key", "Bearer");

            var apiInstance = new FilesApi();
            var id = id_example;  // string | File id to download.

            try
            {
                // Download a file
                FileDownloadableLink result = apiInstance.CrmFilesIdGet(id);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling FilesApi.CrmFilesIdGet: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
id string File id to download.

Return type

FileDownloadableLink

Authorization

api-key, partner-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]

CrmFilesPost

FileData CrmFilesPost (System.IO.Stream file, string dealId = null, long? contactId = null, string companyId = null)

Upload a file

Example

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

namespace Example
{
    public class CrmFilesPostExample
    {
        public void main()
        {
            // Configure API key authorization: api-key
            Configuration.Default.AddApiKey("api-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("api-key", "Bearer");
            // Configure API key authorization: partner-key
            Configuration.Default.AddApiKey("partner-key", "YOUR_PARTNER_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("partner-key", "Bearer");

            var apiInstance = new FilesApi();
            var file = new System.IO.Stream(); // System.IO.Stream | File data to create a file.
            var dealId = dealId_example;  // string | Deal id linked to a file (optional) 
            var contactId = 789;  // long? | Contact id linked to a file (optional) 
            var companyId = companyId_example;  // string | Company id linked to a file (optional) 

            try
            {
                // Upload a file
                FileData result = apiInstance.CrmFilesPost(file, dealId, contactId, companyId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling FilesApi.CrmFilesPost: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
file System.IO.Stream File data to create a file.
dealId string Deal id linked to a file [optional]
contactId long? Contact id linked to a file [optional]
companyId string Company id linked to a file [optional]

Return type

FileData

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

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