要在Adobesign PHP API v6中为自定义字段设置位置,您可以使用以下代码示例:
use AdobeSign\AdobeSign;
use AdobeSign\AdobeSignException;
use AdobeSign\OAuth;
$clientId = 'YOUR_CLIENT_ID';
$clientSecret = 'YOUR_CLIENT_SECRET';
$refreshToken = 'YOUR_REFRESH_TOKEN';
$baseURI = 'https://api.echosign.com/api/rest/v6';
$accessToken = OAuth::refreshToken($clientId, $clientSecret, $refreshToken, $baseURI);
// Create a new agreement
$agreementInfo = array(
'fileInfos' => array(
array(
'transientDocumentId' => 'YOUR_TRANSIENT_DOCUMENT_ID',
'documentFileName' => 'YOUR_DOCUMENT_FILENAME'
)
),
'name' => 'Agreement Name',
'signatureType' => 'ESIGN',
'participantSetsInfo' => array(
array(
'memberInfos' => array(
array(
'email' => 'example@example.com'
)
),
'order' => 1
)
),
'status' => 'OUT_FOR_SIGNATURE',
'customFieldValues' => array(
array(
'fieldName' => 'CUSTOM_FIELD_NAME',
'value' => 'CUSTOM_FIELD_VALUE',
'editable' => true,
'hidden' => false
)
)
);
try {
$agreementId = AdobeSign::createAgreement($accessToken, $baseURI, $agreementInfo);
echo 'Agreement created with ID: ' . $agreementId;
} catch (AdobeSignException $e) {
echo 'Error creating agreement: ' . $e->getMessage();
}
在上面的示例中,您需要将YOUR_CLIENT_ID
,YOUR_CLIENT_SECRET
和YOUR_REFRESH_TOKEN
替换为您自己的Adobe Sign凭据。您还需要提供YOUR_TRANSIENT_DOCUMENT_ID
和YOUR_DOCUMENT_FILENAME
以及自定义字段的名称和值。
此代码示例将创建一个新的协议,并为自定义字段设置位置。您可以根据自己的需求进行修改和扩展。