Я следую учебнику docusign, чтобы создать конверт, используя их PHP API. Учебник можно найти здесь: http://www.docusign.com/developer-center/quick-start/request-signatures
Я скопировал код и загрузил образец файла, и теперь получаю этот ответ: "errorCode": "UNSPECIFIED_ERROR", "message": "Буфер не может быть нулевым.\r\nИмя параметра: буфер"
Я думаю, что ошибка может быть связана с этим разделом:
$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";
Проблема, я думаю, в том, что $data_string нигде в их примере не определена. Есть определение данных:
$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\"
}";
....Но не $data_string.
Я попытался использовать «ТЕСТ» в качестве значения для $data_string и получил: "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'."
Затем я установил значение $data_string как логическое значение (TRUE) и получил следующее сообщение об ошибке: 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. "
Любая помощь в решении этого вопроса приветствуется.