POST http:///fleet.roadprotect.co.il/api/v1/contract/{contractId}/end-date
| Parameter name | Value | Description | Additional |
|---|---|---|---|
| contractId | number | Required |
The request body takes a complete UpdateContractEndDateDto resource, containing the following writable properties:
{
"endDate": "string",
"startDate": "string"
}
| Name | Type | Description | Additional |
|---|---|---|---|
| endDate | string |
The new contract end date |
Optional |
| startDate | string |
The new contract start date |
Optional |
To authenticate your client integration please put your token in the header of your requests with the key Authorization, it should look like this:
Authorization: Bearer YOUR_TOKEN_HERE
Please keep your token secured. If your token is compromised, we can issue a new token for you.
This request requires the use of one of following authorisation methods:
API key
.
The following HTTP status codes may be returned, optionally with a response resource.
| Status code | Description | Resource |
|---|---|---|
| 201 | Created | Contract |
| 400 | Bad Request E050: Contract with id contractId not found |
|
| 500 | Internal Server Error Failed to update contract, please contact support |
Replace REFERENCE with the desired reference.
var request = require('request');
var options = {
'method': 'POST',
'url': 'http://fleet.roadprotect.co.il/api/v1/contract/REFERENCE/end-date',
'headers': {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN_HERE'
},
body: JSON.stringify({"endDate":"2019-07-31T21:59:00.000Z","startDate":"2019-06-30T22:00:00.000Z"})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
};
Replace REFERENCE with the desired reference.
import requests
url = "http://fleet.roadprotect.co.il/api/v1/contract/REFERENCE/end-date"
payload="{\n\t \"endDate\": \"2019-07-31T21:59:00.000Z\",\n\t \"startDate\": \"2019-06-30T22:00:00.000Z\"\n}"
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN_HERE'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)