Add New Contract
POST/api/contracts
Headers
| Field | Type | Description |
|---|---|---|
| authtoken | String | Authentication token, generated from admin area |
Parameters
| Field | Type | Description |
|---|---|---|
| title | string | Mandatory Contract title |
| client_id | number | Mandatory Client ID |
| project_id | number | Mandatory Project ID |
| contract_date | string | Mandatory Contract date (Y-m-d) |
| valid_until | string | Mandatory Valid until date (Y-m-d) |
| status | string | optional Optional Status (draft, sent, accepted, declined) |
| content | string | optional Optional Contract content |
curl -X POST "https://yoursite.com/api/contracts" \
-H "authtoken: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "title": "...", "client_id": "...", "project_id": "...", "contract_date": "...", "valid_until": "..." }' Success-Response:
HTTP/1.1 201 Created
{
"status": 200,
"messages": {"success": "Contract add success"},
"id": 1
}