FoxPro Programming
Help with Docusign API
Gravatar is a globally recognized avatar based on your email address. Help with Docusign API
  Gregg B
  All
  Apr 26, 2023 @ 06:52am

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.)
Gravatar is a globally recognized avatar based on your email address. re: Help with Docusign API
  Rick Strahl
  Gregg B
  Apr 26, 2023 @ 10:26am

Uh.... Code and JSON don't match at all?

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Help with Docusign API
  Gregg B
  Rick Strahl
  Apr 26, 2023 @ 10:51am

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.

© 1996-2024