Skip to main content
Skip table of contents

mDOS endpoint description

For automation and scripting purposes there is a possibility to interact with the detector by using endpoints. The user available endpoints are documented below.



Get all projects
Endpoint
CODE
http://192.168.2.150:3333/project
DescriptionGets a json that includes all the project information present on the device
MethodGET
Response
CODE
{[<ARRAY OF PROJECTS>]}
Example response
CODE
[
  {
    "id": 1,
    "project_name": "test",
    "description": "123",
    "config": null,
    "createdAt": 1602581500510,
    "size": 10000
  },
  {
    "id": 2,
    "project_name": "UDPtest",
    "description": "testproject for udp import.",
    "config": null,
    "createdAt": 1602599282262,
    "size": 5044
  },
  {
    "id": 3,
    "project_name": "test_1602755852553",
    "description": "a first test",
    "config": null,
    "createdAt": 1602755852574,
    "size": 567
  }
]

Get specific project
Endpoint
CODE
http://192.168.2.150:3333/project/:id
DescriptionGet the project info from a specific project based on the ID (number)
MethodGET
Response
CODE
{<PROJECT JSON>}
Example response
CODE
  {
    "id": 1,
    "project_name": "test",
    "description": "This is a test project",
    "createdAt": 1602581500510,
    "size": 10000
  }

Create a project
Endpoint
CODE
http://192.168.2.150:3333/project/
DescriptionCreate a new project and sets it as the project that it is currently logging to
Parameters
CODE
{
"project_name": "test_1234",
"description": "project description"
}
MethodPOST
Response
CODE
{project_ID}
Example response
CODE
{
    "project_id": 4
}

Delete a project
Endpoint
CODE
http://192.168.2.150:3333/project/:id
DescriptionDelete a project based on the project ID
MethodDELETE
Response
CODE
{
    "status": "success"
}

Request a project download
Endpoint
CODE
http://192.168.2.150:3333/project/:projectName/requestDownload
Description

Request a project download, this will start a process on the detector side that will collect all project information and merges this into a single zip file This zip file will contain the project data, the monster locations (if present) and the sample locations (if present).


This function reponds with the zip progress and should periodically be called to get the zipping status.


The endpoint will respond with an error if there already is a project zipping in progress.

MethodGET
Response

During zipping:

CODE
{
  "status": "zipping", 
  "progress": <Progress>,
  "project": <Project name>
}

When done:

CODE
{
  "status": "zipDone", 
  "progress": 100
}




Download a zipped project
Endpoint
CODE
http://192.168.2.150:3333/project/:projectName/download
DescriptionDownload a zipped project A prerequisite is that the project has been zipped by the above endpoint
MethodGET
Response

Use the following response type

CODE
            {
                responseType: "arraybuffer",
                headers: {
                    Accept: "application/zip",
                },
            }




Request a the samples and monsters in a project (markers)
Endpoint
CODE
http://192.168.2.150:3333/project/:projectID/marker
Description

Request a all the markers present in a project. These include monster locations (places where samples should be taken), sample locations (places where a sample has been recorded) and geolocation markers (boundaries of downloaded backgrounds)

MethodGET
Response
CODE
[ARRAY OF MARKERS]
Example
CODE
[
    {
        "id": 207,
        "timestamp": 1613124030041,
        "project_id": 22,
        "type": "monster",
        "value": "{\"utmX\":496450,\"utmY\":3156330,\"pointCount\":74,\"countRate\":null,\"weight\":1,\"distanceFromEdge\":1600,\"UTMZone\":39,\"UTMLetter\":\"E\",\"gridX\":1,\"gridY\":3,\"lat\":-61.72610126021216,\"lon\":50.9328247948386}"
    },
    {
        "id": 213,
        "timestamp": 1613124039952,
        "project_id": 22,
        "type": "sample",
        "value": "[{\"eID\":\"STABSPECTRO_stabspec\",\"vT\":1613124038181,\"v\":{\"Total\":371,\"Realtime\":2.0151030195537607,\"Livetime\":2.011907223655104,\"K40\":31.169579803357237,\"sK40\":11.873863335365545,\"U238\":51.798147951448385,\"sU238\":17.91812168244284,\"Th232\":45.37413276423078,\"sTh232\":12.78414782475714,\"A1\":0.7248128971841528,\"StabSpectrum\":[100,261,196,182,229,127,343,149,282,292,156,56,51,123,33,132,117,260,204,222,139,283,185,106,159,205,83,189,252,108,44,140,176,118,333,205,190,232,233,229,26,258,228,82,216,62,248,70,232,287,245,251,195,183,185,283,38,202,231,298,339,150,333,171,293,96,237,336,255,201,348,190,181,185,261,100,212,312,146,219,221,184,131,141,200,323,92,31,211,166,176,250,250,171,214,96,32,244,205,251,282,182,329,211,239,62,255,202,197,196,187,84,148,344,229,153,307,231,127,266,105,187,186,248,186,165,204,97,140,176,300,117,186,198,235,244,281,239,206,226,136,91,100,27,120,241,116,168,254,134,121,173,91,101,269,141,170,129,160,184,49,163,58,98,191,252,165,164,133,75,265,212,144,55,147,291,338,112,232,130,226,237,128,173,154,177,110,225,213,302,204,189,69,125,28,86,190,259,178,136,43,4,123,45,186,191,359,112,158,87,260,176,159,108,235,289,92,178,183,240,86,167,190,231,161,234,154,115,171,301,190,145,266,239,195,119,198,168,185,267,233,218,207,260,208,183,355,215,330,232,302,304,157,48,147,206,142,160,89,145,284,231,244,203,130,195,267,118,97,174,160,102,283,206,54,146,275,224,346,174,272,336,145,241,314,192,152,180,300,185,277,249,220,195,99,182,172,179,225,305],\"Cosmics\":null,\"Comment\":\"\",\"Lat\":-34.7584278552592,\"Lon\":-47.66914681266235,\"Date\":1613124039182}}]"
    }
]


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.