curl -X POST "https://yoursite.com/api/contracts" \
-H "authtoken: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "subject": "...", "datestart": "...", "client": "...", "dateend": "...", "contract_type": "...", "contract_value": "...", "description": "...", "content": "..." }'
Success-Response:
HTTP/1.1 200 OK
{
"status": true,
"message": "Contract Added Successfully"
}
Error-Response:
HTTP/1.1 404 Not Found
{
"status": false,
"message": "Contract ID Exists"
}
Error-Response:
HTTP/1.1 404 Not Found
{
"status": false,
"error": {
"newitems[]": "The Start date field is required"
},
"message": "<p>The Start date field is required</p>\n"
}
Error-Response:
HTTP/1.1 404 Not Found
{
"status": false,
"error": {
"subtotal": "The Subject field is required"
},
"message": "<p>The Subject field is required</p>\n"
}
Error-Response:
HTTP/1.1 404 Not Found
{
"status": false,
"error": {
"total": "The Customer ID is required"
},
"message": "<p>The Customer ID is required</p>\n"
}