NAME
WebService::ValidSign::API::DocumentPackage - A REST API client for ValidSign
VERSION
version 0.004
SYNOPSIS
You should not need to instantiate this object yourself. Use WebService::ValidSign for this.
use WebService::ValidSign;
my $api = WebService::ValidSign->new(
secret => 'foo',
endpoint => 'https://some.url/api',
);
my $pkg_api = $api->package;
ATTRIBUTES
action_endpoints
Implement the endpoint as required by WebService::ValidSign::API.
METHODS
find
$self->find("someid");
Find a document package based on the ID. You get a WebService::ValidSign::Object::DocumentPackage object when we have found the document package.
CAVEAT!
The object is not full up to spec, as the documents are still an arrayref filled with hashrefs. Later implementations will try to fix this issue.
create
$self->create($pkg);
Create a document package on the ValidSign side. You need to pass a Webservice::ValidSign::Object::DocumentPackage to the call. It cannot have and ID as you would be able to create two packages with the same ID. You can call this function with, or without documents attached to the document package.
create_with_documents
$self->create_with_documents($pkg);
Similar to the create call, but this one can only be called when there are documents attached to the document package.
download_document
$self->download_document($pkg, $document_id);
Download a document from package. When no document id is supplied we will only download the first document. If you supply one, we will use this document id. There is not check to see if the document actually exists in the document package. Callers should check these themselves (via the find
command).
download_documents
$self->download_documents($pkg);
Download all documents from the package. You will get a filehandle to a zip file. Use Archive::ZIP to extract the files.
AUTHOR
Wesley Schwengle <waterkip@cpan.org>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2019 by Wesley Schwengle.
This is free software, licensed under:
The (three-clause) BSD License