Skip to content

Latest commit

 

History

History
511 lines (408 loc) · 16.7 KB

ClientsApi.md

File metadata and controls

511 lines (408 loc) · 16.7 KB

It.FattureInCloud.Sdk.Api.ClientsApi

All URIs are relative to https://api-v2.fattureincloud.it

Method HTTP request Description
CreateClient POST /c/{company_id}/entities/clients Create Client
DeleteClient DELETE /c/{company_id}/entities/clients/{client_id} Delete Client
GetClient GET /c/{company_id}/entities/clients/{client_id} Get Client
ListClients GET /c/{company_id}/entities/clients List Clients
ModifyClient PUT /c/{company_id}/entities/clients/{client_id} Modify Client

CreateClient

CreateClientResponse CreateClient (int companyId, CreateClientRequest createClientRequest = null)

Create Client

Creates a new client.

Example

using System.Collections.Generic;
using System.Diagnostics;
using It.FattureInCloud.Sdk.Api;
using It.FattureInCloud.Sdk.Client;
using It.FattureInCloud.Sdk.Model;

namespace Example
{
    public class CreateClientExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api-v2.fattureincloud.it";
            // Configure OAuth2 access token for authorization: OAuth2AuthenticationCodeFlow
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new ClientsApi(config);
            var companyId = 12345;  // int | The ID of the company.
            var createClientRequest = new CreateClientRequest(); // CreateClientRequest | The client to create (optional) 

            try
            {
                // Create Client
                CreateClientResponse result = apiInstance.CreateClient(companyId, createClientRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling ClientsApi.CreateClient: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the CreateClientWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Create Client
    ApiResponse<CreateClientResponse> response = apiInstance.CreateClientWithHttpInfo(companyId, createClientRequest);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling ClientsApi.CreateClientWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
companyId int The ID of the company.
createClientRequest CreateClientRequest The client to create [optional]

Return type

CreateClientResponse

Authorization

OAuth2AuthenticationCodeFlow

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Example response -

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

DeleteClient

void DeleteClient (int companyId, int clientId)

Delete Client

Deletes the specified client.

Example

using System.Collections.Generic;
using System.Diagnostics;
using It.FattureInCloud.Sdk.Api;
using It.FattureInCloud.Sdk.Client;
using It.FattureInCloud.Sdk.Model;

namespace Example
{
    public class DeleteClientExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api-v2.fattureincloud.it";
            // Configure OAuth2 access token for authorization: OAuth2AuthenticationCodeFlow
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new ClientsApi(config);
            var companyId = 12345;  // int | The ID of the company.
            var clientId = 56;  // int | The ID of the client.

            try
            {
                // Delete Client
                apiInstance.DeleteClient(companyId, clientId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling ClientsApi.DeleteClient: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the DeleteClientWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Delete Client
    apiInstance.DeleteClientWithHttpInfo(companyId, clientId);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling ClientsApi.DeleteClientWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
companyId int The ID of the company.
clientId int The ID of the client.

Return type

void (empty response body)

Authorization

OAuth2AuthenticationCodeFlow

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Entity Removed -
401 Unauthorized -
404 Not Found -

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

GetClient

GetClientResponse GetClient (int companyId, int clientId, string fields = null, string fieldset = null)

Get Client

Gets the specified client.

Example

using System.Collections.Generic;
using System.Diagnostics;
using It.FattureInCloud.Sdk.Api;
using It.FattureInCloud.Sdk.Client;
using It.FattureInCloud.Sdk.Model;

namespace Example
{
    public class GetClientExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api-v2.fattureincloud.it";
            // Configure OAuth2 access token for authorization: OAuth2AuthenticationCodeFlow
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new ClientsApi(config);
            var companyId = 12345;  // int | The ID of the company.
            var clientId = 56;  // int | The ID of the client.
            var fields = "fields_example";  // string | List of comma-separated fields. (optional) 
            var fieldset = "basic";  // string | Name of the fieldset. (optional) 

            try
            {
                // Get Client
                GetClientResponse result = apiInstance.GetClient(companyId, clientId, fields, fieldset);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling ClientsApi.GetClient: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the GetClientWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Get Client
    ApiResponse<GetClientResponse> response = apiInstance.GetClientWithHttpInfo(companyId, clientId, fields, fieldset);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling ClientsApi.GetClientWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
companyId int The ID of the company.
clientId int The ID of the client.
fields string List of comma-separated fields. [optional]
fieldset string Name of the fieldset. [optional]

Return type

GetClientResponse

Authorization

OAuth2AuthenticationCodeFlow

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Client Details. -
401 Unauthorized -
404 Not Found -

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

ListClients

ListClientsResponse ListClients (int companyId, string fields = null, string fieldset = null, string sort = null, int? page = null, int? perPage = null, string q = null)

List Clients

Lists the clients.

Example

using System.Collections.Generic;
using System.Diagnostics;
using It.FattureInCloud.Sdk.Api;
using It.FattureInCloud.Sdk.Client;
using It.FattureInCloud.Sdk.Model;

namespace Example
{
    public class ListClientsExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api-v2.fattureincloud.it";
            // Configure OAuth2 access token for authorization: OAuth2AuthenticationCodeFlow
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new ClientsApi(config);
            var companyId = 12345;  // int | The ID of the company.
            var fields = "fields_example";  // string | List of comma-separated fields. (optional) 
            var fieldset = "basic";  // string | Name of the fieldset. (optional) 
            var sort = "sort_example";  // string | List of comma-separated fields for result sorting (minus for desc sorting). (optional) 
            var page = 1;  // int? | The page to retrieve. (optional)  (default to 1)
            var perPage = 5;  // int? | The size of the page. (optional)  (default to 5)
            var q = "q_example";  // string | Query for filtering the results. (optional) 

            try
            {
                // List Clients
                ListClientsResponse result = apiInstance.ListClients(companyId, fields, fieldset, sort, page, perPage, q);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling ClientsApi.ListClients: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ListClientsWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // List Clients
    ApiResponse<ListClientsResponse> response = apiInstance.ListClientsWithHttpInfo(companyId, fields, fieldset, sort, page, perPage, q);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling ClientsApi.ListClientsWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
companyId int The ID of the company.
fields string List of comma-separated fields. [optional]
fieldset string Name of the fieldset. [optional]
sort string List of comma-separated fields for result sorting (minus for desc sorting). [optional]
page int? The page to retrieve. [optional] [default to 1]
perPage int? The size of the page. [optional] [default to 5]
q string Query for filtering the results. [optional]

Return type

ListClientsResponse

Authorization

OAuth2AuthenticationCodeFlow

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Example response -
401 Unauthorized -

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

ModifyClient

ModifyClientResponse ModifyClient (int companyId, int clientId, ModifyClientRequest modifyClientRequest = null)

Modify Client

Modifies the specified client.

Example

using System.Collections.Generic;
using System.Diagnostics;
using It.FattureInCloud.Sdk.Api;
using It.FattureInCloud.Sdk.Client;
using It.FattureInCloud.Sdk.Model;

namespace Example
{
    public class ModifyClientExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api-v2.fattureincloud.it";
            // Configure OAuth2 access token for authorization: OAuth2AuthenticationCodeFlow
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new ClientsApi(config);
            var companyId = 12345;  // int | The ID of the company.
            var clientId = 56;  // int | The ID of the client.
            var modifyClientRequest = new ModifyClientRequest(); // ModifyClientRequest | The modified Client. First level parameters are managed in delta mode. (optional) 

            try
            {
                // Modify Client
                ModifyClientResponse result = apiInstance.ModifyClient(companyId, clientId, modifyClientRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling ClientsApi.ModifyClient: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ModifyClientWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Modify Client
    ApiResponse<ModifyClientResponse> response = apiInstance.ModifyClientWithHttpInfo(companyId, clientId, modifyClientRequest);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling ClientsApi.ModifyClientWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
companyId int The ID of the company.
clientId int The ID of the client.
modifyClientRequest ModifyClientRequest The modified Client. First level parameters are managed in delta mode. [optional]

Return type

ModifyClientResponse

Authorization

OAuth2AuthenticationCodeFlow

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Client modified. -
401 Unauthorized -
404 Not Found -

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