Skip to content

Instantly share code, notes, and snippets.

View cw6365's full-sized avatar
💭
Commercial software developer

Chris Ward cw6365

💭
Commercial software developer
View GitHub Profile
COMPANY_NAME: 'company'
UUID: 'uuid__legacy_'
JOB_TITLE: 'jobtitle'
TRIAL: 'in_trial'
VISITOR_ID: 'visitor_id__legacy_'
SOURCE: 'source__legacy_'
REFERRER: 'referrer'
CAMPAIGN: 'campaign__legacy_'
MEDIUM: 'medium__legacy_'
KEYWORDS: 'keywords__legacy_'
{
"resource_id": "FRM019ae3ddab9f7f1da424ccfbff380350",
"company_id": 415978371,
"person_id": "PERfc9290c478bd4c82ae5bf08bb1ab484a",
"company_resource_id": "COM90ce18c155894558801b34b68accf8da",
"person_resource_id": "PERfc9290c478bd4c82ae5bf08bb1ab484a",
"lead_status": "",
"form_data": {
"Business email": "[email protected]",
"First name": "Chris",
async generateCertificate(
keyPair: {keyPair: any; privateKey: any},
request: EjbcaRequest,
): Promise<string> {
const csr = await this.createCSR(keyPair, request);
return `-----BEGIN CERTIFICATE REQUEST-----\n${this.formatPEM(
toBase64(
arrayBufferToString(
csr, // Convert the CSR to a base64 string
),
entity.name:E-Sign-API-V3 (Sandbox)
entity.type:SERVICE
hostname:app1-2.e-sign.co.uk
level:INFO
message:
Target: https://esigns.azurewebsites.net/esignwebhook/9cfa62f9-cd50-4423-a8a5-3d47275c81e9,
Event: envelope_completed,
webhookable_id: 535983,
webhookable_type: Envelope,
payload: {"envelope":{"id":"e03e6dd1-b3bd-4f3d-9991-03a3bbe9e2a3","title":"sample","subject":"","description":"","envelope_status":"Signed","href":"https://xyz.e-sign.co.uk/#/v3/envelopes/e03e6dd1-b3bd-4f3d-9991-03a3bbe9e2a3","language":"english","thumbnail":"https://esign-staging.s3-eu-west-1.amazonaws.com/uploads/document_image/002/333/149/thumb_ef7080b7-ac5b-42ac-8083-86b1aceeed7e_1.png?X-Amz-Expires=86400\u0026X-Amz-Date=20240606T103231Z\u0026X-Amz-Algorithm=AWS4-HMAC-SHA256\u0026X-Amz-Credential=AKIAJLGLLV6CP7FXUFRA/20240606/eu-west-1/s3/aws4_request\u0026X-Amz-SignedHeaders=host\u0026X-Amz-Signature=a05a06701521bd95d554fd446d1f04bc3a635af08aacac16059
## get webhooks
curl -X 'GET' \
'https://sandbox.e-sign.co.uk/v3/webhooks' \
-H 'accept: application/json' \
-H 'Authorization: Bearer bearertoken'
## create webhook
```
curl -X 'POST' \
⋊> ~/S/e-sign-sharepoint on main ◦ gulp package-solution 07:34:48
Build target: DEBUG
[07:35:04] Using gulpfile ~/Sites/e-sign-sharepoint/gulpfile.js
[07:35:04] Starting 'package-solution'...
[07:35:04] Starting gulp
[07:35:04] Starting subtask 'package-solution'...
[07:35:04] [package-solution] Found manifest: b34efd1c-0c32-44c0-aa52-b245a6477f8c.manifest.json
[07:35:04] [package-solution] Found teams icons: 9f850f12-df0f-4f1c-800c-a249c7117705_color.png
[07:35:04] [package-solution] Found teams icons: 9f850f12-df0f-4f1c-800c-a249c7117705_outline.png
[07:35:04] [package-solution] Verifying configuration...
{
"envelope": {
"id": "53660c74-c28d-4474-be22-1cba3f4cd658",
"title": "Contract Signing Pack",
"subject": "",
"description": "",
"envelope_status": "Pending",
"href": "https://xyz.e-sign.co.uk/#/v3/envelopes/53660c74-c28d-4474-be22-1cba3f4cd658",
"language": "english",
"thumbnail": "https://esign-staging.s3-eu-west-1.amazonaws.com/uploads/document_image/002/317/947/thumb_Credit_Agreement_1.png?X-Amz-Expires=86400\u0026X-Amz-Date=20240426T084533Z\u0026X-Amz-Algorithm=AWS4-HMAC-SHA256\u0026X-Amz-Credential=AKIAJLGLLV6CP7FXUFRA/20240426/eu-west-1/s3/aws4_request\u0026X-Amz-SignedHeaders=host\u0026X-Amz-Signature=7d92a272f08ab6f5cee1b353b99fed3d2c95b2c9e4216de5518c26c25a98ddb8",
curl -X 'POST' \
'https://sandbox.e-sign.co.uk/v3/oauth/applications' \
-H 'accept: application/json' \
-H 'Authorization: Token token="3-s1gn2kSh4r3p01nt!"' \
-H 'Content-Type: application/json' \
-d '{
"oauth_app": {
"name": "Sharepoint user1",
"redirect_uri": "https://test.com",
"scopes": ["read_write"]
When a user chooses a document to sign.. the document gets uploaded to E-Sign and we use the id in the response to create the E-Sign redirect url
curl -X 'POST' \
'https://sandbox.e-sign.co.uk/v3/uploads' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJpZCI6InJRY0swLVNXUkFjUHFfSVAyV05kWlpVU0xzbklvdyIsImF1dGhfdG9rZW4iOiJQdnJzTmp6YlNoRWFtcVU0TUpveSIsInN1YiI6Ijc0MCIsInNjcCI6InVzZXIiLCJhdWQiOm51bGwsImlhdCI6MTcxMjg0NTY4MiwiZXhwIjoxNzE1MDA1NjgyLCJqdGkiOiI4NzRkN2ZkNS1hOTExLTQ0ZDAtOTBlNy1jNjA1NjQ4ZTE5YjYifQ.9O5afb3u9TNn3qa6RCPDEoaGIQ2QBhR1Ww2dFLNl9Hc' \
-H 'Content-Type: application/json' \
-d '{
"uploads": [
[{
: field => {
"id" => 7337990, "field_name" => "", "field_type" => "embossed-text", "page" => nil, "saved_field_file_id" => 325603, "created_at" => Mon, 04 Dec 2023 14: 32: 58.000000000 GMT + 00: 00, "updated_at" => Mon, 04 Dec 2023 14: 32: 58.000000000 GMT + 00: 00, "field_required" => true, "signer_idx" => 0, "file" => "b44358ca-685f-4f2b-bab7-a72527408eb2", "field_placeholder" => nil, "uuid" => "0b614931-15cb-4bb1-9a19-ba9e78707d71"
},
: position => {
"id" => 179352287, "positionable_id" => 7337990, "positionable_type" => "SavedField", "x" => 18.8, "y" => 27.9, "page" => 2, "document_id" => nil, "created_at" => Mon, 04 Dec 2023 14: 32: 58.000000000 GMT + 00: 00, "updated_at" => Mon, 04 Dec 2023 14: 32: 58.000000000 GMT + 00: 00, "document_signer_id" => nil, "placeholder" => false, "email" => nil, "width" => 33.2, "height" => 2.7, "size" => nil
}
}, {
: field => {
"id" => 7337991, "field_name" => "signature-1", "field_type" => "signature", "page" => nil, "saved_field_file_id" => 3256