VaultMobileSDK  18R3
iOS framework for Vault API
Instance Methods | Class Methods | List of all members
VEVVaultAPI Class Reference

A singleton class that is used to interface to the Vault server and the methods here help to issue requests and process responses. More...

Inherits NSObject.

Instance Methods

(void) - requestVaultEndpoint:vault:method:parameters:parameterEncoding:completionHandler:
 Sends a request to a specific Vault endpoint. This method can be used to invoke any REST endpoint generically. If no other wrapper or helper method exists for a specific REST endpoint, this method can be used. More...
 
(void) - requestVaultMultipartFormEndpoint:vault:fileURL:isEncrypted:method:parameters:progressHandler:completionHandler:
 Issues a request with a file to a specific Vault endpoint. More...
 
(void) - requestVaultDownloadFileEndpoint:vault:fileURL:encrypt:parameters:progressHandler:completionHandler:
 Issues a request to a Vault file download endpoint, e.g., objects/documents/2468/renditions/viewable_rendition__v. More...
 
(void) - setBackgroundUploadResultHandler:
 Sets the background callback to be invoked in the event an upload completes following a crash and subsequent restart by iOS. More...
 
(void) - setBackgroundDownloadResultHandler:
 Sets the background callback to be invoked in the event a download completes following a crash and subsequent restart by iOS. More...
 
(void) - createDocumentWithFields:vault:completeHandler:
 Creates a Vault document without any associated content file, e.g., a placeholder document. More...
 
(void) - createDocumentWithFields:vault:fileURL:fileIsEncrypted:progressHandler:completeHandler:
 Uploads a locally stored file to a new Vault document object. More...
 
(void) - updateDocument:fields:vault:completeHandler:
 Updates a Vault document. More...
 
(void) - updateDocument:fields:vault:fileURL:fileIsEncrypted:progressHandler:completeHandler:
 Uploads a locally stored file to an existing Vault document object, e.g., a placeholder document. More...
 
(void) - getDocument:vault:completeHandler:
 Retrieves document metadata for the specified document on Vault. More...
 
(void) - getDocumentType:vault:completeHandler:
 Retrieves document metadata for the specified document type. More...
 
(void) - getDocumentProperties:vault:completeHandler:
 Retrieves document properties for the specified document on Vault. More...
 
(void) - query:completeHandler:
 Executes a VEVVaultServerQuery on a Vault. More...
 

Class Methods

(instancetype) + sharedInstance
 Return the singleton instance.
 

Detailed Description

A singleton class that is used to interface to the Vault server and the methods here help to issue requests and process responses.

VEVVaultAPI provides both convenience methods that closely correspond to the Vault REST API Documents module as well as more general methods that can be used to access any arbitrary Vault REST API endpoint.

Background Uploads

Some of the VEVVaultAPI methods wrap Vault's document upload endpoints. These methods fully support iOS background uploading as described in URL Session Programming Guide. In order to enable this in your application you must implement UIApplicationDelegate:application:handleEventsForBackgroundURLSession:completionHandler: and forward all parameters to application:handleEventsForBackgroundURLSession:completionHandler: (VEVSDKApplicationDelegate).

See also
- application:handleEventsForBackgroundURLSession:completionHandler: (VEVSDKApplicationDelegate)
UIApplicationDelegate:application:handleEventsForBackgroundURLSession:completionHandler:
URL Session Programming Guide.
https://developer.veevavault.com/docs/#rest-api

Method Documentation

◆ requestVaultEndpoint:vault:method:parameters:parameterEncoding:completionHandler:()

- (void) requestVaultEndpoint: (NSString *)  endpoint
vault: (VEVVault *)  vault
method: (VEVRequestMethod method
parameters: (nullable id)  params
parameterEncoding: (VEVParameterEncoding encoding
completionHandler: (VEVVaultAPIResponseHandler _Nullable)  completionHandler 

Sends a request to a specific Vault endpoint. This method can be used to invoke any REST endpoint generically. If no other wrapper or helper method exists for a specific REST endpoint, this method can be used.

Parameters
endpointThe Vault endpoint to send the request to. The endpoint must only include the portion of the endpoint URL that identifies the endpoint itself, e.g., objects/documents rather than https://myvault.com/api/v18.2/objects/documents.
vaultThe specific Vault to send the request to.
methodThe HTTP request method used in the request.
paramsThe parameters to be encoded and included with the request. Must either be an NSDictionary or an NSArray .
encodingThe encoding used for params.
completionHandlerThe callback that is invoked after completing the request.
Remarks
Note that calling this method will prompt the user to authenticate if necessary.
See also
VEVVaultAuth

◆ requestVaultMultipartFormEndpoint:vault:fileURL:isEncrypted:method:parameters:progressHandler:completionHandler:()

- (void) requestVaultMultipartFormEndpoint: (NSString *)  endpoint
vault: (VEVVault *)  vault
fileURL: (NSURL *)  fileURL
isEncrypted: (BOOL)  isEncrypted
method: (VEVRequestMethod method
parameters: (nullable id)  params
progressHandler: (VEVVaultAPIProgressHandler _Nullable)  progressHandler
completionHandler: (VEVVaultAPIUploadResultHandler _Nullable)  completionHandler 

Issues a request with a file to a specific Vault endpoint.

Parameters
endpointThe Vault endpoint to send the request to.
vaultThe specific Vault to send the request to.
fileURLThe absolute file path of the local file to upload represented as a file URL. The maximum file size that can be uploaded is 256 MB.
isEncryptedPass in YES if the local file has been encrypted with createEncryptedFileAtPath:contents:attributes:error: (VEVVaultCrypt), otherwise NO.
methodThe HTTP request method used in the request.
paramsThe parameters to be encoded and included with the request. Must either be an NSDictionary or an NSArray .
progressHandlerThe callback that is invoked each time a chunk of data is uploaded to the Vault server.
completionHandlerThe callback that is invoked after completing the request.
Remarks
Note that calling this method will prompt the user to authenticate if necessary.
See also
VEVVaultAuth
VEVVaultCrypt

◆ requestVaultDownloadFileEndpoint:vault:fileURL:encrypt:parameters:progressHandler:completionHandler:()

- (void) requestVaultDownloadFileEndpoint: (NSString *)  endpoint
vault: (VEVVault *)  vault
fileURL: (NSURL *)  fileURL
encrypt: (BOOL)  encrypt
parameters: (nullable id)  params
progressHandler: (VEVVaultAPIProgressHandler _Nullable)  progressHandler
completionHandler: (VEVVaultAPIDownloadResultHandler _Nullable)  completionHandler 

Issues a request to a Vault file download endpoint, e.g., objects/documents/2468/renditions/viewable_rendition__v.

Parameters
endpointThe Vault endpoint to send the request to.
vaultThe specific Vault to send the request to.
fileURLThe absolute file path of the local file location to down to.
encryptPass in YES in order to encrypt the the downloaded file with createEncryptedFileAtPath:contents:attributes:error: (VEVVaultCrypt), otherwise NO.
paramsThe parameters to be encoded and included with the request. Must either be an NSDictionary or an NSArray .
progressHandlerThe callback that is invoked each time a chunk of data is downloaded from the Vault server. Currently this is unsupported but is reserved for future use.
completionHandlerThe callback that is invoked after completing the request.
Remarks
Note that calling this method will prompt the user to authenticate if necessary.
See also
VEVVaultAuth
VEVVaultCrypt

◆ setBackgroundUploadResultHandler:()

- (void) setBackgroundUploadResultHandler: (VEVVaultAPIUploadResultHandler handler

Sets the background callback to be invoked in the event an upload completes following a crash and subsequent restart by iOS.

See also
VEVSDKApplicationDelegate::application:handleEventsForBackgroundURLSession:completeHandler and NSURLSession Programming Guide.

◆ setBackgroundDownloadResultHandler:()

- (void) setBackgroundDownloadResultHandler: (VEVVaultAPIDownloadResultHandler handler

Sets the background callback to be invoked in the event a download completes following a crash and subsequent restart by iOS.

See also
VEVSDKApplicationDelegate::application:handleEventsForBackgroundURLSession:completeHandler and NSURLSession Programming Guide.

◆ createDocumentWithFields:vault:completeHandler:()

- (void) createDocumentWithFields: (NSDictionary *)  fields
vault: (VEVVault *)  vault
completeHandler: (nullable VEVVaultAPICreateDocumentResultHandler cHandler 

Creates a Vault document without any associated content file, e.g., a placeholder document.

Parameters
fieldsThe dictionary of field value pairs that specify the field values for the newly created Vault document object. See Create Single Document for details about what may be specified in fields.
vaultThe Vault to create the document object on.
cHandlerThe callback that is invoked after the document object is successfully created or fails. It is always invoked on the main thread.
Remarks
Note that calling this method will prompt the user to authenticate if necessary.
See also
VEVVaultAuth

◆ createDocumentWithFields:vault:fileURL:fileIsEncrypted:progressHandler:completeHandler:()

- (void) createDocumentWithFields: (nullable NSDictionary *)  fields
vault: (VEVVault *)  vault
fileURL: (NSURL *)  fileURL
fileIsEncrypted: (BOOL)  isEncrypted
progressHandler: (nullable VEVVaultAPIProgressHandler pHandler
completeHandler: (nullable VEVVaultAPICreateDocumentResultHandler cHandler 

Uploads a locally stored file to a new Vault document object.

Parameters
fieldsThe dictionary of field value pairs that specify the field values for the new Vault document object. See Create Single Document for details about what may be specified in fields.
vaultThe Vault to create the document object on.
fileURLThe absolute file path of the local file to upload represented as a file URL.
isEncryptedPass in YES if the local file has been encrypted with createEncryptedFileAtPath:contents:attributes:error: (VEVVaultCrypt), otherwise NO.
pHandlerThe callback that is invoked each time a chunk of data is uploaded to the Vault server. It is always invoked on the main thread.
cHandlerThe callback that is invoked after the document object is successfully created or fails. It is always invoked on the main thread.
Remarks
Note that calling this method will prompt the user to authenticate if necessary.
See also
VEVVaultAuth
VEVVaultCrypt

◆ updateDocument:fields:vault:completeHandler:()

- (void) updateDocument: (NSUInteger)  documentId
fields: (NSDictionary *)  fields
vault: (VEVVault *)  vault
completeHandler: (nullable VEVVaultAPIUpdateDocumentResultHandler cHandler 

Updates a Vault document.

Parameters
documentIdThe Vault document ID of the document.
fieldsThe dictionary of field value pairs that specify the updated field values for the Vault document object.
vaultThe Vault on which the document resides.
cHandlerThe callback that is invoked after the document object is successfully updated or fails. It is always invoked on the main thread.
Remarks
Note that calling this method will prompt the user to authenticate if necessary.
See also
VEVVaultAuth

◆ updateDocument:fields:vault:fileURL:fileIsEncrypted:progressHandler:completeHandler:()

- (void) updateDocument: (NSUInteger)  documentId
fields: (nullable NSDictionary *)  fields
vault: (VEVVault *)  vault
fileURL: (NSURL *)  fileURL
fileIsEncrypted: (BOOL)  isEncrypted
progressHandler: (nullable VEVVaultAPIProgressHandler pHandler
completeHandler: (nullable VEVVaultAPIUpdateDocumentResultHandler cHandler 

Uploads a locally stored file to an existing Vault document object, e.g., a placeholder document.

Parameters
documentIdThe Vault document ID of the document.
fieldsThe dictionary of field value pairs that specify the updated field values for the Vault document object.
vaultThe Vault on which the document resides.
fileURLThe absolute file path of the local file to upload represented as a file URL.
isEncryptedPass in YES if the local file has been encrypted with createEncryptedFileAtPath:contents:attributes:error: (VEVVaultCrypt), otherwise NO.
pHandlerThe callback that is invoked each time a chunk of data is uploaded to the Vault server. It is always invoked on the main thread.
cHandlerThe callback that is invoked after the document object is successfully updated or fails. It is always invoked on the main thread.
Remarks
Note that calling this method will prompt the user to authenticate if necessary.
See also
VEVVaultAuth
VEVVaultCrypt

◆ getDocument:vault:completeHandler:()

- (void) getDocument: (NSUInteger)  documentId
vault: (VEVVault *)  vault
completeHandler: (VEVVaultAPIGetDocumentResultHandler cHandler 

Retrieves document metadata for the specified document on Vault.

Parameters
documentIdThe Vault document ID of the document.
vaultThe Vault where the document exists.
cHandlerThe callback that is invoked after retrieving the document information from Vault.
Remarks
Note that calling this method will prompt the user to authenticate if necessary.
See also
VEVVaultAuth

◆ getDocumentType:vault:completeHandler:()

- (void) getDocumentType: (NSString *)  name
vault: (VEVVault *)  vault
completeHandler: (VEVVaultAPIGetDocumentTypeResultHandler cHandler 

Retrieves document metadata for the specified document type.

Parameters
nameThe name of the document type on Vault. name must be one of the top-level of the document type/subtype/classification hierarchy. See Retrieve Document Type.
vaultThe Vault where the document type exists.
cHandlerThe callback that is invoked after retrieving the document type metadata from Vault.
Remarks
Note that calling this method will prompt the user to authenticate if necessary.
See also
VEVVaultAuth

◆ getDocumentProperties:vault:completeHandler:()

- (void) getDocumentProperties: (NSUInteger)  documentId
vault: (VEVVault *)  vault
completeHandler: (VEVVaultAPIGetDocumentPropertiesResultHandler cHandler 

Retrieves document properties for the specified document on Vault.

Parameters
documentIdThe Vault document ID of the document.
vaultThe Vault where the document exists.
cHandlerThe callback that is invoked after retrieving the document properties from Vault.
Remarks
Note that calling this method will prompt the user to authenticate if necessary.
See also
VEVVaultAuth

◆ query:completeHandler:()

- (void) query: (VEVVaultServerRequest *)  request
completeHandler: (VEVVaultAPIResponseHandler cHandler 

Executes a VEVVaultServerQuery on a Vault.

Parameters
requestThe request to execute.
cHandlerThe callback that is invoked after executing the query.
Remarks
Note that calling this method will prompt the user to authenticate if necessary.
See also
VEVVaultAuth

The documentation for this class was generated from the following file: