I am following docusign's tutorial to create an envelope using their PHP API. Tutorialis found here: http://www.docusign.com/developer-center/quick-start/request-signatures
I copied the code and downloaded the sample file, and am now getting this response: "errorCode": "UNSPECIFIED_ERROR", "message": "Buffer cannot be null.\r\nParameter name: buffer"
I think the error may be related to this section:
$requestBody = "\r\n"
."\r\n"
."--myboundary\r\n"
."Content-Type: application/json\r\n"
."Content-Disposition: form-data\r\n"
."\r\n"
."$data_string\r\n"
."--myboundary\r\n"
."Content-Type:application/pdf\r\n"
."Content-Disposition: file; filename=\"document.pdf\"; documentid=1 \r\n"
."\r\n"
."$file_contents\r\n"
."--myboundary--\r\n"
."\r\n";
The problem, i think, is that $data_string is not defined anywhere in their example. There is a data definition:
$data = "{
\"emailBlurb\":\"This comes from PHP\",
\"emailSubject\":\"API Signature Request\",
\"documents\":[
{
\"documentId\":\"1\",
\"name\":\"document.pdf\"
}
],
\"recipients\":{
\"signers\":[
{
\"email\":$email,
\"name\":$name,
\"recipientId\":\"1\",
\"tabs\":{
\"signHereTabs\":[
{
\"xPosition\":\"100\",
\"yPosition\":\"100\",
\"documentId\":\"1\",
\"pageNumber\":\"1\"
}
]
}
}
]
},
\"status\":\"sent\"
}";
....But not $data_string.
I tried using the "TEST" as the value for $data_string and got: "errorCode": "INVALID_MULTI_PART_REQUEST", "message": "An error was found while parsing the multipart request. The JSON data in the first part of the multi-part request does not match the expected format. The token 'true' was expected but found 'test'."
I then set the value of $data_string as a boolean (TRUE) and got the following error message: errorCode": "INVALID_MULTI_PART_REQUEST", "message": "An error was found while parsing the multipart request. The JSON data in the first part of the multi-part request does not match the expected format. "
Any help in resolving this is greatly appreciated.