javascript - Creating an envelope from a template returning "UNSPECIFIED_ERROR" -
when try create envelope template response of:
{ errorcode: 'unspecified_error', message: 'non-static method requires target.' }
here's i'm doing far:
first login, returns
{ loginaccounts: [ { name: '*****', accountid: '*****', baseurl: 'https://demo.docusign.net/restapi/v2/accounts/******', isdefault: 'true', username: '***** ********', userid: '*******-*****-*****-*****-*********', email: '********@*******.com', sitedescription: '' } ] }
so take baseurl out of response , attempt create envelope. i'm using hapi framework , async.waterfall
of async library, unfamiliar either of these use of async library uses next
callback call next function in case url iframe, , our usage of hapi framework appserver.wreck
roughy equivalent request
:
function prepareenvelope(baseurl, next) { var createentitlementtemplateid = "99c44f50-2c97-4074-896b-2454969caef7"; var getenvelopeurl = baseurl + "/envelopes"; var options = { headers: { "x-docusign-authentication": json.stringify(authheader), "content-type": "application/json", "accept": "application/json", "content-disposition": "form-data" }, body : json.stringify({ status: "sent", emailsubject: "test email subject", emailblurb: "my email blurb", templateid: createentitlementtemplateid, templateroles: [ { email: "anemailaddress@gmail.com", name: "recipient name", rolename: "signer1", clientuserid: "1099", // todo: replace user's id tabs : { texttabs : [ { tablabel : "acct_nmbr", value : "123456" }, { tablabel : "hm_phn_nmbr", value : "8005882300" }, { tablabel : "nm", value : "mr foo bar" } ] } } ] }) }; console.log("--------> options: ", options); // remove ==== appserver.wreck.post(getenvelopeurl, options, function(err, res, body) { console.log("request envelope result: \r\n", json.parse(body)); next(null, body, baseurl); }); }
and is:
{ errorcode: 'unspecified_error', message: 'non-static method requires target.' }
from little googling 'non-static method requires target.' c# error , doesn't give me indication of part of configuration object wrong.
i've tried simpler version of call stripping out of tabs , clientuserid , same response.
i created template on docusign website , haven't ruled out set incorrectly there. created template, confirmed docusign noticed named form fields, , created 'placeholder' templaterole.
here's templaterole placeholder:
here's 1 of named fields want populate , corresponding data label:
as side note, able basic vanilla example working without named fields nor using template using docusign node package fine didn't see way use tabs named form fields library , decided i'd rather have more fine-grained control on i'm doing anyway , opted hitting apis.
surprisingly when search errorcode , message i'm getting find 1 post without resolution :/
of course appreciated. please don't hesitate let me know if need additional information.
once received feedback docusign api call had empty body didn't take couple minutes me realize issue options object containing body
property rather payload
property, done in hapi framework.
Comments
Post a Comment