FoxPro Programming
Help with Docusign API
Maybe someone on this forum has experience with the Docusign API? In VFP, I'm trying to form JSON that looks like this but am having problem with the third level (in the red brackets):
Here is my code:
loCustomer = CREATEOBJECT("EMPTY")
ADDPROPERTY(loCustomer,"documents")
loDocument = CREATEOBJECT("EMPTY")
ADDPROPERTY(loDocument, "documentBase64",encoded_doc)
ADDPROPERTY(loDocument, "documentId", "1234")
ADDPROPERTY(loDocument, "fileExtension", "pdf")
ADDPROPERTY(loDocument, "name", "My Doc")
*************************************************************
ADDPROPERTY(loCustomer,"emailSubject", "Please Sign")
*************************************************************
loCol = CREATEOBJECT("Collection")
loCol.Add(loDocument)
loCustomer.documents = loCol
SELECT email, name, rec_id as recipientId;
FROM f:\westwind\docusign\table2;
INTO CURSOR Qsigners
ADDPROPERTY(loCustomer,"Recipients", CREATEOBJECT("Empty"))
ADDPROPERTY(loCustomer.Recipients, "signers","cursor:Qsigners")
ADDPROPERTY(loCustomer,"status", "sent")
lcjson = loSer.Serialize(loCustomer, .T.)

Uh.... Code and JSON don't match at all?
+++ Rick ---
Sorry. I posted the JSON that didn't work, not the JSON that does work. Here is what works:
{
"documents": [
{
"documentbase64": "JVBE...",
"documentid": "1234",
"fileextension": "pdf",
"name": "My Doc"
}
],
"emailsubject": "Please Sign",
"recipients": {
"signers": [
{
"email": "gregg.barfield@ledgerspace.net",
"name": "Gregg Barfield",
"recipientid": "12345",
}
]
},
"status": "sent"
}
My problem is when "tabs" start. I can't get JSON to branch off from there.