Developers

(API under development, this document may change without notice)


This document is intended for web and mobile developers who want to include Reach REST API service within a webpage or mobile application. It provides an introduction to using the API and reference material on the available parameters.

The REST APIs provide programmatic access to read and write Reach data, like create new reports and more. We recommend that requests be made over HTTPS.

Headers

Applications must authenticate all requests with some headers, this allows us to prevent abusive behavior.

E-Reach-App (mandatory) defines the App's GUID.

E-Reach-Auth (optional) defines the User's access token, its use depends on the API.


GET lists/countries

This API returns the list of countries in response to an HTTP request.

Example request

GET /v1.0/lists/countries HTTP/1.1
Host: reachsosapis.azurewebsites.net
E-Reach-App: [APP_GUID]

Example response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[{"name":"Afghanistan","alpha3":"AFG","cnc":4},{"name":"Albania","alpha3":"ALB","cnc":8},{"name":"Algeria","alpha3":"DZA","cnc":12},{"name":"American Samoa","alpha3":"ASM","cnc":16},{"name":"Andorra","alpha3":"AND","cnc":20},{"name":"Angola","alpha3":"AGO","cnc":24},{"name":"Anguilla","alpha3":"AIA","cnc":660},{"name":"Antarctica","alpha3":"ATA","cnc":10},{"name":"Antigua and Barbuda","alpha3":"ATG","cnc":28},{"name":"Argentina","alpha3":"ARG","cnc":32},{"name":"Armenia","alpha3":"ARM","cnc":51},{"name":"Aruba","alpha3":"ABW","cnc":533},{"name":"Australia","alpha3":"AUS","cnc":36},{"name":"Austria","alpha3":"AUT","cnc":40},{"name":"Azerbaijan","alpha3":"AZE","cnc":31},{"name":"Bahamas","alpha3":"BHS","cnc":44},{"name":"Bahrain","alpha3":"BHR","cnc":48},{"name":"Bangladesh","alpha3":"BGD","cnc":50},{"name":"Barbados","alpha3":"BRB","cnc":52},{"name":"Belarus","alpha3":"BLR","cnc":112},{"name":"Belgium","alpha3":"BEL","cnc":56},{"name":"Belize","alpha3":"BLZ","cnc":84},{"name":"Benin","alpha3":"BEN","cnc":204},{"name":"Bermuda","alpha3":"BMU","cnc":60},{"name":"Bhutan","alpha3":"BTN","cnc":64},{"name":"Bolivia","alpha3":"BOL","cnc":68},{"name":"Bosnia and Herzegovina","alpha3":"BIH","cnc":70},{"name":"Botswana","alpha3":"BWA","cnc":72},{"name":"Brazil","alpha3":"BRA","cnc":76},{"name":"British Indian Ocean Territory","alpha3":"IOT","cnc":86},{"name":"Brunei Darussalam","alpha3":"BRN","cnc":96},{"name":"Bulgaria","alpha3":"BGR","cnc":100},{"name":"Burkina Faso","alpha3":"BFA","cnc":854},{"name":"Burundi","alpha3":"BDI","cnc":108},{"name":"Cambodia","alpha3":"KHM","cnc":116},{"name":"Cameroon","alpha3":"CMR","cnc":120},{"name":"Canada","alpha3":"CAN","cnc":124},{"name":"Cayman Islands","alpha3":"CYM","cnc":136},{"name":"Central African Republic","alpha3":"CAF","cnc":140},{"name":"Chad","alpha3":"TCD","cnc":148},{"name":"Chile","alpha3":"CHL","cnc":152},{"name":"China","alpha3":"CHN","cnc":156},{"name":"Christmas Island","alpha3":"CXR","cnc":162},{"name":"Cocos (Keeling) Islands","alpha3":"CCK","cnc":166},{"name":"Colombia","alpha3":"COL","cnc":170},{"name":"Comoros","alpha3":"COM","cnc":174},{"name":"Congo","alpha3":"COG","cnc":178},{"name":"Cook Islands","alpha3":"COK","cnc":184},{"name":"Costa Rica","alpha3":"CRI","cnc":188},{"name":"Croatia","alpha3":"HRV","cnc":191},{"name":"Cuba","alpha3":"CUB","cnc":192},{"name":"Curaçao","alpha3":"CUW","cnc":531},{"name":"Cyprus","alpha3":"CYP","cnc":196},{"name":"Czech Republic","alpha3":"CZE","cnc":203},{"name":"Democratic Republic of the Congo","alpha3":"COD","cnc":180},{"name":"Denmark","alpha3":"DNK","cnc":208},{"name":"Djibouti","alpha3":"DJI","cnc":262},{"name":"Dominica","alpha3":"DMA","cnc":212},{"name":"Dominican Republic","alpha3":"DOM","cnc":214},{"name":"East Timor","alpha3":"TLS","cnc":626},{"name":"Ecuador","alpha3":"ECU","cnc":218},{"name":"Egypt","alpha3":"EGY","cnc":818},{"name":"El Salvador","alpha3":"SLV","cnc":222},{"name":"Equatorial Guinea","alpha3":"GNQ","cnc":226},{"name":"Eritrea","alpha3":"ERI","cnc":232},{"name":"Estonia","alpha3":"EST","cnc":233},{"name":"Ethiopia","alpha3":"ETH","cnc":231},{"name":"Falkland Islands (Malvinas)","alpha3":"FLK","cnc":238},{"name":"Faroe Islands","alpha3":"FRO","cnc":234},{"name":"Fiji","alpha3":"FJI","cnc":242},{"name":"Finland","alpha3":"FIN","cnc":246},{"name":"France","alpha3":"FRA","cnc":250},{"name":"French Polynesia","alpha3":"PYF","cnc":258},{"name":"Gabon","alpha3":"GAB","cnc":266},{"name":"Gambia","alpha3":"GMB","cnc":270},{"name":"Georgia","alpha3":"GEO","cnc":268},{"name":"Germany","alpha3":"DEU","cnc":276},{"name":"Ghana","alpha3":"GHA","cnc":288},{"name":"Gibraltar","alpha3":"GIB","cnc":292},{"name":"Greece","alpha3":"GRC","cnc":300},{"name":"Greenland","alpha3":"GRL","cnc":304},{"name":"Grenada","alpha3":"GRD","cnc":308},{"name":"Guam","alpha3":"GUM","cnc":316},{"name":"Guatemala","alpha3":"GTM","cnc":320},{"name":"Guernsey","alpha3":"GGY","cnc":831},{"name":"Guinea","alpha3":"GIN","cnc":324},{"name":"Guinea-Bissau","alpha3":"GNB","cnc":624},{"name":"Guyana","alpha3":"GUY","cnc":328},{"name":"Haiti","alpha3":"HTI","cnc":332},{"name":"Honduras","alpha3":"HND","cnc":340},{"name":"Hong Kong","alpha3":"HKG","cnc":344},{"name":"Hungary","alpha3":"HUN","cnc":348},{"name":"Iceland","alpha3":"ISL","cnc":352},{"name":"India","alpha3":"IND","cnc":356},{"name":"Indonesia","alpha3":"IDN","cnc":360},{"name":"Iran","alpha3":"IRN","cnc":364},{"name":"Iraq","alpha3":"IRQ","cnc":368},{"name":"Ireland","alpha3":"IRL","cnc":372},{"name":"Isle of Man","alpha3":"IMN","cnc":833},{"name":"Israel","alpha3":"ISR","cnc":376},{"name":"Italy","alpha3":"ITA","cnc":380},{"name":"Jamaica","alpha3":"JAM","cnc":388},{"name":"Japan","alpha3":"JPN","cnc":392},{"name":"Jersey","alpha3":"JEY","cnc":832},{"name":"Jordan","alpha3":"JOR","cnc":400},{"name":"Kazakhstan","alpha3":"KAZ","cnc":398},{"name":"Kenya","alpha3":"KEN","cnc":404},{"name":"Kiribati","alpha3":"KIR","cnc":296},{"name":"Kuwait","alpha3":"KWT","cnc":414},{"name":"Kyrgyzstan","alpha3":"KGZ","cnc":417},{"name":"Laos","alpha3":"LAO","cnc":418},{"name":"Latvia","alpha3":"LVA","cnc":428},{"name":"Lebanon","alpha3":"LBN","cnc":422},{"name":"Lesotho","alpha3":"LSO","cnc":426},{"name":"Liberia","alpha3":"LBR","cnc":430},{"name":"Libya","alpha3":"LBY","cnc":434},{"name":"Liechtenstein","alpha3":"LIE","cnc":438},{"name":"Lithuania","alpha3":"LTU","cnc":440},{"name":"Luxembourg","alpha3":"LUX","cnc":442},{"name":"Macau","alpha3":"MAC","cnc":446},{"name":"Macedonia","alpha3":"MKD","cnc":807},{"name":"Madagascar","alpha3":"MDG","cnc":450},{"name":"Malawi","alpha3":"MWI","cnc":454},{"name":"Malaysia","alpha3":"MYS","cnc":458},{"name":"Maldives","alpha3":"MDV","cnc":462},{"name":"Mali","alpha3":"MLI","cnc":466},{"name":"Malta","alpha3":"MLT","cnc":470},{"name":"Marshall Islands","alpha3":"MHL","cnc":584},{"name":"Mauritania","alpha3":"MRT","cnc":478},{"name":"Mauritius","alpha3":"MUS","cnc":480},{"name":"Mayotte","alpha3":"MYT","cnc":175},{"name":"Mexico","alpha3":"MEX","cnc":484},{"name":"Micronesia","alpha3":"FSM","cnc":583},{"name":"Moldova","alpha3":"MDA","cnc":498},{"name":"Monaco","alpha3":"MCO","cnc":492},{"name":"Mongolia","alpha3":"MNG","cnc":496},{"name":"Montenegro","alpha3":"MNE","cnc":499},{"name":"Montserrat","alpha3":"MSR","cnc":500},{"name":"Morocco","alpha3":"MAR","cnc":504},{"name":"Mozambique","alpha3":"MOZ","cnc":508},{"name":"Myanmar","alpha3":"MMR","cnc":104},{"name":"Namibia","alpha3":"NAM","cnc":516},{"name":"Nauru","alpha3":"NRU","cnc":520},{"name":"Nepal","alpha3":"NPL","cnc":524},{"name":"Netherlands","alpha3":"NLD","cnc":528},{"name":"New Caledonia","alpha3":"NCL","cnc":540},{"name":"New Zealand","alpha3":"NZL","cnc":554},{"name":"Nicaragua","alpha3":"NIC","cnc":558},{"name":"Niger","alpha3":"NER","cnc":562},{"name":"Nigeria","alpha3":"NGA","cnc":566},{"name":"Niue","alpha3":"NIU","cnc":570},{"name":"North Korea","alpha3":"PRK","cnc":408},{"name":"Northern Mariana Islands","alpha3":"MNP","cnc":580},{"name":"Norway","alpha3":"NOR","cnc":578},{"name":"Oman","alpha3":"OMN","cnc":512},{"name":"Pakistan","alpha3":"PAK","cnc":586},{"name":"Palau","alpha3":"PLW","cnc":585},{"name":"Palestine","alpha3":"PSE","cnc":275},{"name":"Panama","alpha3":"PAN","cnc":591},{"name":"Papua New Guinea","alpha3":"PNG","cnc":598},{"name":"Paraguay","alpha3":"PRY","cnc":600},{"name":"Peru","alpha3":"PER","cnc":604},{"name":"Philippines","alpha3":"PHL","cnc":608},{"name":"Pitcairn","alpha3":"PCN","cnc":612},{"name":"Poland","alpha3":"POL","cnc":616},{"name":"Portugal","alpha3":"PRT","cnc":620},{"name":"Puerto Rico","alpha3":"PRI","cnc":630},{"name":"Qatar","alpha3":"QAT","cnc":634},{"name":"Reunion","alpha3":"REU","cnc":638},{"name":"Romania","alpha3":"ROU","cnc":642},{"name":"Russia","alpha3":"RUS","cnc":643},{"name":"Rwanda","alpha3":"RWA","cnc":646},{"name":"Saint Barthelemy","alpha3":"BLM","cnc":652},{"name":"Saint Helena","alpha3":"SHN","cnc":654},{"name":"Saint Kitts and Nevis","alpha3":"KNA","cnc":659},{"name":"Saint Lucia","alpha3":"LCA","cnc":662},{"name":"Saint Martin","alpha3":"MAF","cnc":663},{"name":"Saint Pierre and Miquelon","alpha3":"SPM","cnc":666},{"name":"Saint Vincent and the Grenadines","alpha3":"VCT","cnc":670},{"name":"Samoa","alpha3":"WSM","cnc":882},{"name":"San Marino","alpha3":"SMR","cnc":674},{"name":"Sao Tome and Principe","alpha3":"STP","cnc":678},{"name":"Saudi Arabia","alpha3":"SAU","cnc":682},{"name":"Senegal","alpha3":"SEN","cnc":686},{"name":"Serbia","alpha3":"SRB","cnc":688},{"name":"Seychelles","alpha3":"SYC","cnc":690},{"name":"Sierra Leone","alpha3":"SLE","cnc":694},{"name":"Singapore","alpha3":"SGP","cnc":702},{"name":"Sint Maarten","alpha3":"SXM","cnc":534},{"name":"Slovakia","alpha3":"SVK","cnc":703},{"name":"Slovenia","alpha3":"SVN","cnc":705},{"name":"Solomon Islands","alpha3":"SLB","cnc":90},{"name":"Somalia","alpha3":"SOM","cnc":706},{"name":"South Africa","alpha3":"ZAF","cnc":710},{"name":"South Korea","alpha3":"KOR","cnc":410},{"name":"South Sudan","alpha3":"SSD","cnc":728},{"name":"Spain","alpha3":"ESP","cnc":724},{"name":"Sri Lanka","alpha3":"LKA","cnc":144},{"name":"Sudan","alpha3":"SDN","cnc":729},{"name":"Suriname","alpha3":"SUR","cnc":740},{"name":"Svalbard and Jan Mayen","alpha3":"SJM","cnc":744},{"name":"Swaziland","alpha3":"SWZ","cnc":748},{"name":"Sweden","alpha3":"SWE","cnc":752},{"name":"Switzerland","alpha3":"CHE","cnc":756},{"name":"Syria","alpha3":"SYR","cnc":760},{"name":"Taiwan","alpha3":"TWN","cnc":158},{"name":"Tajikistan","alpha3":"TJK","cnc":762},{"name":"Tanzania","alpha3":"TZA","cnc":834},{"name":"Thailand","alpha3":"THA","cnc":764},{"name":"Togo","alpha3":"TGO","cnc":768},{"name":"Tokelau","alpha3":"TKL","cnc":772},{"name":"Tonga","alpha3":"TON","cnc":776},{"name":"Trinidad and Tobago","alpha3":"TTO","cnc":780},{"name":"Tunisia","alpha3":"TUN","cnc":788},{"name":"Turkey","alpha3":"TUR","cnc":792},{"name":"Turkmenistan","alpha3":"TKM","cnc":795},{"name":"Turks and Caicos Islands","alpha3":"TCA","cnc":796},{"name":"Tuvalu","alpha3":"TUV","cnc":798},{"name":"Uganda","alpha3":"UGA","cnc":800},{"name":"Ukraine","alpha3":"UKR","cnc":804},{"name":"United Arab Emirates","alpha3":"ARE","cnc":784},{"name":"United Kingdom","alpha3":"GBR","cnc":826},{"name":"United States","alpha3":"USA","cnc":840},{"name":"Uruguay","alpha3":"URY","cnc":858},{"name":"Uzbekistan","alpha3":"UZB","cnc":860},{"name":"Vanuatu","alpha3":"VUT","cnc":548},{"name":"Venezuela","alpha3":"VEN","cnc":862},{"name":"Vietnam","alpha3":"VNM","cnc":704},{"name":"Virgin Islands (British)","alpha3":"VGB","cnc":92},{"name":"Virgin Islands (U.S.)","alpha3":"VIR","cnc":850},{"name":"Wallis and Futuna","alpha3":"WLF","cnc":876},{"name":"Western Sahara","alpha3":"ESH","cnc":732},{"name":"Yemen","alpha3":"YEM","cnc":887},{"name":"Zambia","alpha3":"ZMB","cnc":894},{"name":"Zimbabwe","alpha3":"ZWE","cnc":716}]


GET lists/incidenttypes

This API returns the list of incident types in response to an HTTP request. For each request, you can optionally specify the language.

Parameters

lang (optional, default: "en" if the current client's culture is not supported) defines the ISO 639-1 two-letter code for the language. If the lang parameter value is not supported, no results will be returned.

Example request

GET /v1.0/lists/incidenttypes?lang=es HTTP/1.1
Host: reachsosapis.azurewebsites.net
E-Reach-App: [APP_GUID]

Example response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[{"code":118,"name":"Abuso de autoridad"},{"code":120,"name":"Accidente de personas"},{"code":110,"name":"Accidente de tránsito"},{"code":127,"name":"Acoso callejero"},{"code":121,"name":"Actos inmorales"},{"code":101,"name":"Animales perdidos"},{"code":119,"name":"Bullying"},{"code":122,"name":"Desechos"},{"code":109,"name":"Emergencia medica"},{"code":102,"name":"Homicidio"},{"code":111,"name":"Incendio"},{"code":116,"name":"Maltrato animal"},{"code":126,"name":"Manifestaciones"},{"code":113,"name":"Objeto sospechoso"},{"code":199,"name":"Otros"},{"code":115,"name":"Personas desaparecidas"},{"code":117,"name":"Prófugo"},{"code":104,"name":"Robo/Hurto"},{"code":125,"name":"Ruidos molestos"},{"code":103,"name":"Secuestro"},{"code":112,"name":"Sospechoso"},{"code":114,"name":"Tráfico de armas de fuego"},{"code":108,"name":"Tráfico de drogas"},{"code":128,"name":"Tráfico de personas"},{"code":105,"name":"Vandalismo/Delincuencia"},{"code":123,"name":"Vía pública"},{"code":124,"name":"Violencia"}]


GET lists/roadtypes

This API returns the list of road types in response to an HTTP request. For each request, you can optionally specify the language.

Parameters

lang (optional, default: "en" if the current client's culture is not supported) defines the ISO 639-1 two-letter code for the language. If the lang parameter value is not supported, no results will be returned.

Example request

GET /v1.0/lists/roadtypes?lang=es HTTP/1.1
Host: reachsosapis.azurewebsites.net
E-Reach-App: [APP_GUID]

Example response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[{"code":6,"name":"Condominio"},{"code":1,"name":"Domicilio"},{"code":2,"name":"Edificio"},{"code":5,"name":"Institución educativa"},{"code":7,"name":"Local comercial"},{"code":8,"name":"Otros"},{"code":4,"name":"Transporte público"},{"code":3,"name":"Vehículo"},{"code":0,"name":"Vía pública"}]


POST incidents

This API allows you to report incidents from your own application using a HTTP request. As response, you will receive the ID of the registered incident.

Parameters

incidentType (mandatory) defines the incident type code for the report.
description (mandatory) defines the description of the incident.
extCode (optional) defines the record ID of this incident if its already registered in another system.
privateNotes (optional) additional and private notes that you want to add to the record.
location_lat (mandatory) defines the geographical latitude of the incident.
location_lng (mandatory) defines the geographical longitude of the incident.
location_address (mandatory) defines the street address of the incident.
location_cnc (mandatory) defines the international code of the country.
location_dateTime (mandatory) defines the date and time of the incident, must be in "yyyyMMddHHmmss" format.
roadType (mandatory) defines the road type code of the incident.
state (mandatory) defines the incident's state. 1: Archived, 2: General, 3: Draft
anonymous (mandatory) defines if the incident must be published as anonymous.

Example request

POST /v1.0/incidents HTTP/1.1
Host: reachsosapis.azurewebsites.net
Content-Type: application/json; charset=utf-8
E-Reach-App: [APP_GUID]
E-Reach-Auth: [USER_TOKEN]

{"incidentType":109,"description":"Ocurrió un(a) EMERGENCIA MEDICA en UV. SANTA MARINA SUR BLOCK  16  DPTO  203 - CALLAO y se ha(n) asignado la(s) siguiente(s) máquina(s): AMB-1. [Nro. Parte: 2017-002062]","extCode":"2017-002062","privateNotes":"","location_lat":-12.051662933842,"location_lng":-77.1278165453089,"location_address":"UV. SANTA MARINA SUR BLOCK  16  DPTO  203 - CALLAO","location_cnc":604,"location_dateTime":"20170111053730","roadType":0,"state":2,"anonymous":false}

Example response

HTTP/1.1 201 CREATED
Content-Type: application/json; charset=utf-8

14756


PUT incidents

This API allows you to update incidents from your own application using a HTTP request.

Parameters

id (mandatory) defines the registration ID of this incident in Reach.
incidentType (mandatory) defines the incident type code for the report.
description (mandatory) defines the description of the incident.
extCode (optional) defines the record ID of this incident if its already registered in another system.
privateNotes (optional) additional and private notes that you want to add to the record.
location_lat (mandatory) defines the geographical latitude of the incident.
location_lng (mandatory) defines the geographical longitude of the incident.
location_address (mandatory) defines the street address of the incident.
location_cnc (mandatory) defines the international code of the country.
location_dateTime (mandatory) defines the date and time of the incident, must be in "yyyyMMddHHmmss" format.
roadType (mandatory) defines the road type code of the incident.
state (mandatory) defines the incident's state. 1: Archived, 2: General, 3: Draft
anonymous (mandatory) defines if the incident must be published as anonymous.

Example request

PUT /v1.0/incidents HTTP/1.1
Host: reachsosapis.azurewebsites.net
Content-Type: application/json; charset=utf-8
E-Reach-App: [APP_GUID]
E-Reach-Auth: [USER_TOKEN]

{"id":14756,"incidentType":109,"description":"Ocurrió un(a) EMERGENCIA MEDICA en UV. SANTA MARINA SUR BLOCK  16  DPTO  203 - CALLAO y se ha(n) asignado la(s) siguiente(s) máquina(s): AMB-1. [Nro. Parte: 2017-002062]","extCode":"2017-002062","privateNotes":"","location_lat":-12.051662933842,"location_lng":-77.1278165453089,"location_address":"UV. SANTA MARINA SUR BLOCK  16  DPTO  203 - CALLAO","location_cnc":604,"location_dateTime":"20170111053730","roadType":0,"state":2,"anonymous":false}

Example response

HTTP/1.1 200 OK


PUT incidents/actions

This API allows you to realize some actions with an incident record from your own application using a HTTP request.

Parameters

incidentActionType (mandatory) defines the type of action to realize. 1: Highlight, 2: Archive, 3: Report abuse, 4: Unarchive
incidentId (mandatory) defines the registration ID of this incident in Reach.
description (optional) defines the description of the abuse report for the incident.

Example request

PUT /v1.0/incidents/actions HTTP/1.1
Host: reachsosapis.azurewebsites.net
Content-Type: application/json; charset=utf-8
E-Reach-App: [APP_GUID]
E-Reach-Auth: [USER_TOKEN]

{"incidentActionType":2,"incidentId":14895}

Example response

HTTP/1.1 200 OK


GET incidents/latests

This API returns a list of incidents in response to an HTTP request via a URL. For each request, you can optionally specify a set of parameters. The returned list is sorted from newest to oldest.

Parameters

code (optional, default: 0) defines the code associated to an incident type.
size (optional, default: 27, max: 27) defines the number of incidents that you want to use as source.
take (optional, default: size parameter value if value not set) defines the desired number of random incidents within the expected total number of incidents. If you set a size of 27 and a take of 3, the result will be a list of 3 random elements within the total list of 27.
lang (optional, default: "en" if the current client's culture is not supported) defines the ISO 639-1 two-letter code for the language. If the lang parameter value is not supported, no incident type titles will be returned.

Example request

GET /v1.0/incidents/latests?take=1&lang=es HTTP/1.1
Host: reachsosapis.azurewebsites.net
E-Reach-App: [APP_GUID]
E-Reach-Auth: [USER_TOKEN]

Example response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[{"id":6502,"incidentType_Code":115,"incidentType_Name":"Personas desaparecidas","shareableText":"Si Ud. tiene conocimiento del paradero de alguna de estas personas desaparecidas, comunicar... - https://reachsos.com/incidents/details/6502","location_dateTime":"22/07/2016 14:00:00","url":"https://reachsos.com/incidents/details/6502"}]