Developer Api

List Devices

Read all availible devices z-protect can start a scan request for.
Name Value Type Description
Content-Type application/json String Mime-Type for JSON Data (Example: application/json)
Z-Auth Example: 59a45e3c Int You can find your Z-Auth Key in your Account Settings (Example: 59a45e3c)
Z-Token c5c9baa090b417cd0ab6ba8870b6aa501dd68af0 (sha1) String You can find your Z-Token Key in your Account Settings (Example: c5c9baa090b417cd0ab6ba8870b6aa501dd68af0)

(Example Request)

curl -X POST "https://api.z-protect.com/v1/list/devices" \
-H "Content-Type: application/json" \
-H "Z-Auth: $apikey" \
-H "Z-Token: $apiToken"

(Example Response)

{
  "protocol_id": 1,
  "server_id": "z1",
  "timestamp": 1499418847,
  "state": {
    "type": "Valid",
    "message": ""
  },
  "return": [
    {
      "hash": "d41d8cd98f00b204e9800998ecf8427e",
      "device": "Mobile",
      "name": "[Safari] Google Nexus One",
      "screen_x": 1366,
      "screen_y": 768,
      "vendor": "Google Inc.",
      "platform": "Armx86"
    },
    {
      "hash": "7770d5cca4d56b63486ff8efe2412488",
      "device": "Mobile",
      "name": "[Safari] iPhoneSE 7.0",
      "screen_x": 640,
      "screen_y": 1136,
      "vendor": "Apple",
      "platform": "Armx86"
    }
  ]
}
							

Get Random Device

Read a random device specified by Device-Type and Device-Operation-System.
Name Value Type Description
Content-Type application/json String Mime-Type for JSON Data (Example: application/json)
Z-Auth Example: 59a45e3c Int You can find your Z-Auth Key in your Account Settings (Example: 59a45e3c)
Z-Token c5c9baa090b417cd0ab6ba8870b6aa501dd68af0 (sha1) String You can find your Z-Token Key in your Account Settings (Example: c5c9baa090b417cd0ab6ba8870b6aa501dd68af0)

Json-Node Type Json Value
device_type Enum Possible Values: mobile, tablet, desktop
device_os Enum Possible Values: android, ios
limit (Optional) Int Possible Values: min.1 - max.20 - Default: 1

(Example)

curl -X POST "https://api.z-protect.com/v1/list/random" \
-d "{\"device_type\": \"mobile", \"device_os\": \"android\"}" \
-H "Content-Type: application/json" \
-H "Z-Auth: $apikey" \
-H "Z-Token: $apiToken"

(Example Response)

{
  "protocol_id": 1,
  "server_id": "z1",
  "timestamp": 1499417818,
  "state": {
    "type": "Valid",
    "message": ""
  },
  "return": [
    {
      "hash": "d41d8cd98f00b204e9800998ecf8427e",
      "device": "Mobile",
      "name": "[Safari] Google Nexus One",
      "screen_x": 1366,
      "screen_y": 768,
      "vendor": "Google Inc.",
      "platform": "Armx86"
    }
  ]
}
							

List Geos

Read all availible GEO's z-protect can start a scan request for. The possible parameters are passed throught the 'type' key (currently only ethernet).
Name Value Type Description
Content-Type application/json String Mime-Type for JSON Data (Example: application/json)
Z-Auth Example: 59a45e3c Int You can find your Z-Auth Key in your Account Settings (Example: 59a45e3c)
Z-Token c5c9baa090b417cd0ab6ba8870b6aa501dd68af0 (sha1) String You can find your Z-Token Key in your Account Settings (Example: c5c9baa090b417cd0ab6ba8870b6aa501dd68af0)

(Example)

curl -X POST "https://api.z-protect.com/v1/list/geos" \
-H "Content-Type: application/json" \
-H "Z-Auth: $apikey" \
-H "Z-Token: $apiToken"

(Example Response)

{
  "protocol_id": 1,
  "server_id": "z1",
  "timestamp": 1499417818,
  "state": {
    "type": "Valid",
    "message": ""
  },
  "return": [
    {
      "hash": "c4cccd10d3e12243bed826d8413076ed",
      "state": "Active",
      "localization": "DE"
    },
    {
      "hash": "30009c044ff0d9e140043f2ab104c534",
      "state": "Active",
      "localization": "TR"
    },
    {
      "hash": "4d75009f52338d721c25230467ece3ab",
      "state": "Active",
      "localization": "US"
    },
    {
      "hash": "e1c185b8f1a213ea076d7bea023043f0",
      "state": "Active",
      "localization": "ZA"
    },
    {
      "hash": "85a02a740ed2969ab86a061527a5351c",
      "state": "Active",
      "localization": "SG"
    }
  ]
}
							

List Languages

Read all availible languages z-protect can start a scan request for.
Name Value Type Description
Content-Type application/json String Mime-Type for JSON Data (Example: application/json)
Z-Auth Example: 59a45e3c Int You can find your Z-Auth Key in your Account Settings (Example: 59a45e3c)
Z-Token c5c9baa090b417cd0ab6ba8870b6aa501dd68af0 (sha1) String You can find your Z-Token Key in your Account Settings (Example: c5c9baa090b417cd0ab6ba8870b6aa501dd68af0)

(Example)

curl -X POST "https://api.z-protect.com/v1/list/languages" \
-H "Content-Type: application/json" \
-H "Z-Auth: $apikey" \
-H "Z-Token: $apiToken"

(Example Response)

{
  "protocol_id": 1,
  "server_id": "z1",
  "timestamp": 1499868826,
  "state": {
    "type": "Valid",
    "message": ""
  },
  "return": [
    {
      "hash": "8f70e55d6af26d6a26ad8351b722dce4",
      "code": "en",
      "name": "English"
    },
    {
      "hash": "f4ea64d4ce4e2e50f8e7a593f8325744",
      "code": "aa",
      "name": "Afar"
    },
    {
      "hash": "d6961f2c7bdb4f4c3e7c038242546f4d",
      "code": "ab",
      "name": "Abkhazian"
    }
  ]
}
							

List Alerts

Read all availible alerts types.
Name Value Type Description
Content-Type application/json String Mime-Type for JSON Data (Example: application/json)
Z-Auth Example: 59a45e3c Int You can find your Z-Auth Key in your Account Settings (Example: 59a45e3c)
Z-Token c5c9baa090b417cd0ab6ba8870b6aa501dd68af0 (sha1) String You can find your Z-Token Key in your Account Settings (Example: c5c9baa090b417cd0ab6ba8870b6aa501dd68af0)

(Example Request)

curl -X POST "https://api.z-protect.com/v1/list/alerts" \
-H "Content-Type: application/json" \
-H "Z-Auth: $apikey" \
-H "Z-Token: $apiToken"

(Example Response)

{
  "protocol_id": 1,
  "server_id": "z1",
  "timestamp": 1499418847,
  "state": {
    "type": "Valid",
    "message": ""
  },
  "return": [
    {
         "hash":"c266ba7aab05851542b84fc1841ccd8f",
         "state":"Active",
         "classification":"Z\/Javascript.Alert"
    },
      {
         "hash":"dccd01308a2a07fef7791f7c2405ebb9",
         "state":"Active",
         "classification":"Z\/Javascript.Window-Close"
      },
  ]
}
							

Start scan process

Start a scanning process. Use 'entry' as Entry point which needs to be a valid Uri. Device and Geo-Hashes can be read out from 'List Devices' & 'List Geos'.
Name Value Type Description
Content-Type application/json String Mime-Type for JSON Data (Example: application/json)
Z-Auth Example: 59a45e3c Int You can find your Z-Auth Key in your Account Settings (Example: 59a45e3c)
Z-Token c5c9baa090b417cd0ab6ba8870b6aa501dd68af0 (sha1) String You can find your Z-Token Key in your Account Settings (Example: c5c9baa090b417cd0ab6ba8870b6aa501dd68af0)

Json-Node Type Json Value
entry Uri (see: RFC3986) http://example.com
device String Example: b7e357ee70fbd1fab5ead8ba748922d01fb7b0cd
geo String Example: f25671dc9b7656a20283b8826a55632ce9b47d1e
language (Optional) String Example: 3b0f284d01bdf7b046adc9e1f4eaf820
alert (Optional) Array Example: array("c266ba7aab05851542b84fc1841ccd8f", "dccd01308a2a07fef7791f7c2405ebb9", etc.)

(Example)

curl -X POST "https://api.z-protect.com/v1/scan/request" \
-d "{\"entry\": \"http:\/\/example.com\", \"device\": \"$deviceHash\", \"geo\": \"$geoHash\", \"language\": \"$languageHash\", {\"alert\": [\"$alert1\", \"$alert2\"]}}" \
-H "Content-Type: application/json" \
-H "Z-Auth: $apikey" \
-H "Z-Token: $apiToken"

(Example Response)

{
   "protocol_id":1,
   "server_id":"z1",
   "timestamp":1499425996,
   "state":{
      "type":"Valid",
      "message":""
   },
   "return":{
      "state":"Submitted",
      "entrypoint":"http:\/\/example.com",
      "geo_hash":"b7e357ee70fbd1fab5ead8ba748922d01fb7b0cd",
      "device_hash":"f25671dc9b7656a20283b8826a55632ce9b47d1e",
      "quota":[
         {
            "url":{
               "current":243,
               "limit":5000
            }
         },
         {
            "scan":{
               "current":67742,
               "limit":100000
            }
         }
      ]
   }
}