Reputation: 2290
Basically I've developed a solution that works in Sandbox but not in production.
{
"documents":[
{
"documentId":"73110157",
"fileExtension":"pdf",
"name":"Standard Swell HIC-clean.pdf",
"documentBase64":"omitted_the_base64_string"
}
],
"emailSubject":"Standard Swell Home Improvement Contract",
"recipients":{
"carbonCopies":[
{
"email":"[email protected]",
"name":"Name",
"recipientId":"2",
"routingOrder":"2"
},
{
"email":"[email protected]",
"name":"Name",
"recipientId":"3",
"routingOrder":"3"
},
{
"email":"[email protected]",
"name":"Name",
"recipientId":"4",
"routingOrder":"4"
}
],
"signers":[
{
"email":"[email protected]",
"name":"Mic Nuss",
"recipientId":"1",
"routingOrder":"1",
"clientUserId":"an-alpha-numeric-ID",
"roleName":"Customer",
"tabs":{
"dateSignedTabs":[
{
"anchorString":"signer1date",
"anchorYOffset":"-2",
"anchorXOffset":"0",
"fontSize":"Size10",
"name":"Date Signed",
"recipientId":"1",
"tabLabel":"date_signed",
"anchorIgnoreIfNotPresent":"true",
"documentId":"73110157"
}
],
"fullNameTabs":[
{
"anchorString":"signer1name",
"anchorYOffset":"0",
"anchorXOffset":"-10",
"fontSize":"Size10",
"name":"Full Name",
"recipientId":"1",
"tabLabel":"Full Name",
"anchorIgnoreIfNotPresent":"true",
"documentId":"73110157"
}
],
"signHereTabs":[
{
"anchorString":"signer1sig",
"anchorUnits":"mms",
"anchorXOffset":"-10",
"anchorYOffset":"3",
"name":"Please sign here",
"optional":"false",
"recipientId":"1",
"scaleValue":1,
"tabLabel":"signer1sig",
"anchorIgnoreIfNotPresent":"true",
"documentId":"73110157"
}
],
"initialHereTabs":[
{
"anchorString":"signer1initials",
"anchorUnits":"mms",
"anchorXOffset":"13",
"anchorYOffset":"10",
"name":"Your Initials here",
"optional":"false",
"recipientId":"1",
"scaleValue":1,
"tabLabel":"signer1initials",
"anchorIgnoreIfNotPresent":"true",
"documentId":"73110157"
}
],
"textTabs":[
{
"anchorString":"signer1c_info",
"anchorUnits":"mms",
"anchorXOffset":"-4",
"anchorYOffset":"-2",
"anchorIgnoreIfNotPresent":"true",
"locked":"true",
"name":"Client Info",
"shared":"true",
"tabLabel":"signer1c_info",
"value":"Mic Nuss\n2223834843\[email protected]",
"width":"167",
"height":"58",
"documentId":"73110157"
},
{
"anchorString":"signer1c_address",
"anchorUnits":"mms",
"anchorXOffset":"-4",
"anchorYOffset":"-2",
"anchorIgnoreIfNotPresent":"true",
"locked":"true",
"name":"Client Address",
"shared":"true",
"tabLabel":"signer1c_address",
"value":"Rua Frederico Perry Vidal, Lisbon, 7900, Lisbon",
"width":"167",
"height":"58",
"documentId":"73110157"
},
{
"anchorString":"signer1c_contractor",
"anchorUnits":"mms",
"anchorXOffset":"-4",
"anchorYOffset":"-2",
"anchorIgnoreIfNotPresent":"true",
"locked":"true",
"name":"Contractor Info",
"shared":"true",
"tabLabel":"signer1c_contractor",
"value":"Solarcity\nfalse",
"width":"167",
"height":"58",
"documentId":"73110157"
},
{
"anchorString":"signer1c_epc_license",
"anchorUnits":"mms",
"anchorXOffset":"-3",
"anchorYOffset":"-1",
"anchorIgnoreIfNotPresent":"true",
"locked":"true",
"name":"Contractor License",
"shared":"true",
"tabLabel":"signer1c_epc_license",
"value":"888104",
"width":"130",
"height":"10",
"documentId":"73110157"
},
{
"anchorString":"signer1c_product",
"anchorUnits":"mms",
"anchorXOffset":"-2",
"anchorYOffset":"0",
"anchorIgnoreIfNotPresent":"true",
"locked":"true",
"name":"Product Name",
"shared":"true",
"tabLabel":"signer1c_product",
"value":"Sonnen Eco 10",
"width":"450",
"height":"70",
"documentId":"73110157"
},
{
"anchorString":"signer1c_scope",
"anchorUnits":"mms",
"anchorXOffset":"-4",
"anchorYOffset":"-2",
"anchorIgnoreIfNotPresent":"true",
"locked":"true",
"name":"Scope of Work",
"shared":"true",
"tabLabel":"signer1c_scope",
"value":"",
"width":"450",
"height":"90",
"documentId":"73110157"
},
{
"anchorString":"signer1c_total_contract",
"anchorUnits":"mms",
"anchorXOffset":"0",
"anchorYOffset":"-1",
"anchorIgnoreIfNotPresent":"true",
"locked":"true",
"name":"Base Price",
"shared":"true",
"tabLabel":"signer1c_total_contract",
"value":"19557.5",
"width":"200",
"height":"15",
"documentId":"73110157"
},
{
"anchorString":"signer1c_credits",
"anchorUnits":"mms",
"anchorXOffset":"0",
"anchorYOffset":"-1",
"anchorIgnoreIfNotPresent":"true",
"locked":"true",
"name":"Credits",
"shared":"true",
"tabLabel":"signer1c_credits",
"value":"250.0",
"width":"200",
"height":"15",
"documentId":"73110157"
},
{
"anchorString":"signer1c_amount_due",
"anchorUnits":"mms",
"anchorXOffset":"0",
"anchorYOffset":"-1",
"anchorIgnoreIfNotPresent":"true",
"locked":"true",
"name":"Net Price",
"shared":"true",
"tabLabel":"signer1c_amount_due",
"value":"19307.5",
"width":"200",
"height":"15",
"documentId":"73110157"
},
{
"anchorString":"signer1c_amount_owner",
"anchorUnits":"mms",
"anchorXOffset":"0",
"anchorYOffset":"-1",
"anchorIgnoreIfNotPresent":"true",
"locked":"true",
"name":"Amount Due from Owner",
"shared":"true",
"tabLabel":"signer1c_amount_owner",
"value":"19307.5",
"width":"200",
"height":"15",
"documentId":"73110157"
},
{
"anchorString":"signer1c_amount_financier",
"anchorUnits":"mms",
"anchorXOffset":"0",
"anchorYOffset":"-1",
"anchorIgnoreIfNotPresent":"true",
"locked":"true",
"name":"Amount Due from Financier",
"shared":"true",
"tabLabel":"signer1c_amount_financier",
"value":"0",
"width":"200",
"height":"15",
"documentId":"73110157"
},
{
"anchorString":"signer1c_financier",
"anchorUnits":"mms",
"anchorXOffset":"0",
"anchorYOffset":"-1",
"anchorIgnoreIfNotPresent":"true",
"locked":"true",
"name":"Financier",
"shared":"true",
"tabLabel":"signer1c_financier",
"value":"",
"width":"200",
"height":"15",
"documentId":"73110157"
},
{
"anchorString":"signer1c_signing_value",
"anchorUnits":"mms",
"anchorXOffset":"0",
"anchorYOffset":"-1",
"anchorIgnoreIfNotPresent":"true",
"locked":"true",
"name":"Down Payment",
"shared":"true",
"tabLabel":"signer1c_signing_value",
"value":"1000.0",
"width":"130",
"height":"15",
"documentId":"73110157"
},
{
"anchorString":"signer1c_delivery_value",
"anchorUnits":"mms",
"anchorXOffset":"0",
"anchorYOffset":"-1",
"anchorIgnoreIfNotPresent":"true",
"locked":"true",
"name":"Delivery Payment",
"shared":"true",
"tabLabel":"signer1c_delivery_value",
"value":"11584.5",
"width":"130",
"height":"15",
"documentId":"73110157"
},
{
"anchorString":"signer1c_install_value",
"anchorUnits":"mms",
"anchorXOffset":"0",
"anchorYOffset":"-1",
"anchorIgnoreIfNotPresent":"true",
"locked":"true",
"name":"Installation Payment",
"shared":"true",
"tabLabel":"signer1c_install_value",
"value":"5792.25",
"width":"130",
"height":"15",
"documentId":"73110157"
},
{
"anchorString":"signer1c_final_value",
"anchorUnits":"mms",
"anchorXOffset":"0",
"anchorYOffset":"-1",
"anchorIgnoreIfNotPresent":"true",
"locked":"true",
"name":"Final Payment",
"shared":"true",
"tabLabel":"signer1c_final_value",
"value":"930.75",
"width":"130",
"height":"15",
"documentId":"73110157"
},
{
"anchorString":"signer1c_installation_partner",
"anchorUnits":"mms",
"anchorXOffset":"0",
"anchorYOffset":"-1",
"anchorIgnoreIfNotPresent":"true",
"locked":"true",
"name":"Installation Partner Name",
"shared":"true",
"tabLabel":"signer1c_installation_partner",
"value":"Solarcity",
"width":"200",
"height":"10",
"documentId":"73110157"
},
{
"anchorString":"signer1c_epc_address",
"anchorUnits":"mms",
"anchorXOffset":"0",
"anchorYOffset":"-1",
"anchorIgnoreIfNotPresent":"true",
"locked":"true",
"name":"Installation Partner Address",
"shared":"true",
"tabLabel":"signer1c_epc_address",
"value":"false",
"width":"520",
"height":"15",
"documentId":"73110157"
},
{
"anchorString":"signer1c_email_epc",
"anchorUnits":"mms",
"anchorXOffset":"0",
"anchorYOffset":"-1",
"anchorIgnoreIfNotPresent":"true",
"locked":"true",
"name":"Installation Partner Email",
"shared":"true",
"tabLabel":"signer1c_email_epc",
"value":"",
"width":"200",
"height":"15",
"documentId":"73110157"
},
{
"anchorString":"signer1c_date_in_3",
"anchorUnits":"mms",
"anchorXOffset":"0",
"anchorYOffset":"-2",
"anchorIgnoreIfNotPresent":"true",
"locked":"true",
"name":"Date in 3",
"shared":"true",
"tabLabel":"signer1c_date_in_3",
"value":"2016-07-22",
"width":"130",
"height":"15",
"documentId":"73110157"
},
{
"anchorString":"signer1c_kitchen",
"anchorUnits":"mms",
"anchorXOffset":"-4",
"anchorYOffset":"-1",
"anchorIgnoreIfNotPresent":"true",
"locked":"true",
"name":"Requested Circuits Kitchen",
"shared":"true",
"tabLabel":"signer1c_kitchen",
"value":"Refrigerator/Freezer;Coffee Machine or Tea Kettle;Microwave",
"width":"450",
"height":"30",
"documentId":"73110157"
},
{
"anchorString":"signer1c_utilities",
"anchorUnits":"mms",
"anchorXOffset":"-4",
"anchorYOffset":"-1",
"anchorIgnoreIfNotPresent":"true",
"locked":"true",
"name":"Requested Circuits Utilities",
"shared":"true",
"tabLabel":"signer1c_utilities",
"value":"Security System",
"width":"450",
"height":"30",
"documentId":"73110157"
},
{
"anchorString":"signer1c_media",
"anchorUnits":"mms",
"anchorXOffset":"-4",
"anchorYOffset":"-1",
"anchorIgnoreIfNotPresent":"true",
"locked":"true",
"name":"Requested Circuits Media",
"shared":"true",
"tabLabel":"signer1c_media",
"value":"Television \u0026 Cable/Satellite Box;Internet Router \u0026 WiFi",
"width":"370",
"height":"30",
"documentId":"73110157"
},
{
"anchorString":"signer1c_outlets",
"anchorUnits":"mms",
"anchorXOffset":"-4",
"anchorYOffset":"-1",
"anchorIgnoreIfNotPresent":"true",
"locked":"true",
"name":"Requested Circuits Outlets",
"shared":"true",
"tabLabel":"signer1c_outlets",
"value":"Kitchen;",
"width":"450",
"height":"30",
"documentId":"73110157"
},
{
"anchorString":"signer1c_lighting",
"anchorUnits":"mms",
"anchorXOffset":"-4",
"anchorYOffset":"-1",
"anchorIgnoreIfNotPresent":"true",
"locked":"true",
"name":"Requested Circuits Lighting",
"shared":"true",
"tabLabel":"signer1c_lighting",
"value":"Kitchen;",
"width":"450",
"height":"30",
"documentId":"73110157"
}
]
}
}
]
},
"status":"sent"
}
This is the payload that is being sent. I've tried with a slimmer document, and just one signing TAB, and one Signer, no BCC's.
I've tried with the base64 document I encode (after downloading it from the docusign template), I've tried getting the Docusign base64 document encoded itself by Docusign, I've downloaded the template and copied the base64 content of the file, all to no avail.
I've tried creating simply an envelope from an existing template, without "documents" key. I've tried erasing different optional fields, but the only time the response changes is when I erase some field that is definitively required, and then I get that as a response.
All of this worked flawlessly on the Sandbox. The documents were first created from scratch in Production, but then I thought it might be due to that and instead did as the API transition notes mention and downloaded the templates from Sandbox as JSON and uploaded them directly into production.
The envelopes are being created on the fly, and we basically log into an account and get the templates for that account and proceed to get the document base64 file from the template we need. Login and that part are working, we get into the account and we are able to retrieve them, so headers and credentials are passing and login is ok.
The payload is also being correctly sent, the one I posted here is from an actual call that I logged.
It's not related to the embedded view because it breaks before reaching that point.
The response I'm getting is:
{
"errorCode": "UNSPECIFIED_ERROR",
"message": "Input string was not in a correct format."
}
I've also tried with 3 different lib's, net-http, curb (curl wrap for ruby) and Rest-Client.
I tried without setting the Document ID in the tabs as well with other keys.
I'm posting to base_url/v2/accounts/{accountId}/envelopes
Any help would be greatly appreciated, thanks
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::EDIT::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Tried with a much simpler request, just to create an envelope and it still doesn't work. The same error.
This is the log from Docusign Server: (login, and access is fine, retrieving accounts, templates for that account, the documents and downloading the doc works, just the post isn't working at all - while it does in Sandbox)
POST https://na2.docusign.net:8821/restapi/v2/accounts/15308603/envelopes
Content-Length: 973
Content-Type: application/json
Accept: application/json
Host: na2.docusign.net
User-Agent: Ruby
X-Docusign-Authentication: {"Username":"[email protected]","Password":"[omitted]","IntegratorKey":"[omitted]"}
X-Forwarded-For: 83.132.223.215
X-SecurityProtocol-Version: TLSv1.2
X-SecurityProtocol-CipherSuite: ECDHE-RSA-AES256-GCM-SHA384
{"emailSubject":"DocuSign REST API Quickstart Sample","emailBlurb":"Shows how to create and send an envelope from a document.","recipients":{"signers":[{"email":"[email protected]","name":"My Name","recipientId":"1","routingOrder":"1"}]},"documents":[{"documentId":"44202387","fileExtension":"pdf","name":"test.pdf","documentBase64":"ew0KICAidGVtcGxhdGVJZCI6ICIxYjZjY2FkMS01ZDFmLTQwM2EtYjRhMC0zZTVkZjU1OThhZTUiLA0KICAidGVtcGxhdGVEb2N1bWVudHMiOiBbDQogICAgew0KICAgICAgImRvY3VtZW50SWQiOiAiNDQyMDIzODciLA0KICAgICAgIm5hbWUiOiAidGVzdC5wZGYiLA0KICAgICAgInR5cGUiOiAiY29udGVudCIsDQogICAgICAidXJpIjogIi90ZW1wbGF0ZXMvMWI2Y2NhZDEtNWQxZi00MDNhLWI0YTAtM2U1ZGY1NTk4YWU1L2RvY3VtZW50cy80NDIwMjM4NyIsDQogICAgICAib3JkZXIiOiAiMSIsDQogICAgICAicGFnZXMiOiAiMSIsDQogICAgICAiYXZhaWxhYmxlRG9jdW1lbnRUeXBlcyI6IFsNCiAgICAgICAgew0KICAgICAgICAgICJ0eXBlIjogImVsZWN0cm9uaWMiLA0KICAgICAgICAgICJpc0RlZmF1bHQiOiAidHJ1ZSINCiAgICAgICAgfQ0KICAgICAgXQ0KICAgIH0NCiAgXQ0KfQ=="}],"status":"sent"}
400 BadRequest
Content-Type: application/json; charset=utf-8
{
"errorCode": "UNSPECIFIED_ERROR",
"message": "Input string was not in a correct format."
}
Upvotes: 1
Views: 709
Reputation: 13500
The error message ("Input string was not in a correct format.") seems to suggest that one of the string values you're specifying in the request is somehow invalid. Perhaps try escaping the backslash characters (by specifying \\
instead of just \
) in the value attribute for each of the following three tabs?
Requested Circuits Media
Client Info
Contractor Info
Upvotes: 1
Reputation: 49114
You passed the certification step so your integration_key / client_id has been promoted to the production platform?
You're calling the API with https?
Are you able to make a simpler call to the production platform successfully? Eg Folders: list
What authentication style are you using? OAuth or Legacy Header or something else?
THe nature of the error message indicates that you should check the platform API logs. Have you done that?
Upvotes: 0