Client SDK
The client SDK provides an encapsulated library exposing simple to use methods that hide the complexity of integrating with our Rest API.
* The provided SDKs' codes are on Github. Fork me on GitHub
JavaScript
We also host the JavaScript version from our hosting.
Please add the following script reference in the header section of your page
<script data-main="https://api.securedsigning.com/web/v1.4/client/scripts/main" src="https://api.securedsigning.com/web/v1.4/client/scripts/require.js"></script>
To initialise the JavaScript SDK library
First create a config object as shown below
var config = {
"apiKey": <YOUR API KEY HERE>,
"baseUrl": "https://api.securedsigning.com/web",
"version": "v1.4",
"secret": <YOUR API SECRET HERE>,
"scope": <SCOPEs REQUIRED>
};
Next initialise the library.
We have provided a function SSApiLoaded
that executes when the scripts have loaded if you are using our hosted JavaScript libraries
function SSApiLoaded() {
securedsigning = new SecuredSigning(config);
};
Before any action, get OAuth2 access token using OAuth 2 Implicit flow.
We have provided a function securedsigning.getAccessToken
to help you to start the process.
An SDK method call normally takes 3 parameters
- requestData: the data required for performing the task
- onSuccess: Callback function to handle a successful request
- onError: Callback function to handle any errors
An example
securedsigning.sendSmartTagDocument(smartTagData, function (result) {
console.log(result);
},function (error) {
console(error);
});
.NET
You can view the source code on GitHub HERE
Install our .NET client SDK
SecuredSigning.Client PM> Install-Package SecuredSigning.Client
This library has the following dependencies Newtonsoft.Json, ServiceStack.Client.Signed, ServiceStack.Text.Signed and ServiceStack.Interfaces
To initialise the library call the constructor
var client = new ServiceClient("https://api.securedsigning.com/web","v1.4", <YOUR API KEY HERE>, <YOUR API SECRET HERE>, <YOUR CALLBACK URL HERE>);
Before any action, get OAuth2 access token using OAuth 2 Authorization Code flow.
We have provided a series of functions to help you to complete the OAuth 2 process.
OAuth2.CreateAuthorizeRequest
to generate the authorize request URL.
OAuth2.HandleAuthorizeCallback
to handle authorize callback from Secured Signing.
OAuth2.GetToken
to get access token.
OAuth2.RefreshToken
to refresh access token.
OAuth2.RevokeToken
to revoke access token.
We have provided data objects for the requests e.g.
[Schema("EmailTemplate")]
public class EmailTemplate
{
public string Reference { get; set; }
public string Name { get; set; }
}
An example of a function call
var forms = client.getFormList();
Other Languages
We have provided more client SDKs of different programing languages as well, with their source codes on GitHub.
UI SDK
The UI SDK is provided as part of the JavaScript sdk. Please add the scripts as below
<script data-main="https://api.securedsigning.com/web/v1.4/client/scripts/main" src="https://api.securedsigning.com/web/v1.4/client/scripts/require.js"></script>
Initialising SDK
To initialise the JavaScript SDK library
First create a config object as shown below
var config = {
"apiKey": <YOUR API KEY HERE>,
"baseUrl": "//api.securedsigning.com/web",
"version": "v1.4",
"secret": <YOUR API SECRET HERE>,
"scope": <SCOPEs REQUIRED>
};
Get access token
You can use our login control to start OAuth 2 process.
Use the following JavaScript function passing in a DOM element id for the login button
securedsigning.CreateLogin("login");
Uploading a document
You can use our uploader to add a document for signing
Use the following JavaScript function passing in a DOM element id for the upload button
This then on Success starts an ISign or WeSign process
securedsigning.CreateUpload(<DOM ELEMENT ID>, function(data) {
ISign(data.Reference);
//WeSign(data.Reference);
},function (error) {
alert(error);
});
After a document is submitted, a reference will return.
Embedding html resources
I Sign
For an I Sign signing process, the OAuth 2 scopes are "Basic" and "ISign".
This embeds a signing resource in a DOM element with the id of 'content'.
function ISign(ref) {
var request = {
DocumentReference: ref
};
securedsigning.getISignResource(request, "content", function (error) {
});
}
We Sign
For an We Sign signing process, the OAuth 2 scopes are "Basic" and "WeSign"
This embeds a signing resource in a DOM element with the id of 'content'.
function WeSign(ref) {
var request = {
DocumentReference: ref
};
securedsigning.getWeSignResource2(request, "content", function (error) {
});
}
The invitees details can be pre-configured when setting up the WeSign request
function WeSign(ref) {
var request = {
DocumentReference: ref,
//other options
DisableBroadcast: false,
SelectOnly: false,
NotifyUrl:'',
Invitees: [{
firstname: 'User1', //first name
lastname: 'Test', //last name
email: 'user1@sample.com' //email address
}, {
firstname: 'User2',
lastname: 'Test',
email: 'user2@sample.com'
}]
};
securedsigning.getWeSignResource2(request, "content", function (error) {
});
}
And fields from your system as well
function WeSign(ref) {
var request = {
DocumentReference: ref,
//other options
DisableBroadcast: false,
SelectOnly: false,
NotifyUrl:'',
Integration: {
Name: 'Integration 1', //your integration name
FieldGroups: [{ //your integration records/objects
GroupID: "Account__Fields__a1", //record unique ID
GroupIcon: "", //record icon
GroupLabel: "Account Fields", //record label
GroupName: "Account", //record name
GroupRecordID: "a1", //record ID
GroupRecordLabel: "Company A", //record display name
Fields: [{ //record fields
ControlType: 0, //field type, values see below
FieldLabel: "Account Name", //field label
FieldName: "Name", //field name
FieldType: "STRING", //field type in your system
FieldValue: "Company A" //field value
}, {
ControlType: 5,
FieldLabel: "Account Type",
FieldName: "Type",
FieldType: "PICKLIST",
FieldValue: "Technology Partner",
Options: [ //field options, e.g. for dropdown list
{
Label: "Technology Partner", //option label
Value: "Technology Partner" //option value
},
{
Label: "Other",
Value: "Other"
}]
}]
}, {
GroupID: "Contact__Fields__b1",
GroupIcon: "",
GroupLabel: "Contact Fields",
GroupName: "Contact ",
GroupRecordID: "b1",
GroupRecordLabel: "Peter Green",
Fields: [{
ControlType: 0,
FieldLabel: "Last Name",
FieldName: "LastName",
FieldType: "STRING",
FieldValue: "Green"
},
{
ControlType: 0,
FieldLabel: "First Name",
FieldName: "FirstName",
FieldType: "STRING",
FieldValue: "Peter"
}]
}]
}
};
securedsigning.getWeSignResource2(request, "content", function (error) {
});
}
Supported Control types
- Text
- 0
- Multi Line Text
- 1
- Check Box
- 3
- Radio Button
- 4
- Dropdown List
- 5
- Date
- 6
- Email
- 7
- Number
- 8
- Multiple Select Dropdown List
- 9
- Phone
- 15
- Integer
- 16
Download a sample webpage HERE.