net sdk
1.0.0
該軟件包是Signaturit API周圍的網狀包裝器。如果您還沒有閱讀文檔,也許是時候在這裡看看。
為了執行測試套件:
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat="opencover"
將信息上傳到Sonarqube:
dotnet tool install --global dotnet-sonarscanner --version 4.7.1
dotnet sonarscanner begin /o:"signaturit" /k:signaturit_net-sdk /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="YOUR_TOKEN" /s:"$(PWD)/SonarQube.Analysis.xml"
dotnet build
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat="opencover"
dotnet sonarscanner end /d:sonar.login="YOUR_TOKEN"
安裝SDK的推薦方法是通過project.json。
" dependencies " : {
" signaturit " : " 1.0.0 "
}然後實例化在API訪問令牌中傳遞的客戶端類。
string accessToken = "OTllYjUwM2NhYmNjNmJlYTZlNWEzNWYzYmZjNTRiZWI2YjU0ZjUxNzUwZDRjZjEwZTA0ZTFkZWQwZGExNDM3ZQ" ;
Signaturit . Client client = new Signaturit . Client ( accessToken ) ;請注意,默認情況下,客戶端將使用我們的沙盒API。當您準備開始使用生產環境時,只需獲得正確的訪問令牌,然後將附加參數傳遞給構造函數:
Signaturit . Client client = new Signaturit . Client ( accessToken , true ) ; 計算您的簽名請求。
object response = client . countSignatures ( ) ;使用不同的過濾器從簽名請求中檢索所有數據。
object response = client . getSignatures ( ) ; object response = client . getSignatures ( 50 ) ; object response = client . getSignatures ( 100 , 0 , new { crm_id = "CUSTOM_ID" } )獲取有關通過其ID的單個簽名請求的信息。
object response = client . getSignature ( "a066298d-2877-11e4-b641-080027ea3a6e" ) ;創建一個新的簽名請求。
object files = new [ ] {
"./documents/contracts/receipt250.pdf"
} ;
object recipients = new [ ] {
new { name = "Mr John" , email = "[email protected]" }
} ;
object parameters = new {
subject = "Receipt no. 250" ,
body = "Please sign the receipt"
} ;
object response = client . createSignature ( files , recipients , parameters ) ;您可以在請求中添加自定義信息
object files = new [ ] {
"./documents/contracts/receipt250.pdf"
} ;
object recipients = new [ ] {
new { name = "Mr John" , email = "[email protected]" }
} ;
object parameters = new {
subject = "Receipt no. 250" ,
body = "Please sign the receipt" ,
data = new {
crm_id = "45673"
}
} ;
object response = client . createSignature ( files , recipients , parameters ) ;您可以發送填充字段的模板
object recipients = new [ ] {
new { name = "Mr John" , email = "[email protected]" }
} ;
object parameters = new {
subject = "Receipt no. 250" ,
body = "Please sign the receipt" ,
templates = "template_name" ,
data = new {
widget_id = "default value"
}
} ;
object response = client . createSignature ( files , recipients , parameters ) ;取消簽名請求。
object response = client . cancelSignature ( "a066298d-2877-11e4-b641-080027ea3a6e" ) ;發送提醒電子郵件。
object response = client . sendReminder ( "a066298d-2877-11e4-b641-080027ea3a6e" ) ;獲取簽名請求文件的審計踪跡
string response = client . downloadAuditTrail ( "a066298d-2877-11e4-b641-080027ea3a6e" , "d474a1eb-2877-11e4-b641-080027ea3a6e" ) ;獲取簽名請求文件的簽名文件
string response = client . downloadSignedDocument ( "a066298d-2877-11e4-b641-080027ea3a6e" , "d474a1eb-2877-11e4-b641-080027ea3a6e" ) ; 獲取所有帳戶品牌。
object response = client . getBrandings ( ) ;獲得一個品牌。
object response = client . getBranding ( "6472aad7-2877-11e4-b641-080027ea3a6e" ) ;創建一個新的品牌。
object parameters = new {
layout_color = "#FFBF00" ,
text_color = "#2A1B0A" ,
application_texts = new { sign_button = "Sign!" }
} ;
object response = client . createBranding ( parameters ) ;更新單個品牌。
object parameters = new {
application_texts = new { send_button = "Send!" }
} ;
object response = client . updateBranding ( "6472aad7-2877-11e4-b641-080027ea3a6e" , parameters ) ; 從模板中檢索所有數據。
object response = client . getTemplates ( ) ; ####獲取所有經過認證的電子郵件
object response = client . getEmails ( )####獲取最後50封電子郵件
object response = client . getEmails ( 50 )####瀏覽50個結果的所有電子郵件
object response = client . getEmails ( 50 , 50 )計算所有經過認證的電子郵件
object response = client . countEmails ( )收到一封電子郵件
object response = client . getEmail ( "EMAIL_ID" )創建新的認證電子郵件。
object files = new [ ] {
"./demo.pdf" ,
"./receipt.pdf"
} ;
object recipients = new [ ] {
new { name = "Mr John" , email = "[email protected]" }
} ;
object parameters = new {
subject = "NET subject" ,
body = "NET body"
} ;
object response = client . createEmail ( files , recipients , "NET subject" , "NET body" )獲取電子郵件請求的審計跟踪文件。
string response = client . downloadEmailAuditTrail ( "EMAIL_ID" , "CERTIFICATE_ID" )