authentic.network API documentation v2.4.0
Documentation for the REST api access of authentic.api
Scans
Add Scan
This endpoints adds scan. The result is localized. For more information, please read the localization section. Note: for a valid scan only the identifier is needed. If not copyclassification set, fake is set by default. The remaining parameters are not required.
POST /api/v2/scans
Headers - Header
Name | Type | Description |
---|---|---|
an-api-client-locale | String |
Client locale. It isn't set, default is 'en' |
Parameters examples
json
- Request-Example:
{
"identifier": "0001",
"copyclassification": "original",
"location": {
"latitude": 51.123,
"longitude": 13.123
},
"data": {
"key": "value"
},
"softwareInfo": {
"app": "ScanApp",
"versionApp": "1.2.4",
"versionAnsfp": "0.15.2",
"versionScanNative": "0.14.0",
"versionScanPipline": "0.11.0",
"os": "ios",
"osVersion": "14.0.1",
"osDartVersion": "2.10.3 (stable) (Tue Oct 27 14:44:30 2020 +0100) on \"ios_arm64\"",
"osEnv": {}
},
"deviceInfo": {
"os": "ios",
"environment": {
"identifierForVendor": "8B05D6D2-C565-4886-A401-xxxxxxxx",
}
}
}
Success response example
Success response example - Success-Response:
{
"identifier": {
"id": "0001",
"data": {
"_fakes": 1471,
"_producer": "authentic-test",
"image": "/images/identifiers/0001/drug.png",
"_scans": 1978,
"title": "Paracetamol 600mg",
"_created": 1586439433831,
"verificationinfos": [
{
"value": "HelpPharma",
"visibility": "verified",
"label": "Manufactor"
}
],
"_updated": 1592942578567,
"imageUrl": "https://firebasestorage.googleapis.com/v0/b/an-scan-int.appspot.com/o/images%2Fidentifiers%2F0001%2Fdrug.png?alt=media&token=d79d0dac-c808-44f5-abde-d97224c332c9"
}
},
"scan": {
"id": "UVeOhdKBSpDPNJbMQbHi",
"data": {
"identifier": "0001",
"creator": "unknown",
"timestamp": 1592942631327,
"copyclassification": "original",
"location": {
"_lat": 51.123,
"_long": 13.123
},
"data": {
"key": "value"
},
"os": "ios",
"_owner": "authentic-test",
"device": "pn-message-token",
"softwareversion": "sa-1.0.10",
"country": "DE",
"continent": "Europe"
}
}
}
Error response
Error response - Errors
Name | Type | Description |
---|---|---|
400 | Bad Request - The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, size too large, invalid request message framing, or deceptive request routing). |
|
404 | NotFound - The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible. |
|
500 | Internal server error - A generic error message, given when an unexpected condition was encountered and no more specific message is suitable. |
Append Image to Scan
This endpoint adds an image to a scan.
POST /api/v2/scans/:id/image
Parameters - Parameter
Name | Type | Description |
---|---|---|
id | String |
The scan id |
Error response
Error response - Errors
Name | Type | Description |
---|---|---|
404 | NotFound - The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible. |
|
500 | Internal server error - A generic error message, given when an unexpected condition was encountered and no more specific message is suitable. |
Get Scan
This endpoints returns data about a single scan. Method is only accessable for producer.
GET /api/v2/scans/:id
Headers - Header
Name | Type | Description |
---|---|---|
content-type | String |
Request content type, musst set to application/json |
an-api-token | String |
API token |
Parameters - Parameter
Name | Type | Description |
---|---|---|
id | String |
The scan id |
Success response example
Success response example - Success-Response:
{
"id": "04AZgRe2Aa4l1CyzMQRV",
"data": {
"continent": "Africa",
"device": "sfdsfds32234546",
"country": "ML",
"copyclassification": "fake",
"creator": "authentic-test",
"location": {
"_lat": 13.824189588628363,
"_long": -6.126282811945415
},
"identifier": "0001",
"timestamp": 1592219302389,
"os": "ios"
}
}
Error response
Error response - Errors
Name | Type | Description |
---|---|---|
403 | Forbidden - The request contained valid data and was understood by the server, but the server is refusing action. This may be due to the user not having the necessary permissions for a resource or needing an account of some sort, or attempting a prohibited action (e.g. creating a duplicate record where only one is allowed). This code is also typically used if the request provided authentication via the an-api-token header field, but the server did not accept that authentication. The request should not be repeated. |
|
404 | NotFound - The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible. |
|
500 | Internal server error - A generic error message, given when an unexpected condition was encountered and no more specific message is suitable. |
Get ScanMap
Get a map of a scan. It's only possible when geo loaction datas of scan known.
GET /api/v2/scans/:id/map
Headers - Header
Name | Type | Description |
---|---|---|
content-type | String |
Request content type, musst set to application/json |
an-api-token | String |
API token |
Parameters - Parameter
Name | Type | Description |
---|---|---|
id | String |
The scan id |
Success response example
Success response example - Success-Response:
HTTP/2 200
content-type: image/png
content-length: 202433
Error response
Error response - Errors
Name | Type | Description |
---|---|---|
404 | NotFound - The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible. |
|
500 | Internal server error - A generic error message, given when an unexpected condition was encountered and no more specific message is suitable. |
Last Scans
This endpoints returns a list of last scans of all producers items in descand order
GET /api/v2/scans
Headers - Header
Name | Type | Description |
---|---|---|
content-type | String |
Request content type, musst set to application/json |
an-api-token | String |
API token |
Parameters - Parameter
Name | Type | Description |
---|---|---|
timestamp | Number |
Only scans that are older than the specified time stamp. If not set, the result starts with the most recent. |
limit | Number |
Number of expected entries |
Success response example
Success response example - Success-Response:
{
"identifier": {
"id": "0001",
"data": {
"image": "/images/identifiers/0001/drug.png",
"verificationinfos": [
{
"value": "HelpPharma",
"label": "Manufactor",
"visibility": "verified"
}
],
"_updated": 1592984408496,
"title": "Paracetamol 600mg",
"_scans": 2002,
"_created": 1586439433831,
"_fakes": 1489,
"_producer": "authentic-test"
}
},
"scans": [
{
"id": "ogBfC0k5L0hg3i4l8ALp",
"data": {
"os": "ios",
"timestamp": 1592984407973,
"identifier": "0001",
"creator": "unknown",
"country": "DZ",
"device": "sfdsfds32234546",
"copyclassification": "fake",
"continent": "Africa",
"_owner": "authentic-test",
"location": {
"_lat": 22.09950300601563,
"_long": 6.131402504441745
}
}
}
]
}