signedly 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. signedly/__init__.py +92 -0
  2. signedly/api/__init__.py +14 -0
  3. signedly/api/api_request_logs_api.py +686 -0
  4. signedly/api/authentication_api.py +603 -0
  5. signedly/api/bulk_sending_api.py +858 -0
  6. signedly/api/documents_api.py +2465 -0
  7. signedly/api/downloads_api.py +840 -0
  8. signedly/api/fields_api.py +2308 -0
  9. signedly/api/sending_api.py +890 -0
  10. signedly/api/signatories_api.py +1165 -0
  11. signedly/api/templates_api.py +1452 -0
  12. signedly/api/webhooks_api.py +2582 -0
  13. signedly/api_client.py +798 -0
  14. signedly/api_response.py +21 -0
  15. signedly/configuration.py +596 -0
  16. signedly/exceptions.py +200 -0
  17. signedly/helpers.py +89 -0
  18. signedly/models/__init__.py +66 -0
  19. signedly/models/create_bulk_send202_response.py +105 -0
  20. signedly/models/create_bulk_send_request.py +101 -0
  21. signedly/models/create_document_fields_request_inner.py +156 -0
  22. signedly/models/create_document_from_template200_response.py +101 -0
  23. signedly/models/create_document_from_template_request.py +115 -0
  24. signedly/models/create_document_from_template_request_recipients_inner.py +92 -0
  25. signedly/models/create_signatories_request.py +100 -0
  26. signedly/models/create_signatories_request_signatories_inner.py +92 -0
  27. signedly/models/create_signatory_request.py +94 -0
  28. signedly/models/create_template_fields_request_inner.py +156 -0
  29. signedly/models/create_webhook_endpoint_request.py +103 -0
  30. signedly/models/delete_field_request.py +88 -0
  31. signedly/models/document.py +159 -0
  32. signedly/models/document_page.py +113 -0
  33. signedly/models/document_status_page.py +113 -0
  34. signedly/models/document_status_row.py +90 -0
  35. signedly/models/fill_and_send_document_request.py +116 -0
  36. signedly/models/fill_and_send_document_request_elements_inner.py +96 -0
  37. signedly/models/get_access_token_request.py +90 -0
  38. signedly/models/get_audit_trail_link200_response.py +88 -0
  39. signedly/models/get_download_status200_response.py +90 -0
  40. signedly/models/list_bulk_send_columns200_response_inner.py +92 -0
  41. signedly/models/model_field.py +202 -0
  42. signedly/models/page.py +102 -0
  43. signedly/models/refresh_access_token200_response.py +99 -0
  44. signedly/models/refresh_access_token_request.py +88 -0
  45. signedly/models/request_count_page.py +113 -0
  46. signedly/models/request_hit.py +93 -0
  47. signedly/models/request_log.py +108 -0
  48. signedly/models/request_log_page.py +113 -0
  49. signedly/models/send_document200_response.py +88 -0
  50. signedly/models/send_document_by_link200_response.py +90 -0
  51. signedly/models/send_document_by_link_request.py +91 -0
  52. signedly/models/send_document_request.py +102 -0
  53. signedly/models/signatory.py +119 -0
  54. signedly/models/template.py +124 -0
  55. signedly/models/template_field.py +202 -0
  56. signedly/models/template_page.py +113 -0
  57. signedly/models/update_document_field_by_body_request.py +158 -0
  58. signedly/models/update_document_field_by_body_request_items_inner.py +92 -0
  59. signedly/models/update_webhook_endpoint_request.py +105 -0
  60. signedly/models/upload.py +110 -0
  61. signedly/models/upload_document_for_one_signer200_response.py +90 -0
  62. signedly/models/upload_document_for_one_signer_request.py +96 -0
  63. signedly/models/upload_document_request.py +101 -0
  64. signedly/models/webhook_delivery.py +140 -0
  65. signedly/models/webhook_delivery_page.py +113 -0
  66. signedly/models/webhook_endpoint.py +116 -0
  67. signedly/models/webhook_endpoint_with_secret.py +120 -0
  68. signedly/py.typed +0 -0
  69. signedly/rest.py +258 -0
  70. signedly-0.1.0.dist-info/LICENSE +21 -0
  71. signedly-0.1.0.dist-info/METADATA +18 -0
  72. signedly-0.1.0.dist-info/RECORD +74 -0
  73. signedly-0.1.0.dist-info/WHEEL +5 -0
  74. signedly-0.1.0.dist-info/top_level.txt +1 -0
signedly/__init__.py ADDED
@@ -0,0 +1,92 @@
1
+ # coding: utf-8
2
+
3
+ # flake8: noqa
4
+
5
+ """
6
+ Signedly API
7
+
8
+ The Signedly REST API lets your system upload documents, add signatories and fields, send them for signing and download the signed result. Every path starts with `/ap1/`, and every request and response body is JSON unless an endpoint says otherwise (the uploads are `multipart/form-data`). ## Authentication 1. In the Signedly web app, open **Account & Settings → API** and generate a **client ID** and **client secret** for your organisation. 2. `POST /ap1/token/` with them. You get an `access_token` (valid **2 hours**) and a `refresh_token` (valid **7 days**). While both are still valid, calling `/ap1/token/` again returns the same pair. 3. Send the access token on every other call: `Authorization: Bearer <access_token>`. 4. When the access token expires, `POST /ap1/refreshtoken/` with the refresh token for a new access token. When the refresh token has expired too, call `/ap1/token/` again. `/ap1/token/` and `/ap1/refreshtoken/` allow 60 calls a minute per IP address; more answer 429. A missing, unknown or expired access token answers 403 (`\"Client not found\"` or `\"Access token expired\"`). The API acts for your **organisation's admin account**: documents you upload belong to it and appear in its Signedly web app, and you can reach only that account's documents, templates, signatories and fields. Another organisation's IDs answer 404, as if they didn't exist. ## Plans What the API allows depends on the Signedly plan of your **organisation's admin account** (Account & Settings → Account & Plan). The same rules apply to live and test keys. | What | Free | Personal Pro | Business Pro | Teams | |---|---|---|---|---| | Generate live and test keys (Account & Settings → API) | – | ✓ | ✓ | ✓ | | Every endpoint, `/ap1/token/` and `/ap1/refreshtoken/` included | – | ✓ | ✓ | ✓ | | `require_email_otp` on `POST /ap1/signatories/` and `POST /ap1/signatories/bulk/` | – | ✓ | ✓ | ✓ | | Bulk send: `GET /ap1/bulk-sends/columns/` and `POST /ap1/bulk-sends/` | – | – | – | ✓ | The API is part of the paid plans. On Free (or with no plan) every call answers 403 `\"... Your plan doesn't include API access.\"`, with live or test keys, also with a token or keys made earlier; they work again once the plan is paid. On a paid plan, a feature it doesn't include answers 400 with `\"Your plan doesn't include ...\"` and changes nothing, and `GET /ap1/bulk-sends/{id}/` still reports bulk sends already made. Live documents also need an API contract with Signedly. Without one, or with an unpaid API invoice, `POST /ap1/upload/` (except templates), `/ap1/upload_app/`, `/ap1/documents/fromtemplate/` and `/ap1/bulk-sends/` answer 402 with live keys. Test keys work without a contract (see Sandbox). ## Sending a document for signing 1. `POST /ap1/upload/` a PDF or DOCX (`type` 2). The document is prepared in the background: find it in `GET /ap1/documents/?name=<name>` (its `upload.id` is the upload's `id`), and wait until `GET /ap1/documents/{id}/pages/` lists its pages. 2. `POST /ap1/signatories/` (one) or `POST /ap1/signatories/bulk/` (several) to add the people who sign. 3. `POST /ap1/documents/fields/` to place the fields each signatory fills in. 4. Send it: - `POST /ap1/document/send/` emails every signatory a signing link (with ordered signing, only the first; each next one is emailed in turn), or - `POST /ap1/document/send_url/` sends no email and returns the first signatory's signing link, for you to show or send yourself. 5. Poll `GET /ap1/documents-status-list/` (or `GET /ap1/documents/`) until the status is 6 (Completed), then `GET /ap1/document/download-link/` for the signed PDF and `GET /ap1/document/download-audit-link/` for its audit trail. **From a template:** upload with `type` 4 and a `template_name` (or make the template in the web app), place its fields with `POST /ap1/templates/fields/`, then for each signing make a document with `POST /ap1/documents/fromtemplate/`, add its signatory, and send it. **One signer, one call:** `POST /ap1/upload_app/` uploads a PDF or DOCX for one signer and returns their signing link in `redirect_url`; the signer places their own signature. After signing they go to the `redirect_url` you sent, and the signed PDF and its audit trail are emailed to `final_email` (otherwise to your organisation's admin). ## Quick start with curl Each step uses an ID from the step before. `$API` is this server, e.g. `https://l0ads.signedly.com`. ```bash # 1. Token curl -X POST $API/ap1/token/ -H 'Content-Type: application/json' \\ -d '{\"client_id\": \"<client id>\", \"client_secret\": \"<client secret>\"}' TOKEN=<access_token from the answer> # 2. Upload a PDF (answers with the upload's id) curl -X POST $API/ap1/upload/ -H \"Authorization: Bearer $TOKEN\" \\ -F file=@nda.pdf -F name=nda-ann-lee -F type=2 # 3. Find the document, then wait until it has pages curl \"$API/ap1/documents/?name=nda-ann-lee\" -H \"Authorization: Bearer $TOKEN\" DOC=<results[0].id> curl $API/ap1/documents/$DOC/pages/ -H \"Authorization: Bearer $TOKEN\" PAGE=<[0].id> # 4. Add the signatory curl -X POST $API/ap1/signatories/ -H \"Authorization: Bearer $TOKEN\" \\ -H 'Content-Type: application/json' \\ -d '{\"document_id\": \"'$DOC'\", \"name\": \"Ann Lee\", \"email\": \"ann@example.com\"}' SIGNER=<id from the answer> # 5. Place her signature: 150 × 40 points, 72 points from the left, 640 from the top curl -X POST $API/ap1/documents/fields/ -H \"Authorization: Bearer $TOKEN\" \\ -H 'Content-Type: application/json' \\ -d '[{\"document_id\": \"'$DOC'\", \"signatory_id\": \"'$SIGNER'\", \"kind\": 2, \"label\": \"Signature\", \"placeholder\": \"Sign here\", \"page\": \"'$PAGE'\", \"page_number\": 0, \"x\": 72, \"y\": 640, \"width\": 150, \"height\": 40}]' # 6. Send it (Ann gets the signing email) curl -X POST $API/ap1/document/send/ -H \"Authorization: Bearer $TOKEN\" \\ -H 'Content-Type: application/json' \\ -d '{\"document_id\": \"'$DOC'\", \"subject\": \"Please sign the NDA\", \"message\": \"Hi Ann, please sign by Friday.\", \"expiry_date\": \"2026-12-31\"}' # 7. Poll until status is 6 (Completed), then get the signed PDF curl \"$API/ap1/documents-status-list/?document_ids=$DOC\" -H \"Authorization: Bearer $TOKEN\" curl \"$API/ap1/document/download-link/?id=$DOC\" -H \"Authorization: Bearer $TOKEN\" ``` ## Postman Import the whole API into Postman with **Import → Link** and `<this server>/swaggerap1/postman.json`. Set `client_id` and `client_secret` in the collection's **Variables**, run **Get an access token** (it saves the token for every other request), and set `document_id` when a request needs one. ## Webhooks Instead of polling, add an endpoint with `POST /ap1/webhooks/` (or in **Account & Settings → API**) and Signedly posts your organisation's document events to it: `document.sent`, `document.viewed`, `document.signed`, `document.approved`, `document.completed`, `document.rejected` and `document.expired` (all of them, or the `events` you choose). Each is a JSON `POST`: ```json {\"id\": \"5b7f…\", \"type\": \"document.signed\", \"created_at\": \"2026-10-27T09:12:00+00:00\", \"test\": false, \"data\": {\"document\": {\"id\": \"6f0c…\", \"name\": \"nda.pdf\", \"status\": 5}, \"recipient\": {\"id\": \"0b6e…\", \"email\": \"ann@example.com\", \"name\": \"Ann Lee\", \"role\": \"signer\"}}} ``` `recipient` is null for events no recipient caused (sent, completed, expired); `test` is true for documents made with your test keys. Fetch anything else, such as download links, with your access token: events never carry links. **Check every event is from Signedly.** The `Signedly-Signature` header is `t=<unix seconds>,v1=<signature>`, where the signature is the hex HMAC-SHA256 of `<t>.<raw body>` with the endpoint's secret. Refuse an event whose signature doesn't match or whose `t` is more than 5 minutes off: ```python import hashlib, hmac, time def is_from_signedly(secret, header, raw_body): parts = dict(item.split(\"=\", 1) for item in header.split(\",\")) signed = f\"{parts['t']}.{raw_body.decode()}\".encode() expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest() fresh = abs(time.time() - int(parts[\"t\"])) <= 300 return fresh and hmac.compare_digest(parts[\"v1\"], expected) ``` **Answer 2xx within 10 seconds**, then do the work. Anything else is retried after 1 and 5 minutes, then 30 minutes and 2, 5 and 10 hours (7 tries in about 18 hours). `Signedly-Event-Id` is the same on every try of an event: use it to ignore repeats. After 20 events in a row fail for good, Signedly switches the endpoint off and emails your organisation's admin; switch it on again with `PUT /ap1/webhooks/{id}/` and `\"is_active\": true`. Each endpoint's deliveries and their last answers are at `GET /ap1/webhooks/{id}/deliveries/`, and any can be sent again. ## Sandbox Build and test against the API without paying for documents: in **Account & Settings → API**, generate your **test keys**, and get a token with them at `/ap1/token/` as usual. Everything works the same, except that what you upload or make from a template with a test token is a **test document** (`is_test` on its upload): - every page of its PDF and of its audit trail says **TEST – NOT LEGALLY BINDING**; - its emails are real, with `[TEST]` at the start of the subject; - it isn't billed or counted toward your plan; - your organisation can make 50 a calendar month (templates don't count); the next upload answers 429. ## Fields Positions and sizes are in **PDF points** (1/72 inch), measured from the **top-left corner** of the page as it is displayed (rotation applied). `page_number` counts pages from 0. A field must sit wholly on its page (1 point of tolerance); otherwise it is refused with 400. A field's page and signatory can't be changed later: delete the field and add it again. ## Status values **Document `status`:** 1 Draft · 2 Signees Added · 3 Prepared · 4 Sent · 5 In Progress · 6 Completed · 7 Rejected · 8 Archived · 9 Expired. Signatories, fields and sends are only accepted while a document is 1–3 (not yet sent). **Signatory `status`:** 1 Waiting · 2 Invited · 3 Signed · 4 Viewed · 5 Rejected. ## Lists `GET /ap1/documents/`, `/ap1/documents-status-list/`, `/ap1/templates/`, `/ap1/logs/` and `/ap1/logs/hits/` are paged: pass `limit` (default 10) and `offset`, and read `count`, `next`, `previous` and `results` from the response. ## Errors | Status | Meaning | |---|---| | 400 | The request was refused, also when your plan doesn't include it (see Plans); the body says why (`{\"error\": \"...\"}`, or the name of each bad field with its messages). Nothing was changed. | | 403 | The access token is missing, unknown or expired; the client ID and secret or the refresh token were refused; the organisation's plan has no API access (Free, see Plans); or an `expiry_date` isn't in the future (`\"Invalid Date Entered\"`). | | 402 | No API contract, or an unpaid API invoice: live documents are refused (test keys keep working). | | 404 | The document, template, signatory or field doesn't exist or isn't yours. | | 429 | Too many token requests (wait a minute), or this month's 50 test documents are used. | | 5xx | Our side failed; retry later. | A send that times out may still have worked: check the document's status before sending again (a second send of a sent document answers 400). Download, view and audit links are valid for about 7 days; ask for a new one whenever you need it.
9
+
10
+ The version of the OpenAPI document: v1
11
+ Contact: info@signedly.com
12
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
13
+
14
+ Do not edit the class manually.
15
+ """ # noqa: E501
16
+
17
+
18
+ __version__ = "0.1.0"
19
+
20
+ # import apis into sdk package
21
+ from signedly.api.api_request_logs_api import APIRequestLogsApi
22
+ from signedly.api.authentication_api import AuthenticationApi
23
+ from signedly.api.bulk_sending_api import BulkSendingApi
24
+ from signedly.api.documents_api import DocumentsApi
25
+ from signedly.api.downloads_api import DownloadsApi
26
+ from signedly.api.fields_api import FieldsApi
27
+ from signedly.api.sending_api import SendingApi
28
+ from signedly.api.signatories_api import SignatoriesApi
29
+ from signedly.api.templates_api import TemplatesApi
30
+ from signedly.api.webhooks_api import WebhooksApi
31
+
32
+ # import ApiClient
33
+ from signedly.api_response import ApiResponse
34
+ from signedly.api_client import ApiClient
35
+ from signedly.configuration import Configuration
36
+ from signedly.exceptions import OpenApiException
37
+ from signedly.exceptions import ApiTypeError
38
+ from signedly.exceptions import ApiValueError
39
+ from signedly.exceptions import ApiKeyError
40
+ from signedly.exceptions import ApiAttributeError
41
+ from signedly.exceptions import ApiException
42
+
43
+ # import models into sdk package
44
+ from signedly.models.create_bulk_send202_response import CreateBulkSend202Response
45
+ from signedly.models.create_bulk_send_request import CreateBulkSendRequest
46
+ from signedly.models.create_document_fields_request_inner import CreateDocumentFieldsRequestInner
47
+ from signedly.models.create_document_from_template200_response import CreateDocumentFromTemplate200Response
48
+ from signedly.models.create_document_from_template_request import CreateDocumentFromTemplateRequest
49
+ from signedly.models.create_document_from_template_request_recipients_inner import CreateDocumentFromTemplateRequestRecipientsInner
50
+ from signedly.models.create_signatories_request import CreateSignatoriesRequest
51
+ from signedly.models.create_signatories_request_signatories_inner import CreateSignatoriesRequestSignatoriesInner
52
+ from signedly.models.create_signatory_request import CreateSignatoryRequest
53
+ from signedly.models.create_template_fields_request_inner import CreateTemplateFieldsRequestInner
54
+ from signedly.models.create_webhook_endpoint_request import CreateWebhookEndpointRequest
55
+ from signedly.models.delete_field_request import DeleteFieldRequest
56
+ from signedly.models.document import Document
57
+ from signedly.models.document_page import DocumentPage
58
+ from signedly.models.document_status_page import DocumentStatusPage
59
+ from signedly.models.document_status_row import DocumentStatusRow
60
+ from signedly.models.fill_and_send_document_request import FillAndSendDocumentRequest
61
+ from signedly.models.fill_and_send_document_request_elements_inner import FillAndSendDocumentRequestElementsInner
62
+ from signedly.models.get_access_token_request import GetAccessTokenRequest
63
+ from signedly.models.get_audit_trail_link200_response import GetAuditTrailLink200Response
64
+ from signedly.models.get_download_status200_response import GetDownloadStatus200Response
65
+ from signedly.models.list_bulk_send_columns200_response_inner import ListBulkSendColumns200ResponseInner
66
+ from signedly.models.model_field import ModelField
67
+ from signedly.models.page import Page
68
+ from signedly.models.refresh_access_token200_response import RefreshAccessToken200Response
69
+ from signedly.models.refresh_access_token_request import RefreshAccessTokenRequest
70
+ from signedly.models.request_count_page import RequestCountPage
71
+ from signedly.models.request_hit import RequestHit
72
+ from signedly.models.request_log import RequestLog
73
+ from signedly.models.request_log_page import RequestLogPage
74
+ from signedly.models.send_document200_response import SendDocument200Response
75
+ from signedly.models.send_document_by_link200_response import SendDocumentByLink200Response
76
+ from signedly.models.send_document_by_link_request import SendDocumentByLinkRequest
77
+ from signedly.models.send_document_request import SendDocumentRequest
78
+ from signedly.models.signatory import Signatory
79
+ from signedly.models.template import Template
80
+ from signedly.models.template_field import TemplateField
81
+ from signedly.models.template_page import TemplatePage
82
+ from signedly.models.update_document_field_by_body_request import UpdateDocumentFieldByBodyRequest
83
+ from signedly.models.update_document_field_by_body_request_items_inner import UpdateDocumentFieldByBodyRequestItemsInner
84
+ from signedly.models.update_webhook_endpoint_request import UpdateWebhookEndpointRequest
85
+ from signedly.models.upload import Upload
86
+ from signedly.models.upload_document_for_one_signer200_response import UploadDocumentForOneSigner200Response
87
+ from signedly.models.upload_document_for_one_signer_request import UploadDocumentForOneSignerRequest
88
+ from signedly.models.upload_document_request import UploadDocumentRequest
89
+ from signedly.models.webhook_delivery import WebhookDelivery
90
+ from signedly.models.webhook_delivery_page import WebhookDeliveryPage
91
+ from signedly.models.webhook_endpoint import WebhookEndpoint
92
+ from signedly.models.webhook_endpoint_with_secret import WebhookEndpointWithSecret
@@ -0,0 +1,14 @@
1
+ # flake8: noqa
2
+
3
+ # import apis into api package
4
+ from signedly.api.api_request_logs_api import APIRequestLogsApi
5
+ from signedly.api.authentication_api import AuthenticationApi
6
+ from signedly.api.bulk_sending_api import BulkSendingApi
7
+ from signedly.api.documents_api import DocumentsApi
8
+ from signedly.api.downloads_api import DownloadsApi
9
+ from signedly.api.fields_api import FieldsApi
10
+ from signedly.api.sending_api import SendingApi
11
+ from signedly.api.signatories_api import SignatoriesApi
12
+ from signedly.api.templates_api import TemplatesApi
13
+ from signedly.api.webhooks_api import WebhooksApi
14
+