Get started
API Endpoint
https://api.cms-malaysia.com/web/api/
The valuationXchange API allows access to generate flood mapping reports.
Please contact us at support@valuationxchange.com to obtain an API key.
Create Report
# Here is a curl example
curl -X POST -H "Content-Type: application/json" -d "{ \"secret_key\": \"SECRET_KEY\", \"action\":\"create\", \"address_formatted\":\"3934, Jalan Sungai Serdang, Kampung Sungai Serdang, 42200 Kapar, Selangor, Malaysia\", \"address_lat\":3.14892254191888, \"address_lng\":101.33077623421, \"radius\":80 }" https://api.cms-malaysia.com/web/api/
This operation will require available API credits in your account or a post-paid option
To generate a report you need to make a POST request in JSON format to the following url :
https://api.cms-malaysia.com/web/api/
Result example :
{
status: "ok",
prepaid_remaining: 36,
postpaid_used: 0,
reference: "XXXXXX",
report_status: 0
}
QUERY PARAMETERS
| Field | Type | Description |
|---|---|---|
| secret_key | String | Your API key. |
| action | String | create |
| address_formatted | String | Full street address (ie. 3934, Jalan Sungai Serdang, Kampung Sungai Serdang, 42200 Kapar, Selangor, Malaysia) |
| address_lat | String | Latitude (ie. -33.86779) |
| address_lng | String | Longitude (ie.151.20775) |
| radius (optional) | Integer | (5 to 80) Defaults to 80 (metres) |
Fetch Report
# Here is a curl example
curl -X POST -H "Content-Type: application/json" -d "{ \"secret_key\": \"SECRET_KEY\", \"action\":\"fetch\",\"reference\":\"XXXXXX\" }" https://api.cms-malaysia.com/web/api/
This operation does not require API credits to perform
Reports may take up to 60 seconds or more to process. You may poll our API every 3 seconds to obtain the latest status of the report.
External webhooks may also be available upon request.
To fetch a report you need to make a POST request in JSON format to the following url to obtain the status:
https://api.cms-malaysia.com/web/api/
Result example [New] :
{
status: "ok",
reference: "XXXXXX",
report_status: 0
}
Result example [In Progress] :
{
status: "ok",
reference: "XXXXXX",
report_status: 1
}
Result example [Completed] :
{
status: "ok",
reference: "XXXXXX",
report_status: 5,
data:<raw JSON data>
}
QUERY PARAMETERS
| Field | Type | Description |
|---|---|---|
| secret_key | String | Your API key. |
| action | String | fetch |
| reference | String | This is the reference number returned when the report was created |
REPORT STATUS CODES
| Value | Meaning | Description |
|---|---|---|
| 0 | New | Report has been created and is waiting to process |
| 1 | In Progress | Report is being generated |
| 4 | Fail | A failure occurred - please contact us |
| 5 | Success | Report has been generated. The report data will also be included in the response to your fetch request |
Error Handling
The valuationXchange API uses the following error codes:
| Error Code | Meaning |
|---|---|
| TBA | To be announced. |