- Change Signaturit.podspect VERSION.
- Change User Agent VERSION.
- git commit --allow-empty -m "Release VERSION"
- git tag VERSION
- git push origin master
- git push origin VERSION
- pod spec lint Signaturit.podspec --allow-warnings
- pod trunk register [email protected] Signaturit
- pod trunk push Signaturit.podspec --allow-warnings
This package is a Swift wrapper around the Signaturit API. If you didn't read the documentation yet, maybe it's time to take a look here.
The recommended way to install the SDK is through cocoapods.
You can use Cocoapods to install Signaturit adding it to your Podfile:
platform :ios, '8.0'
use_frameworks!
target 'MyApp' do
pod 'Signaturit'
end
Please note that by default the client will use our sandbox API. When you are ready to start using the production environment just get the correct access token and pass an additional argument to the constructor:
let Signaturit = Signaturit(accessToken: "YOUR_ACCESS_TOKEN")
Count your signature requests.
client.countSignatures().responseJSON { response in
print(response)
}
Retrieve all data from your signature requests using different filters.
client.getSignatures().responseJSON { response in
print(response)
}
client.getSignatures(50).responseJSON { response in
print(response)
}
let params = ["crm_id": "CUSTOM_ID"]
client.getSignatures(100, offset: 0, conditions: params).responseJSON { response in
print(response)
}
Get the information regarding a single signature request passing its ID.
client.getSignature("SIGNATURE_ID").responseJSON { response in
print(response)
}
Create a new signature request. You can check all signature params.
let file = NSBundle.mainBundle().URLForResource("Document", withExtension: "pdf")
let recipients = [["email": "[email protected]", "name": "John Doe"]]
let params = ["subject": "Receipt no. 250", "body": "Please sign the receipt"]
client.createSignature([file], recipients: recipients, params: params, successHandler: { response in
print(response)
})
You can add custom info in your requests
let file = NSBundle.mainBundle().URLForResource("Document", withExtension: "pdf")
let recipients = [["email": "[email protected]", "name": "John Doe"]]
let params = ["subject": "Receipt no. 250", "body": "Please sign the receipt", "data": ["crm_id": "45673"]]
client.createSignature([file], recipients: recipients, params: params, successHandler: { response in
print(response)
})
You can send templates with the fields filled
let file = NSBundle.mainBundle().URLForResource("Document", withExtension: "pdf")
let recipients = [["email": "[email protected]", "name": "John Doe"]]
let params = ["subject": "Receipt no. 250", "body": "Please sign the receipt", "templates": ["template_name"]]
client.createSignature([], recipients: recipients, params: params, successHandler: { response in
print(response)
})
Cancel a signature request.
client.cancelSignature("SIGNATURE_ID").responseJSON { response in
print(response)
}
Send a reminder email.
client.sendSignatureReminder("SIGNATURE_ID").responseJSON { response in
print(response)
}
Get the audit trail of a signature request document
let path = Alamofire.Request.suggestedDownloadDestination(directory: .DocumentDirectory, domain: .UserDomainMask)
client.downloadAuditTrail("SIGNATURE_ID", documentId: "DOCUMENT_ID", path: path).responseJSON { response in
print(response)
}
Get the signed document of a signature request document
let path = Alamofire.Request.suggestedDownloadDestination(directory: .DocumentDirectory, domain: .UserDomainMask)
client.downloadSignedDocument(SIGNATURE_ID, documentId: "DOCUMENT_ID", path: path).responseJSON { response in
print(response)
}
Get all account brandings.
client.getBrandings().responseJSON { response in
print(response)
}
Get a single branding.
client.getBranding("BRANDING_ID").responseJSON { response in
print(response)
}
Create a new branding. You can check all branding params.`
let params = [
"layout_color": "#FFBF00",
"text_color": "#2A1B0A",
"application_texts": ["sign_button": "Sign!"]
]
client.createBranding(params).responseJSON { response in
print(response)
}
Update a single branding.
let params = ["application_texts" => ["send_button" => "Send!"]]
client.updateBranding("BRANDING_ID", params: params).responseJSON { response in
print(response)
}
Retrieve all data from your templates.
client.getTemplates().responseJSON { response in
print(response)
}
####Get all certified emails
response = client.getEmails().responseJSON { response in
print(response)
}
####Get last 50 emails
response = client.getEmails(50).responseJSON { response in
print(response)
}
####Navigate through all emails in blocks of 50 results
response = client.getEmails(50, offset: 50).responseJSON { response in
print(response)
}
Count all certified emails
response = client.countEmails().responseJSON { response in
print(response)
}
Get a single email
client.getEmail("EMAIL_ID").responseJSON { response in
print(response)
}
Create a new certified email.
let file = NSBundle.mainBundle().URLForResource("Document", withExtension: "pdf")
let recipients = [["email": "[email protected]", "name": "John Doe"]]
let subject = "Swift subject"
let body = "Swift body"
let params = []
client.createEmail([file], recipients: recipients, subject :subject, body: body, params: params, successHandler: { response in
print(response)
})
Get the audit trail document of an email request.
let path = Alamofire.Request.suggestedDownloadDestination(directory: .DocumentDirectory, domain: .UserDomainMask)
client.downloadEmailAuditTrail("EMAIL_ID", certificateId: "CERTIFICATE_ID", path: path).responseJSON { response in
print(response)
}