new DamAPI($rootScope, $http)

Warning! The SmartFlo™ APIs assume 2 global variables are set in $rootScope prior to using the APIs:

  1. $rootScope.credential
  2. set implicitely by the AuthAPI class upon success of the authenticate method
  3. $rootScope.site
  4. set by the calling application to the
    domain (e.g., www.smartflo.biz) or IP address of the target SmartFlo™ system, possibly when initializing the module that declares an API service

Example

//
// Warning! The global '$rootScope.site' field value must be set 
// to the target SmartFlo™ domain prior to using theSmartFlo™ APIs. In this 
// example it is set by the configuration block of the 'SFdamApi' 
// module.
//
angular.module('sfdam', [])
     // inject API as a service
     .service('SFdamApi', ['$rootScope', '$http', DamAPI])
     .controller('SFdamCtrl', DamCtrl);
     .run(function ($rootScope, $location) { 
     // store the site for use by APIs
         $rootScope.site = $location.host();
         if ($location.port !== null & $location.port !== 80) {
         $rootScope.site += ':' + $location.port().toString();
    }
});

Parameters

Name Type Optional Description

$rootScope

object

 

The topmost parent scope in AngularJS.

$http

service

 

The core AngularJS service that facilitates communication with the remote HTTP servers via the browser's XMLHttpRequest object or via JSONP.

Copyright
© Chalex Corp. 2002 - 2017. All rights reserved.
Returns

class A constructor that will be instantiated.

Methods

deleteAttachments(params, successHandler[, failureHandler]) → object

Deletes a set of attachments from the SmartFlo™ system.

Example

function deleteAttachments() {
     params {
         attachmentids: $scope.selectedAttachments
     };
     SFdamApi.deleteAttachments(params, handleDeleteAttachments);
}

function handleDeleteAttachments(result) {
     if ('0' === status) {
          $scope.attachmentThumbnailsSelected = [];
          $scope.getJobAttachments();
     } else {
         $scope.errorCode = result.status;
         $scope.errorMessage = result.statusMessage;
     }
}

Parameters

Name Type Optional Description

params

object

 

An object that provides a comma separated list of SmartFlo™ attachment IDs.


params {
     attachmentids: [comma separated list of attachment IDs]
};

successHandler

function()

 

A function that is called back upon success.

failureHandler

function()

Yes

An optional function that is called back upon failure. If none is specified, the success callback is called with failure data. status, statusMessage, api and date.

See also
postDeleteAttachments
Throws

(string) "missing.callback.exception"

$http errors

Returns

object A result object.


var result {
     status: 0,
     statusMessage: "auth.no.errors", 
     api: "auth::post::users::passwords", // name of the call
     date: [Date object providing time call was made]
};

getArchiveAttachments(params, successHandler[, failureHandler]) → object

Retrieves all the attachments in a given archive.

Example

function getArchiveAttachments() {
     var params = {
         archiveid: attachmentids [comma separated list of archive IDs]
     };
     SFdamApi.getArchiveAttachments(params, handleGetArchiveAttachments);
}

function handleGetArchiveAttachments(result) {
     if ('0' === status) {
         $scope.currentAttachments = result.currentAttachments;
     } else {
         $scope.errorCode = result.status;
         $scope.errorMessage = result.statusMessage;
     }
}

Parameters

Name Type Optional Description

params

object

 

An object that provides the list of archive IDs for which attachments will be retrieved.


var params = {
     archiveid: attachmentids [comma separated list of archive IDs]
};

successHandler

function()

 

A function that is called back upon success.

failureHandler

function()

Yes

An optional function that is called back upon failure. If none is specified, the success callback is called with failure data. status, statusMessage, api and date.

Throws

(string) "missing.callback.exception"

$http errors

Returns

object A result object.


var result {
     status: 0,
     statusMessage: "auth.no.errors", 
     api: "auth::post::users::passwords", // name of the call
     date: [Date object providing time call was made],
     currentAttachments: [Array of attachments]
};

var attachment {
     affiliate: [SmartFlo™ affiliate to which the attachment belongs],
     accessible_by: [SmartFlo™ user ID or group access control],
     attachment_id: [unique SmartFlo™ ID for attachment],
     creator:SmartFlo™ user ID of user who uploaded the attachment content],
     creation_date: [date and time attachment content was uploaded],
     attachment_approval_status: [one of: 
         attachment.no.status (1)
         attachment.rejected (2)
         attachment.approved (3)
         attachment.pending (4)
         attachment.canceled (5)],
     attachment_approval_status_number: [one of: 1, 2, 3, 4, 5],
     display_name: user edited name given to attachment],
     checked_out_by: [if checked out, the user ID of the user who has checked it out],
     joinId: [full name of job to which the attachment belongs],
     comments: [Array of attachment comments],
     tags: [Array of attachment tags],
     properties: [Array of attachment properties],
     content: [URL to original content],
     content_mime_type:[MIME type of content],   
     content_low_res: [URL to reduced version of content suitable for use as a preview -
             for video content, an flv formated low-res movie, otherwise a reduced 
             image of bitmapped content and pdfs],
     content_preview: [URL to reduced version of content, used only for video files - 
             a still shot image from the video, suitable for use as a static preview],
     content_thumbnail: [URL to a reduced bitmapped image suitable for display as a thumbnail in a content gallery],
     size_in_bytes: [size of original content],
     previewImage: [URL to recommended content to display in web preview of image types - null if video type],
     previewVideo: [URL to recommended content to display in web preview of image types - null if image type],
     unsupportedMIME: [true or false depending upon whether the MIME type is supported in SmartFlo™]
};

getAttachmentsExport(params, successHandler[, failureHandler]) → object

Retrieves a URL to a zip file after exporting a selected list of attachments.

Example

function getAttachmentsExport() {
     var params = {
         attachmentids: attachmentids,
         previews: false
     };
     SFdamApi.getAttachmentsExport(params, handleGetAttachmentsExport);
}

function handleGetAttachmentsExport(result) {
     if ('0' === status) {
         $window.open(result.exportUrl);
     } else {
         $scope.errorCode = result.status;
         $scope.errorMessage = result.statusMessage;
     }
}

Parameters

Name Type Optional Description

params

object

 

An object that provides the list of attachment IDs and a flag indicating whther or not to include the previews in the export.


var params = {
     attachmentids: attachmentids [comma separated list of attachment IDs],
     previews: false | true [flag indication whether to include previews 
         as well as the original content in the export]
};

successHandler

function()

 

A function that is called back upon success.

failureHandler

function()

Yes

An optional function that is called back upon failure. If none is specified, the success callback is called with failure data. status, statusMessage, api and date.

Throws

(string) "missing.callback.exception"

$http errors

Returns

object A result object.


var result {
     status: 0,
     statusMessage: "auth.no.errors", 
     api: "auth::post::users::passwords", // name of the call
     date: [Date object providing time call was made],
     exportUrl: [URL to zip file of exported attachments]
};

getProperties(successHandler[, failureHandler]) → object

Retrieves Array holding the available properties the current user can assign to attachments.

Example

function handleGetProperties() {
     SFdamApi.getProperties(handleGetProperties);
}

function handleGetProperties(result) {
     if ('0' === status) {
         $scope.currentProperties = result.currentProperties;
     } else {
         $scope.errorCode = result.status;
         $scope.errorMessage = result.statusMessage;
     }
}

Parameters

Name Type Optional Description

successHandler

function()

 

A function that is called back upon success.

failureHandler

function()

Yes

An optional function that is called back upon failure. If none is specified, the success callback is called with failure data. status, statusMessage, api and date.

Throws

(string) "missing.callback.exception"

$http errors

Returns

object A result object.


var result {
     status: 0,
     statusMessage: "auth.no.errors", 
     api: "auth::post::users::passwords", // name of the call
     date: [Date object providing time call was made],
     currentProperties: [the Array of properties]
};

getSearchAttachments(params, successHandler[, failureHandler]) → object

Retrieves job attachments where search terms are used to find matching jobs, then attachments from those jobs returned:

  1. A jobs term search is performed to find matching jobs
  2. jobtype === running (running and suspended) | completed
    See: JobsAPI.getMatchingJobboardTasks

  3. The attachments belonging to these jobs are then found
  4. The attachment set is then filtered by the approvableonly value
  5. approvableonly === true | false
The job fields searched are same as those used to find jobs:

  • job data
  • brand, category, client_company, distribution_channel, item_description, item_id, product, project_id, task_id, task_name, project_manager, project_name, workflow_id, workflow_definition, resource_group, status

  • extended job metadata
  • account_name, art_due_date, creative_agency, customer_position, file_destination, master_artwork_template, num_of_units, production_schedule, program_owner, team, states_program, program_classification, program_type, legal_owner, alliance_owner, prize_logic_owner, program_manager_owner

Example

function getSearchAttachments() {
     var params = {
         approvableonly: [true | false],
         jobtype: [running | completed],
         terms: terms,
         pageSize: $scope.gallerySettings.itemsPerPage, [number of attachments per page]
         page: $scope.gallerySettings.currentPage [current page of resut set]
     };
     SFdamApi.getSearchAttachments(params, handleGetSearchAttachments);
}

function handleGetSearchAttachments(result) {
     if ('0' === status) {
         $scope.searchAttachments = result.searchAttachments;
     } else {
         $scope.errorCode = result.status;
         $scope.errorMessage = result.statusMessage;
     }
}

Parameters

Name Type Optional Description

params

object

 

An object that provides the list of attachment IDs and a flag indicating whther or not to include the previews in the export.


var params = {
     approvableonly: [true | false],
     jobtype: [running | completed],
     terms: terms,
     pageSize: $scope.gallerySettings.itemsPerPage, [number of attachments per page]
     page: $scope.gallerySettings.currentPage [current page of resut set]
};

successHandler

function()

 

A function that is called back upon success.

failureHandler

function()

Yes

An optional function that is called back upon failure. If none is specified, the success callback is called with failure data. status, statusMessage, api and date.

Throws

(string) "missing.callback.exception"

$http errors

Returns

object A result object.


var result {
     status: 0,
     statusMessage: "auth.no.errors", 
     api: "auth::post::users::passwords", // name of the call
     date: [Date object providing time call was made],
     searchAttachments: [the list of attachments matching the search]
};

getUserArchives(successHandler[, failureHandler]) → object

Retrieves object containing Array of top-level hierarchically ordered archive trees representing the user's set of archives and the sets of archives to which the user has been granted shared access.


                     Archive Trees
      _|___
     |                                             |
  Tree 1                                        Tree 2
     |                                             |
     -- archives Array             archives Array --
     -- folders Array               folders Array --
     -- id                                     id --
     -- name                                 name --  

At each level of a given tree is a folder object naming the node in the tree and holding archive objects and sub-folder objects.

archive { id: [40 character unique hash], archiveid: [full identity of archive], name: [display name of archive] };

folder { id: [full path in heirarchy tree identifying the current folder], name: [the current folder name], archives: [Array of srchive objects], folders: [Array of folder objects] };

Example

function getUserArchives() {
     SFdamApi.getUserArchives(handleGetUserArchives);
}

function handleGetUserArchives(result) {
     if ('0' === status) {
         $scope.archiveTrees = result.archiveTrees;
     } else {
         $scope.errorCode = result.status;
         $scope.errorMessage = result.statusMessage;
     }
}

Parameters

Name Type Optional Description

successHandler

function()

 

A function that is called back upon success.

failureHandler

function()

Yes

An optional function that is called back upon failure. If none is specified, the success callback is called with failure data. status, statusMessage, api and date.

Throws

(string) "missing.callback.exception"

$http errors

Returns

object A result object.


var result {
     status: 0,
     statusMessage: "auth.no.errors", 
     api: "auth::post::users::passwords", // name of the call
     date: [Date object providing time call was made],
     archiveTrees: [Object containing Array of user archive trees]
};

getVproofSession(params, successHandler[, failureHandler]) → object

Retrieves a URL to a vProof (Viki Proofing) collaboration session. Before this method can be used, the SmartFlo™ attachment must be uploaded to vProof.

Example

$scope.function getVproofSession() {
     params {
         viewmode: $scope.vproofAnnotateMode,
         attachmentids: $scope.vproofAttachmentIds
     };
     SFdamApi.getVproofSession(params, handleGetVproofSession);
}

function handleGetVproofSession(result) {
     if ('0' === status) {
         var vproofUrl = result.vproofUrl;
         if (vproofUrl && vproofUrl.length > 0) {
             $window.open(vproofUrl);
         }
     } else {
         $scope.errorCode = result.status;
         $scope.errorMessage = result.statusMessage;
     }
}

Parameters

Name Type Optional Description

params

object

 

An object that provides the view mode and a comma separated list of SmartFlo™ attachment IDs.


params {
     viewmode: $scope.vproofAnnotateMode,
     attachmentids: $scope.vproofAttachmentIds
};

The "viewmode" must be one of:

  • Default
  • SinglePage
  • Book
  • Compare
  • Grid
  • List
  • Report
  • Tile

successHandler

function()

 

A function that is called back upon success.

failureHandler

function()

Yes

An optional function that is called back upon failure. If none is specified, the success callback is called with failure data. status, statusMessage, api and date.

See also
postVproofAttachments
Throws

(string) "missing.callback.exception"

$http errors

Returns

object A result object.


var result {
     status: 0,
     statusMessage: "auth.no.errors", 
     api: "auth::post::users::passwords", // name of the call
     date: [Date object providing time call was made],
     vproofUrl: [URL to vProof session]
};

postAttachmentComment(params, successHandler[, failureHandler]) → object

Posts a new comment to a given set of attachments.

Example

function postAttachmentComment() {
     params {
         attachmentids: $scope.selectedAttachments,
         comment: [comment text],
         isprivate: [flag indicating whether the comment is 
             private or not to members of the group 
             "Private Comments User"],
     };
     SFdamApi.postAttachmentComment(params, handlePostAttachmentComment);
}

function handlePostAttachmentComment(result) {
     if ('0' === status) {
          $scope.attachmentThumbnailsSelected = [];
          $scope.getJobAttachments();
     } else {
         $scope.errorCode = result.status;
         $scope.errorMessage = result.statusMessage;
     }
}

Parameters

Name Type Optional Description

params

object

 

An object that provides a comma separated list of SmartFlo™ attachment IDs, a comment to apply and a flag indicating wethere the comment should be restricted to members of the group, "Private Comments User.


params {
     attachmentids: $scope.selectedAttachments,
     comment: [comment text],
     isprivate: [flag indicating whether the comment is 
         private or not to members of the group 
     "Private Comments User"],
};

successHandler

function()

 

A function that is called back upon success.

failureHandler

function()

Yes

An optional function that is called back upon failure. If none is specified, the success callback is called with failure data. status, statusMessage, api and date.

Throws

(string) "missing.callback.exception"

$http errors

Returns

object A result object.


var result {
     status: 0,
     statusMessage: "auth.no.errors", 
     api: "auth::post::users::passwords", // name of the call
     date: [Date object providing time call was made]
};

postAttachmentLocks(params, successHandler[, failureHandler]) → object

Posts a lock status on a set of SmartFlo™ attachments.

Example

function postAttachmentLocks() {
     params {
         lockstatus: checkedout,
         attachmentids: $scope.selectedAttachments
     };
     SFdamApi.postAttachmentLocks(params, handlePostAttachmentLocks);
}

function handlePostAttachmentLocks(result) {
     if ('0' === status) {
          $scope.attachmentThumbnailsSelected = [];
          $scope.getJobAttachments();
     } else {
         $scope.errorCode = result.status;
         $scope.errorMessage = result.statusMessage;
     }
}

Parameters

Name Type Optional Description

params

object

 

An object that provides a lock status to apply to a set of attachments identified by a comma separated list of SmartFlo™ attachment IDs.


params {
     lockstatus: [one of: unlocked, checkedout, checkedin],
     attachmentids: [comma separated list of attachment IDs]
};

The lock status must be one of:

  • unlocked
  • checkedout
  • checkedin

successHandler

function()

 

A function that is called back upon success.

failureHandler

function()

Yes

An optional function that is called back upon failure. If none is specified, the success callback is called with failure data. status, statusMessage, api and date.

Throws

(string) "missing.callback.exception"

$http errors

Returns

object A result object.


var result {
     status: 0,
     statusMessage: "auth.no.errors", 
     api: "auth::post::users::passwords", // name of the call
     date: [Date object providing time call was made]
};

postAttachmentProperties(params, successHandler[, failureHandler]) → object

Posts an attachment property to a set of SmartFlo™ attachments.

Example

function postAttachmentProperties() {
     params {
         propertyname: "Source",
         propertyvalue: "Weather Service",
         attachmentids: $scope.selectedAttachments
     };
     SFdamApi.postAttachmentProperties(params, handlePostAttachmentProperties);
}

function handlePostAttachmentProperties(result) {
     if ('0' === status) {
          $scope.attachmentThumbnailsSelected = [];
          $scope.getJobAttachments();
     } else {
         $scope.errorCode = result.status;
         $scope.errorMessage = result.statusMessage;
     }
}

Parameters

Name Type Optional Description

params

object

 

An object that provides a property name and a property value to apply to a set of attachments identified by a comma separated list of SmartFlo™ attachment IDs.


params {
     propertyname: property,
     propertyvalue: [value for property],
     attachmentids: [comma separated list of attachment IDs]
};

successHandler

function()

 

A function that is called back upon success.

failureHandler

function()

Yes

An optional function that is called back upon failure. If none is specified, the success callback is called with failure data. status, statusMessage, api and date.

See also
getProperties
Throws

(string) "missing.callback.exception"

$http errors

Returns

object A result object.


var result {
     status: 0,
     statusMessage: "auth.no.errors", 
     api: "auth::post::users::passwords", // name of the call
     date: [Date object providing time call was made]
};

postAttachmentStatus(params, successHandler[, failureHandler]) → object

Posts a status change to a set of SmartFo™ attachments.

Example

function postAttachmentStatus() {
     params {
         attachmentids: $scope.selectedAttachments,
         status: $scopeSelectedStatus
     };
     SFdamApi.postAttachmentStatus(params, handlePostAttachmentStatus);
}

function handlePostAttachmentStatus(result) {
     if ('0' === status) {
          $scope.attachmentThumbnailsSelected = [];
          $scope.getJobAttachments();
     } else {
         $scope.errorCode = result.status;
         $scope.errorMessage = result.statusMessage;
     }
}

Parameters

Name Type Optional Description

params

object

 

An object that provides a comma separated list of SmartFlo™ attachment IDs and a new status to apply to each attachment identified by those IDs.


params {
     attachmentids:[a comma separated list of SmartFlo™ attachment IDs],
     status: [the status]
};

Status must be one of:
  • attachment.no.status
  • attachment.rejected
  • attachment.approved
  • attachment.pending
  • attachment.canceled
  • attachment.annotated

successHandler

function()

 

A function that is called back upon success.

failureHandler

function()

Yes

An optional function that is called back upon failure. If none is specified, the success callback is called with failure data. status, statusMessage, api and date.

Throws

(string) "missing.callback.exception"

$http errors

Returns

object A result object.


var result {
     status: 0,
     statusMessage: "auth.no.errors", 
     api: "auth::post::users::passwords", // name of the call
     date: [Date object providing time call was made]
};

postAttachmentTags(params, successHandler[, failureHandler]) → object

Posts a set of tags to a set of SmartFlo™ attachments.

Example

function postAttachmentTags() {
     params {
         taglist: tag1, tag2,
         attachmentids: $scope.selectedAttachments
     };
     SFdamApi.postAttachmentTags(params, handlePostAttachmentTags);
}

function handlePostAttachmentTags(result) {
     if ('0' === status) {
          $scope.attachmentThumbnailsSelected = [];
          $scope.getJobAttachments();
     } else {
         $scope.errorCode = result.status;
         $scope.errorMessage = result.statusMessage;
     }
}

Parameters

Name Type Optional Description

params

object

 

An object that provides a comma separated list of tags to a set of attachments identified by a comma separated list of SmartFlo™ attachment IDs.


params {
     taglist: [comma separated list of tags],
     attachmentids: [comma separated list of attachment IDs]
};

successHandler

function()

 

A function that is called back upon success.

failureHandler

function()

Yes

An optional function that is called back upon failure. If none is specified, the success callback is called with failure data. status, statusMessage, api and date.

Throws

(string) "missing.callback.exception"

$http errors

Returns

object A result object.


var result {
     status: 0,
     statusMessage: "auth.no.errors", 
     api: "auth::post::users::passwords", // name of the call
     date: [Date object providing time call was made]
};

postDeleteAttachments(params, successHandler[, failureHandler]) → object

Deletes a set of attachments from the SmartFlo™ system.

Example

function postDeleteAttachments() {
     params {
         attachmentids: $scope.selectedAttachments
     };
     SFdamApi.postDeleteAttachments(params, handlePostDeleteAttachments);
}

function handlePostDeleteAttachments(result) {
     if ('0' === status) {
          $scope.attachmentThumbnailsSelected = [];
          $scope.getJobAttachments();
     } else {
         $scope.errorCode = result.status;
         $scope.errorMessage = result.statusMessage;
     }
}

Parameters

Name Type Optional Description

params

object

 

An object that provides a comma separated list of SmartFlo™ attachment IDs.


params {
     attachmentids: [comma separated list of attachment IDs]
};

successHandler

function()

 

A function that is called back upon success.

failureHandler

function()

Yes

An optional function that is called back upon failure. If none is specified, the success callback is called with failure data. status, statusMessage, api and date.

See also
deleteAttachments
Throws

(string) "missing.callback.exception"

$http errors

Returns

object A result object.


var result {
     status: 0,
     statusMessage: "auth.no.errors", 
     api: "auth::post::users::passwords", // name of the call
     date: [Date object providing time call was made]
};

postFileCheckIn(params, file, uploader, successHandler[, failureHandler]) → object

Checks-in a locked attachment and replaces it with a new version.

Example

function postFileCheckIn() {
     var params = {
         lockstatus: "checkedin",
         attachmentid: [comman separated list of attachmentids to check-in]
     };
     SFdamApi.postFileCheckIn(params, handlePostFileCheckIn);
}

function handlePostFileCheckIn(result) {
     if ('0' === status) {
         $scope.getJobAttachments();
     } else {
         $scope.errorCode = result.status;
         $scope.errorMessage = result.statusMessage;
     }
}

Parameters

Name Type Optional Description

params

object

 

An object that provides the list of attachment IDs and a flag indicating whther or not to include the previews in the export.


var params = {
     lockstatus: checkedin,
     attachmentid: [comma separated list of attachmentids to check-in] 
};

file

object

 

A JavaScript File object.

uploader

object

 

The Upload object from ng-file-upload.min.js.

successHandler

function()

 

A function that is called back upon success.

failureHandler

function()

Yes

An optional function that is called back upon failure. If none is specified, the success callback is called with failure data. status, statusMessage, api and date.

Requires
module:ng-file-upload.min.js
Throws

(string) "missing.callback.exception"

$http errors

Returns

object A result object.


var result {
     status: 0,
     statusMessage: "auth.no.errors", 
     api: "auth::post::users::passwords", // name of the call
     date: [Date object providing time call was made],
};

postFileUpload(params, file, uploader, successHandler[, failureHandler]) → object

Uploads a digital file and creates an attachment (asset).

Example

function postFileUpload() {
     var params = {
         archiveid: $scope.currentTask.job_id,
         taglist: $scope.formData.attachmentTags
         collaborationcycle: [cycle name - used iff task is collaboration task],
         isprivate: 'false' [flag indicating to keep from other reviewers but not monitor - used iff task is collaboration task]
     };
     SFdamApi.postFileUpload(params, handlePostFileUploadn);
}

function handlePostFileUpload(result) {
     if ('0' === status) {
         $scope.getJobAttachments();
     } else {
         $scope.errorCode = result.status;
         $scope.errorMessage = result.statusMessage;
     }
}

Parameters

Name Type Optional Description

params

object

 

An object that provides the list of attachment IDs and a flag indicating whther or not to include the previews in the export.


var params = {
         archiveid: $scope.currentTask.job_id,
         taglist: $scope.formData.attachmentTags
         collaborationcycle: [cycle name - used iff task is collaboration task],
         isprivate: 'false' [flag indicating to keep from other reviewers but not monitor - used iff task is collaboration task]
};

file

object

 

A JavaScript File object.

uploader

object

 

The Upload object from ng-file-upload.min.js.

successHandler

function()

 

A function that is called back upon success.

failureHandler

function()

Yes

An optional function that is called back upon failure. If none is specified, the success callback is called with failure data. status, statusMessage, api and date.

Requires
module:ng-file-upload.min.js
Throws

(string) "missing.callback.exception"

$http errors

Returns

object A result object.


var result {
     status: 0,
     statusMessage: "auth.no.errors", 
     api: "auth::post::users::passwords", // name of the call
     date: [Date object providing time call was made],
};

postVproofAttachments(params, successHandler[, failureHandler]) → object

Posts SmartFlo™ attachments to the vProof collaboration service.

Example

function postVproofAttachments() {
     params {
         attachmentids: $scope.vproofAttachmentIds,
     };
     SFdamApi.postVproofAttachments(params, handlePostVproofAttachments);
}

function handlePostVproofAttachments(result) {
     if ('0' === status) {
         if ($scope.vproofAttachmentIds.length > 0) {
             var params = {
                 viewmode: $scope.vproofAnnotateMode,
                 attachmentids: $scope.vproofAttachmentIds
             };
             $scope.getVproofSession(params, handleGetVproofSession);
         }
     } else {
         $scope.errorCode = result.status;
         $scope.errorMessage = result.statusMessage;
     }
}

Parameters

Name Type Optional Description

params

object

 

An object that provides a comma separated list of SmartFlo™ attachment IDs.


params {
     attachmentids: [comma separated list of SmartFlo™ attachment IDs]
};

successHandler

function()

 

A function that is called back upon success.

failureHandler

function()

Yes

An optional function that is called back upon failure. If none is specified, the success callback is called with failure data. status, statusMessage, api and date.

See also
getVproofSession
Throws

(string) "missing.callback.exception"

$http errors

Returns

object A result object.


var result {
     status: 0,
     statusMessage: "auth.no.errors", 
     api: "auth::post::users::passwords", // name of the call
     date: [Date object providing time call was made]
};