Skip to content

Latest commit

 

History

History
483 lines (320 loc) · 15.7 KB

ArchiveAPI.md

File metadata and controls

483 lines (320 loc) · 15.7 KB

\ArchiveAPI

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

Method HTTP request Description
CreateArchiveDocument Post /c/{company_id}/archive Create Archive Document
DeleteArchiveDocument Delete /c/{company_id}/archive/{document_id} Delete Archive Document
GetArchiveDocument Get /c/{company_id}/archive/{document_id} Get Archive Document
ListArchiveDocuments Get /c/{company_id}/archive List Archive Documents
ModifyArchiveDocument Put /c/{company_id}/archive/{document_id} Modify Archive Document
UploadArchiveDocumentAttachment Post /c/{company_id}/archive/attachment Upload Archive Document Attachment

CreateArchiveDocument

CreateArchiveDocumentResponse CreateArchiveDocument(ctx, companyId).CreateArchiveDocumentRequest(createArchiveDocumentRequest).Execute()

Create Archive Document

Example

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"
	fattureincloudapi "github.com/fattureincloud/fattureincloud-go-sdk/v2/api"
	fattureincloud "github.com/fattureincloud/fattureincloud-go-sdk/v2/model"
)

func main() {
	companyId := int32(12345) // int32 | The ID of the company.
	createArchiveDocumentRequest := *fattureincloud.NewCreateArchiveDocumentRequest() // CreateArchiveDocumentRequest | The Archive Document. (optional)

	auth := context.WithValue(context.Background(), fattureincloudapi.ContextAccessToken, "ACCESS_TOKEN")
	configuration := fattureincloudapi.NewConfiguration()
	apiClient := fattureincloudapi.NewAPIClient(configuration)
	resp, r, err := apiClient.ArchiveAPI.CreateArchiveDocument(auth, companyId).CreateArchiveDocumentRequest(createArchiveDocumentRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ArchiveAPI.CreateArchiveDocument``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `CreateArchiveDocument`: CreateArchiveDocumentResponse
	json.NewEncoder(os.Stdout).Encode(resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
companyId int32 The ID of the company.

Other Parameters

Other parameters are passed through a pointer to a apiCreateArchiveDocumentRequest struct via the builder pattern

Name Type Description Notes

createArchiveDocumentRequest | CreateArchiveDocumentRequest | The Archive Document. |

Return type

CreateArchiveDocumentResponse

Authorization

OAuth2AuthenticationCodeFlow

HTTP request headers

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

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

DeleteArchiveDocument

DeleteArchiveDocument(ctx, companyId, documentId).Execute()

Delete Archive Document

Example

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"
	fattureincloudapi "github.com/fattureincloud/fattureincloud-go-sdk/v2/api"
	fattureincloud "github.com/fattureincloud/fattureincloud-go-sdk/v2/model"
)

func main() {
	companyId := int32(12345) // int32 | The ID of the company.
	documentId := int32(56) // int32 | The ID of the document.

	auth := context.WithValue(context.Background(), fattureincloudapi.ContextAccessToken, "ACCESS_TOKEN")
	configuration := fattureincloudapi.NewConfiguration()
	apiClient := fattureincloudapi.NewAPIClient(configuration)
	resp, r, err := apiClient.ArchiveAPI.DeleteArchiveDocument(auth, companyId, documentId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ArchiveAPI.DeleteArchiveDocument``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
companyId int32 The ID of the company.
documentId int32 The ID of the document.

Other Parameters

Other parameters are passed through a pointer to a apiDeleteArchiveDocumentRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

OAuth2AuthenticationCodeFlow

HTTP request headers

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

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

GetArchiveDocument

GetArchiveDocumentResponse GetArchiveDocument(ctx, companyId, documentId).Fields(fields).Fieldset(fieldset).Execute()

Get Archive Document

Example

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"
	fattureincloudapi "github.com/fattureincloud/fattureincloud-go-sdk/v2/api"
	fattureincloud "github.com/fattureincloud/fattureincloud-go-sdk/v2/model"
)

func main() {
	companyId := int32(12345) // int32 | The ID of the company.
	documentId := int32(56) // int32 | The ID of the document.
	fields := "fields_example" // string | List of comma-separated fields. (optional)
	fieldset := "fieldset_example" // string | Name of the fieldset. (optional)

	auth := context.WithValue(context.Background(), fattureincloudapi.ContextAccessToken, "ACCESS_TOKEN")
	configuration := fattureincloudapi.NewConfiguration()
	apiClient := fattureincloudapi.NewAPIClient(configuration)
	resp, r, err := apiClient.ArchiveAPI.GetArchiveDocument(auth, companyId, documentId).Fields(fields).Fieldset(fieldset).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ArchiveAPI.GetArchiveDocument``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetArchiveDocument`: GetArchiveDocumentResponse
	json.NewEncoder(os.Stdout).Encode(resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
companyId int32 The ID of the company.
documentId int32 The ID of the document.

Other Parameters

Other parameters are passed through a pointer to a apiGetArchiveDocumentRequest struct via the builder pattern

Name Type Description Notes

fields | string | List of comma-separated fields. | fieldset | string | Name of the fieldset. |

Return type

GetArchiveDocumentResponse

Authorization

OAuth2AuthenticationCodeFlow

HTTP request headers

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

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

ListArchiveDocuments

ListArchiveDocumentsResponse ListArchiveDocuments(ctx, companyId).Fields(fields).Fieldset(fieldset).Sort(sort).Page(page).PerPage(perPage).Q(q).Execute()

List Archive Documents

Example

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"
	fattureincloudapi "github.com/fattureincloud/fattureincloud-go-sdk/v2/api"
	fattureincloud "github.com/fattureincloud/fattureincloud-go-sdk/v2/model"
)

func main() {
	companyId := int32(12345) // int32 | The ID of the company.
	fields := "fields_example" // string | List of comma-separated fields. (optional)
	fieldset := "fieldset_example" // string | Name of the fieldset. (optional)
	sort := "sort_example" // string | List of comma-separated fields for result sorting (minus for desc sorting). (optional)
	page := int32(56) // int32 | The page to retrieve. (optional) (default to 1)
	perPage := int32(56) // int32 | The size of the page. (optional) (default to 5)
	q := "q_example" // string | Query for filtering the results. (optional)

	auth := context.WithValue(context.Background(), fattureincloudapi.ContextAccessToken, "ACCESS_TOKEN")
	configuration := fattureincloudapi.NewConfiguration()
	apiClient := fattureincloudapi.NewAPIClient(configuration)
	resp, r, err := apiClient.ArchiveAPI.ListArchiveDocuments(auth, companyId).Fields(fields).Fieldset(fieldset).Sort(sort).Page(page).PerPage(perPage).Q(q).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ArchiveAPI.ListArchiveDocuments``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListArchiveDocuments`: ListArchiveDocumentsResponse
	json.NewEncoder(os.Stdout).Encode(resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
companyId int32 The ID of the company.

Other Parameters

Other parameters are passed through a pointer to a apiListArchiveDocumentsRequest struct via the builder pattern

Name Type Description Notes

fields | string | List of comma-separated fields. | fieldset | string | Name of the fieldset. | sort | string | List of comma-separated fields for result sorting (minus for desc sorting). | page | int32 | The page to retrieve. | [default to 1] perPage | int32 | The size of the page. | [default to 5] q | string | Query for filtering the results. |

Return type

ListArchiveDocumentsResponse

Authorization

OAuth2AuthenticationCodeFlow

HTTP request headers

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

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

ModifyArchiveDocument

ModifyArchiveDocumentResponse ModifyArchiveDocument(ctx, companyId, documentId).ModifyArchiveDocumentRequest(modifyArchiveDocumentRequest).Execute()

Modify Archive Document

Example

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"
	fattureincloudapi "github.com/fattureincloud/fattureincloud-go-sdk/v2/api"
	fattureincloud "github.com/fattureincloud/fattureincloud-go-sdk/v2/model"
)

func main() {
	companyId := int32(12345) // int32 | The ID of the company.
	documentId := int32(56) // int32 | The ID of the document.
	modifyArchiveDocumentRequest := *fattureincloud.NewModifyArchiveDocumentRequest() // ModifyArchiveDocumentRequest | Modified Archive Document (optional)

	auth := context.WithValue(context.Background(), fattureincloudapi.ContextAccessToken, "ACCESS_TOKEN")
	configuration := fattureincloudapi.NewConfiguration()
	apiClient := fattureincloudapi.NewAPIClient(configuration)
	resp, r, err := apiClient.ArchiveAPI.ModifyArchiveDocument(auth, companyId, documentId).ModifyArchiveDocumentRequest(modifyArchiveDocumentRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ArchiveAPI.ModifyArchiveDocument``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ModifyArchiveDocument`: ModifyArchiveDocumentResponse
	json.NewEncoder(os.Stdout).Encode(resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
companyId int32 The ID of the company.
documentId int32 The ID of the document.

Other Parameters

Other parameters are passed through a pointer to a apiModifyArchiveDocumentRequest struct via the builder pattern

Name Type Description Notes

modifyArchiveDocumentRequest | ModifyArchiveDocumentRequest | Modified Archive Document |

Return type

ModifyArchiveDocumentResponse

Authorization

OAuth2AuthenticationCodeFlow

HTTP request headers

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

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

UploadArchiveDocumentAttachment

UploadArchiveAttachmentResponse UploadArchiveDocumentAttachment(ctx, companyId).Filename(filename).Attachment(attachment).Execute()

Upload Archive Document Attachment

Example

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"
	fattureincloudapi "github.com/fattureincloud/fattureincloud-go-sdk/v2/api"
	fattureincloud "github.com/fattureincloud/fattureincloud-go-sdk/v2/model"
)

func main() {
	companyId := int32(12345) // int32 | The ID of the company.
	filename := "filename_example" // string | Attachment file name (optional)
	attachment := os.NewFile(1234, "some_file") // *os.File | Attachment file [.png, .jpg, .gif, .pdf, .zip, .xls, .xlsx, .doc, .docx] (optional)

	auth := context.WithValue(context.Background(), fattureincloudapi.ContextAccessToken, "ACCESS_TOKEN")
	configuration := fattureincloudapi.NewConfiguration()
	apiClient := fattureincloudapi.NewAPIClient(configuration)
	resp, r, err := apiClient.ArchiveAPI.UploadArchiveDocumentAttachment(auth, companyId).Filename(filename).Attachment(attachment).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ArchiveAPI.UploadArchiveDocumentAttachment``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `UploadArchiveDocumentAttachment`: UploadArchiveAttachmentResponse
	json.NewEncoder(os.Stdout).Encode(resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
companyId int32 The ID of the company.

Other Parameters

Other parameters are passed through a pointer to a apiUploadArchiveDocumentAttachmentRequest struct via the builder pattern

Name Type Description Notes

filename | string | Attachment file name | attachment | *os.File | Attachment file [.png, .jpg, .gif, .pdf, .zip, .xls, .xlsx, .doc, .docx] |

Return type

UploadArchiveAttachmentResponse

Authorization

OAuth2AuthenticationCodeFlow

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]