|
| 1 | +# API Operations Overview |
| 2 | + |
| 3 | +**API operations** define how clients interact with the system to perform actions such as creating, retrieving, updating, and deleting resources. These operations follow standard HTTP methods and structured request/response formats. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## API Structure |
| 8 | + |
| 9 | +**API structure** defines how endpoints, requests, and responses are organized to ensure consistency, scalability, and ease of use. A well-structured API follows RESTful principles and standard conventions. |
| 10 | + |
| 11 | +## Headers |
| 12 | + |
| 13 | +**Headers** are key-value pairs sent along with an API request or response. They provide metadata that helps the server understand how to process the request and how the client expects the response. |
| 14 | + |
| 15 | +### Headers Example |
| 16 | +| Name | Type | Required | Description | |
| 17 | +| ------------------- | ------------------ | -------- | ---------------------------------------------------------- | |
| 18 | +| `x-api-key` | string | ✅ Yes | API key used to authenticate the request | |
| 19 | +| `Content type` | application/json | ✅ Yes | Specifies that the API response is returned in JSON format | |
| 20 | + |
| 21 | + |
| 22 | +--- |
| 23 | + |
| 24 | +## Path Parameres |
| 25 | + |
| 26 | +A **path parameter** is a dynamic value included in the API URL that is used to uniquely identify and access a specific resource, enabling the system to perform operations on that resource. |
| 27 | + |
| 28 | +### Path Parameters Example |
| 29 | +| Name | Type | Required | Description | |
| 30 | +|-----|------|----------|-------------| |
| 31 | +| `template_name` | string | ✅ Yes | Specifies the template name | |
| 32 | + |
| 33 | +--- |
| 34 | + |
| 35 | +## Query Parameters |
| 36 | + |
| 37 | +**Query parameters** are optional values added to the URL to filter, modify, or customize API requests. They are passed as key-value pairs after the ? in the URL and help control how the data is retrieved or processed. |
| 38 | + |
| 39 | +### Query Parameters Example |
| 40 | +| Name | Type | Required | Description | |
| 41 | +|-----|------|----------|-------------| |
| 42 | +| `tracking_id` | string | ✅ Yes | Unique tracking identifier of the document | |
| 43 | +| `document_id` | string | ✅ Yes | Unique identifier of the document | |
| 44 | +| `party_id` | string | ✅ Yes | Unique identifier of the party | |
| 45 | + |
| 46 | +--- |
| 47 | + |
| 48 | +## Request Body |
| 49 | + |
| 50 | +The **request body** contains the data sent by the client to the API. It is mainly used in: |
| 51 | + |
| 52 | + - `POST` → Create data |
| 53 | + - `PUT` → Replace data |
| 54 | + - `PATCH` → Update partial data |
| 55 | + |
| 56 | +Most APIs use `JSON` format for the request body. |
| 57 | + |
| 58 | +### Request Body Example |
| 59 | + |
| 60 | +``` |
| 61 | +json |
| 62 | +
|
| 63 | +{ |
| 64 | + "name": "Company Details", |
| 65 | + "description": "Stores company-related information", |
| 66 | + "fields": [ |
| 67 | + { |
| 68 | + "field_name": "company_name", |
| 69 | + "type": "string", |
| 70 | + "required": true |
| 71 | + }, |
| 72 | + { |
| 73 | + "field_name": "address", |
| 74 | + "type": "string", |
| 75 | + "required": false |
| 76 | + } |
| 77 | + ] |
| 78 | +} |
| 79 | +``` |
| 80 | + |
| 81 | +--- |
| 82 | + |
| 83 | +## Response Body |
| 84 | + |
| 85 | +The **response body** is the data returned by the API after processing a client request. It provides: |
| 86 | + |
| 87 | + - Operation status |
| 88 | + - Resulting data |
| 89 | + - Error details (if any) |
| 90 | + |
| 91 | +Most APIs return responses in `JSON` format. |
| 92 | + |
| 93 | +### Response Body Example |
| 94 | + |
| 95 | +``` |
| 96 | +json |
| 97 | +
|
| 98 | +{ |
| 99 | + "status": "success", |
| 100 | + "message": "Operation completed successfully", |
| 101 | + "data": "", |
| 102 | + "errors": null |
| 103 | +} |
| 104 | +``` |
| 105 | + |
| 106 | +--- |
| 107 | + |
| 108 | +## API Endpoints |
| 109 | + |
| 110 | +### Authorization Management APIs |
| 111 | + |
| 112 | +| Operation | Method | Endpoint | |
| 113 | +| ------------------------- | ------ | ------------------------------- | |
| 114 | +| Register User | POST | `/api/auth/register` | |
| 115 | +| Login User | POST | `/api/auth/login` | |
| 116 | +| Email Verification | POST | `/api/auth/verify-email` | |
| 117 | +| Resend Verification Email | POST | `/api/auth/resend-verification` | |
| 118 | +| Create API Key | POST | `/api/auth/api-key` | |
| 119 | + |
| 120 | +--- |
| 121 | + |
| 122 | +### Files Operation APIs |
| 123 | + |
| 124 | +| Operation | Method | Endpoint | |
| 125 | +| -------------------- | ------ | ----------------------------------- | |
| 126 | +| Get Document | GET | `/api/files/{document_id}` | |
| 127 | +| Get Documents | GET | `/api/files` | |
| 128 | +| Redirect URL | GET | `/api/files/{document_id}/redirect` | |
| 129 | +| Get Folder Structure | GET | `/api/files/folders` | |
| 130 | +| Upload Files | POST | `/api/files/upload` | |
| 131 | + |
| 132 | +--- |
| 133 | + |
| 134 | +### Document Template APIs |
| 135 | + |
| 136 | +| Operation | Method | Endpoint | |
| 137 | +| ------------------------------ | ------ | -------------------------------- | |
| 138 | +| Get All Document Templates | GET | `/api/templates` | |
| 139 | +| Get Specific Document Template | GET | `/api/templates/{template_name}` | |
| 140 | +| Create Template | POST | `/api/templates` | |
| 141 | +| Delete Template | DELETE | `/api/templates/{template_name}` | |
| 142 | +| Update Template | PUT | `/api/templates/{template_name}` | |
| 143 | + |
| 144 | +--- |
| 145 | + |
| 146 | +### Variable Registry APIs |
| 147 | + |
| 148 | +| Operation | Method | Endpoint | |
| 149 | +| ---------------------------- | ------ | --------------------------------------------- | |
| 150 | +| Create Variable Registry | POST | `/api/variable-registry` | |
| 151 | +| Get Variable Registry | GET | `/api/variable-registry/{variable_id}` | |
| 152 | +| Update Variable Registry | PUT | `/api/variable-registry/{variable_id}` | |
| 153 | +| Delete Variable Registry | DELETE | `/api/variable-registry/{variable_id}` | |
| 154 | +| Get All Variable Registry | GET | `/api/variable-registry` | |
| 155 | +| Get Variable Registry Values | GET | `/api/variable-registry/{variable_id}/values` | |
| 156 | + |
| 157 | +--- |
| 158 | + |
| 159 | +### Document Tracker APIs |
| 160 | + |
| 161 | +| Operation | Method | Endpoint | |
| 162 | +| ---------------------------- | ------ | --------------------------------------------- | |
| 163 | +| Get Overall Status | GET | `/api/tracker/status` | |
| 164 | +| Get Document Status By Party | GET | `/api/tracker/{document_id}/party/{party_id}` | |
| 165 | +| Resend E-Sign | POST | `/api/tracker/{document_id}/resend` | |
| 166 | +| Download Signed Document | GET | `/api/tracker/{document_id}/download` | |
| 167 | +| Download Certificate | GET | `/api/tracker/{document_id}/certificate` | |
| 168 | +| Log Action | POST | `/api/tracker/log` | |
| 169 | +| Send E-Sign | POST | `/api/tracker/send` | |
| 170 | +| Sign API | POST | `/api/tracker/sign` | |
| 171 | +| Tracking IDs API | GET | `/api/tracker/ids` | |
| 172 | + |
| 173 | +--- |
| 174 | + |
| 175 | +## HTTP Status Codes |
| 176 | + |
| 177 | +| Status Code | Description | |
| 178 | +| ---- | --------------------- | |
| 179 | +| <span style="color:green; font-weight:bold;">200</span> | OK | |
| 180 | +| <span style="color:green; font-weight:bold;">201</span> | Created | |
| 181 | +| <span style="color:green; font-weight:bold;">204</span> | No Content | |
| 182 | +| <span style="color:red; font-weight:bold;">400</span> | Bad Request | |
| 183 | +| <span style="color:red; font-weight:bold;">401</span> | Unauthorized | |
| 184 | +| <span style="color:red; font-weight:bold;">403</span> | Forbidden | |
| 185 | +| <span style="color:red; font-weight:bold;">404</span> | Not Found | |
| 186 | +| <span style="color:red; font-weight:bold;">500</span> | Internal Server Error | |
0 commit comments