Epicalsoft.Reach.Api.Client.Net
1.3.22
dotnet add package Epicalsoft.Reach.Api.Client.Net --version 1.3.22
NuGet\Install-Package Epicalsoft.Reach.Api.Client.Net -Version 1.3.22
<PackageReference Include="Epicalsoft.Reach.Api.Client.Net" Version="1.3.22" />
paket add Epicalsoft.Reach.Api.Client.Net --version 1.3.22
#r "nuget: Epicalsoft.Reach.Api.Client.Net, 1.3.22"
// Install Epicalsoft.Reach.Api.Client.Net as a Cake Addin
#addin nuget:?package=Epicalsoft.Reach.Api.Client.Net&version=1.3.22
// Install Epicalsoft.Reach.Api.Client.Net as a Cake Tool
#tool nuget:?package=Epicalsoft.Reach.Api.Client.Net&version=1.3.22
Reach Api Client SDK for .NET Standard
The Reach Api Client SDK allows you to integrate Reach into your .NET Standard libraries.
Learn more about about the provided samples, documentation, integrating the SDK into your app, accessing source code.
Getting Started
- Contact hello@epicalsoft.com to create your Reach app.
- Receive your Client Id and Client Secret and store them in a safe place.
- Initialize the client using
ReachClient.Init("[clientId]", "[clientSecret]");
//or
ReachClient.Init("[userKey]");
//or
ReachClient.Init("[clientId]", "[clientSecret]", "[username]", "[password]");
Installation
Package Manager
PM > Install-Package Epicalsoft.Reach.Api.Client.Net -Version 1.3.21.58
.NET CLI
> dotnet add package Epicalsoft.Reach.Api.Client.Net --version 1.3.21.58
Usage
1. GlobalScopeManager.GetClassificationsAsync()
Invocation
var classifications = await GlobalScopeManager.Instance.GetClassificationsAsync();
Response example
[
{
"Code": "300301",
"Title": "Theft",
"Lang": "en"
},
{
"Code": "30030101",
"Title": "Robbery to people",
"Lang": "en"
},
{
"Code": "30030102",
"Title": "Theft of vehicles or auto parts",
"Lang": "en"
}
]
2. GlobalScopeManager.GetRoadTypesAsync()
Invocation
var roadTypes = await GlobalScopeManager.Instance.GetRoadTypesAsync();
Response example
[
{
"Code": 11,
"Name": "Bridge"
},
{
"Code": 7,
"Name": "Commercial place"
},
...
]
3. GlobalScopeManager.GetCountriesAsync()
Invocation
var countries = await GlobalScopeManager.Instance.GetCountriesAsync();
Response example
[
{
"Name": "Perú",
"Alpha2Code": "PE",
"Alpha3Code": "PER",
"NumericCode": 604,
"CallingCode": 51,
"Culture": "es-PE"
},
{
"Name": "México",
"Alpha2Code": "MX",
"Alpha3Code": "MEX",
"NumericCode": 484,
"CallingCode": 52,
"Culture": "es-MX"
}
]
4. GlobalScopeManager.GetNearbyIncidentsAsync(double, double, ClassificationGroup)
Invocation
- ClassificationGroup Medical Incidents, Public Protection, Human Security, Public Administration
var nearbyIncidents = await GlobalScopeManager.Instance.GetNearbyIncidentsAsync(-12.051299, -77.064956, ClassificationGroup.HumanSecurity);
Response example
[
{
"Id": 18052014,
"Kind": "30030101",
"Lat": -12.0697313823956,
"Lng": -77.053617797792,
"UTC": "2017-10-26T23:36:29.753"
}
]
5. GlobalScopeManager.GetIncidentDetailAsync(int)
Invocation
var incident = await GlobalScopeManager.Instance.GetIncidentDetailAsync(18052014);
Response example
{
"Id": 18052014,
"UserId": 1630,
"Description": "Something is happening! Winter is coming!",
"Thumbnail": null,
"Abstract": "Something is happening! Winter is... - https://reachsos.com/incidents/details/18052014",
"Latitude": -12.0697313823956,
"Longitude": -77.053617797792,
"UTC": "2018-08-17T23:36:29.753",
"HasEvidence": false,
"HighlightsCount": 11,
"CommentsCount": 7,
"AlertedCount": 13,
"RoadType": {
"Code": 0,
"Name": "Public road"
},
"Classification": {
"Code": "30030101",
"Name": "Robbery to people",
"Lang": "en"
},
"Nickname": "Atreyu",
"FCP": 2,
"Evidences": []
}
6. GlobalScopeManager.VerifyFacesAsync(VerifyFacesRequest)
Invocation
var verifyFacesRequest = new VerifyFacesRequest {
Data = "/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsL..."
};
var facesVerificationResult = await GlobalScopeManager.Instance.VerifyFacesAsync(verifyFacesRequest);
- Data must contain the byte array of an image (preferably .jpg up to 4096x4096) in Base64String.
Response example
{
"Status": 1,
"Matches": [
{
"Confidence": 0.6149,
"IncidentId": 122018
},
{
"Confidence": 0.5827,
"IncidentId": 93710
}
],
"FacesCount": 3
}
- Status may contain the following values:
- Ok (1) indicates that no errors occurred and at least one result was returned.
- ZeroResults (2) indicates that the search was successful but returned no results.
- OverQueryLimit (3) indicates that you are over your quota.
- InvalidRequest (4) indicates that the data value is wrong or missing.
- UnknownError (5) a server-side error.
- FacesCount refers to the number of detected faces in the image
7. GlobalScopeManager.SendSOSAlertAsync(SOSAlert)
Invocation
var sosAlert = new SOSAlert
{
Sender = new User {
Trusted = true,
FullName = "Reach",
Nickname = "Citizen Security Social Network",
CountryCode = "51",
PhoneNumber = "999999999",
IDN = "11111111"
},
CNC = 604,
Location = new GPSLocation {
Lat = -12.115032,
Lng = -77.046044,
UTC = DateTime.UtcNow
}
};
await GlobalScopeManager.Instance.SendSOSAlertAsync(sosAlert);
- Trusted refers if the person is trusted.
- IDN refers to the Identity Document Number of the person.
- CNC refers to the Country Number Code, check
GlobalScopeManager.GetCountriesAsync()
8. UserScopeManager.UploadMediaFileAsync(MediaFileData)
Invocation
var mediaFileData = new MediaFileData
{
Code = new Guid("3F2504E0-4F89-11D3-9A0C-0305E82C3301"),
Target = MediaFileTarget.Evidences,
Kind = MediaFileKind.Image,
Data = Convert.ToBase64String(byteArray),
Filename = "incident_evidence_001.jpg"
};
var result = await UserScopeManager.Instance.UploadMediaFileAsync(mediaFileData);
- Target may contain the following values:
- Evidences (1) indicates that operation corresponds to an incident's evidence upload.
- Kind may contain the following values:
- Image (1) indicates that media file data corresponds to an image.
Response example
{
"MediaFileId": 1,
"DataCode": "3F2504E0-4F89-11D3-9A0C-0305E82C3301"
}
9. GlobalScopeManager.GetReverseGeocode(double, double)
Invocation
var address = await GlobalScopeManager.Instance.GetReverseGeocode(lat, lng);
Prerequisites
- NETStandard.Library (>= 2.0.3)
- akavache (>= 6.4.1)
- Newtonsoft.Json (>= 12.0.2)
Contact
If you need help installing or using the library, please contact Reach Support at hello@epicalsoft.com Reach's Support staff are well-versed in all of the Reach Libraries, and usually reply within 24 hours.
Please report any bugs as issues. Follow @reachsos on Twitter and /reachsos on Facebook for updates.
License
Copyright 2019 Epicalsoft Corporation.
Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Newtonsoft.Json (>= 12.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.