Reports.ashx Endpoint
Overview
The FaultLogging.aspx code assumes that certain nodes are present in the Map Source referenced in a request to create a report, specifically: /MapSource/LogFaultOptions/ErrorPage
; /MapSource/LogFaultOptions/XSLs/Create
; /MapSource/LogFaultOptions/XSLs/Form
Similar paths are expected when performing other actions. Because these fields are not actually required when FaultLogging.aspx is used outside of the original workflow, they are not fundamental to successfully acting on a report.
To overcome this we have created a new new reports.ashx endpoint to proxy requests to the Fault Reporting methods in Locate.asmx. This allows iShare Logger (using ol-ishare) to submit reports to at_incidents
without the need for the faultreporting.aspx.
Description
This endpoint currently allows for the adding and archiving of Reports.
http://custom.astun.local/mycouncil/web/reports.ashx
All Requests
Required HTTP request method: POST
Required HTTP request content-type: application/x-www-form-urlencoded
Add Report Request
This creates an entry in iShare’s internal report table.
Form Parameters
Name | Required | Value | Description |
---|---|---|---|
| Yes |
| Tells the service that this is a request to add a new report |
| Yes, or | Text | Name of iShare MapSource to log report against, e.g. |
| Yes, or | See | See |
| Yes | Number | X coordinate, normally easting |
| Yes | Number | Y coordinate, normally northing |
| Yes | Text | Name of layer in specified profile/MapSource to log report against, e.g. |
| Yes, or | Text | Description of report, required when no feature selection is made |
| Yes, or | Text | Identifier for a feature that has been selected for a fault report |
| Yes, if | Text | The name of the field in which the |
Response
Returns a JSON document containing the identifier for the newly created Report.
{"reportid": NEW_REPORT_ID}
Archive Report Request
This marks a report with the specified identifier as archived, so it can be excluded from Layer requests if necessary.
Form Parameters
Name | Required | Value | Description |
---|---|---|---|
| Yes |
| Tells the service that this is a request to add a new report |
| Yes | Text |
|
Response
Returns a JSON document containing the identifier for the report and its new status
{"reportid": REPORT_ID, "active": false}