API Reference v2.0

Files

Main resource for content processing

1. Retrieves a previously processed file resource

GET https://api.scanii.com/v2.0/files/{id}

Example:

$ curl -i  -u 8eb05c68f386421db2dd4929fc4f77ad:12345678 https://api.scanii.com/v2.0/files/decad1d51b7981911113eb735739e73f
HTTP/1.1 200 OK
Access-Control-Allow-Headers: Authorization
Access-Control-Allow-Origin: *
Content-Type: application/json
Date: Fri, 29 May 2015 07:18:21 GMT
Vary: Accept-Encoding
X-Runtime: 91ms
X-Scanii-Host-Id: 613a7f69
X-Scanii-Request-Id: a6b34efc-4b87-4371-a32a-15714017b34c
Content-Length: 299
Connection: keep-alive

{
  "id" : "decad1d51b7981911113eb735739e73f",
  "checksum" : "edbb54821bc3f5666be48184a822c3df59392c31",
  "content_length" : 1579562,
  "findings" : [ "av.crdf.malware-generic.2462546599.unofficial" ],
  "creation_date" : "2015-05-29T06:00:37.772Z",
  "content_type" : "application/x-msdownload"
}

2. Submits a file for processing synchronously

POST https://api.scanii.com/v2.0/files

Example:

$ curl -i -u 8eb05c68f386421db2dd4929fc4f77ad:12345678 -F file=@/Users/foo/malware.exe https://api.scanii.com/v2.0/files
HTTP/1.1 100 Continue

HTTP/1.1 201 Created
Access-Control-Allow-Headers: Authorization
Access-Control-Allow-Origin: *
Content-Type: application/json
Date: Fri, 29 May 2015 07:18:57 GMT
Location: https://api.scanii.com/v2.0/files/8db1c19c20d3aff74f9b8110e6ba78ad
X-Runtime: 869ms
X-Scanii-Host-Id: 613a7f69
X-Scanii-Request-Id: fbc1d499-714c-4425-9a8d-c7c7f84447f0
Content-Length: 299
Connection: keep-alive

{
  "id" : "8db1c19c20d3aff74f9b8110e6ba78ad",
  "checksum" : "edbb54821bc3f5666be48184a822c3df59392c31",
  "content_length" : 1579562,
  "findings" : [ "av.crdf.malware-generic.2462546599.unofficial" ],
  "creation_date" : "2015-05-29T07:18:58.123Z",
  "content_type" : "application/x-msdownload"
}

3. Submits a file for processing asynchronously

POST https://api.scanii.com/v2.0/files/async

Example:

$ curl -i -u 8eb05c68f386421db2dd4929fc4f77ad:12345678 -F file=@/Users/rafael/Desktop/virus/suba002.exe https://api.scanii.com/v2.0/files/async
HTTP/1.1 100 Continue

HTTP/1.1 202 Accepted
Access-Control-Allow-Headers: Authorization
Access-Control-Allow-Origin: *
Content-Type: application/json
Date: Fri, 29 May 2015 07:19:34 GMT
Location: https://api.scanii.com/v2.0/files/40e6b94b3c540373cbc768f4cb1f1639
X-Runtime: 955ms
X-Scanii-Host-Id: 613a7f69
X-Scanii-Request-Id: d336e807-5c48-4c62-b886-00270a1af173
Content-Length: 41
Connection: keep-alive

{"id":"40e6b94b3c540373cbc768f4cb1f1639"}

4. Submits a remote file to be processed asynchronously

POST https://api.scanii.com/v2.0/files/fetch

Example:

$ curl -i -u 8eb05c68f386421db2dd4929fc4f77ad:12345678 -d location="https%3A%2F%2Fwww.google.com%2Fimages%2Fsrpr%2Flogo11w.png" -d callback=https://acme.com/scanii-webhook https://api.scanii.com/v2.0/files/fetch 
HTTP/1.1 202 Accepted
Access-Control-Allow-Headers: Authorization
Access-Control-Allow-Origin: *
Content-Type: application/json
Date: Fri, 29 May 2015 07:20:29 GMT
Location: https://api.scanii.com/v2.0/files/7c66c10c5e657d0dac48d69637b8d3e3
X-Runtime: 0ms
X-Scanii-Host-Id: 613a7f69
X-Scanii-Request-Id: ee7f19de-e1bc-4548-8f08-967a237fc954
Content-Length: 41
Connection: keep-alive

{"id":"7c66c10c5e657d0dac48d69637b8d3e3"}

Authentication Tokens

Grants temporary access to the scanii API to clients

1. Retrieves a previously created token

GET https://api.scanii.com/v2.0/auth/tokens/{id}

Example:

$ curl -i -u 8eb05c68f386421db2dd4929fc4f77ad:12345678 https://api.scanii.com/v2.0/auth/tokens/d8a718b58ad883dbb9b01c5a9083e230
HTTP/1.1 200 OK
Access-Control-Allow-Headers: Authorization
Access-Control-Allow-Origin: *
Content-Type: application/json
Date: Fri, 29 May 2015 07:12:28 GMT
X-Runtime: 0ms
X-Scanii-Host-Id: 613a7f69
X-Scanii-Request-Id: 46dfa9e6-7a04-4f7a-bc75-0b7d386148b7
Content-Length: 145
Connection: keep-alive

{
  "id" : "d8a718b58ad883dbb9b01c5a9083e230",
  "creation_date" : "2015-05-29T07:08:00.348Z",
  "expiration_date" : "2015-05-29T07:08:20.348Z"
}

2. Creates a temporary authentication token

POST https://api.scanii.com/v2.0/auth/tokens/

Example:

$ curl -i -u 8eb05c68f386421db2dd4929fc4f77ad:12345678-d timeout=20 https://api.scanii.com/v2.0/auth/tokens
HTTP/1.1 201 Created
Access-Control-Allow-Headers: Authorization
Access-Control-Allow-Origin: *
Content-Type: application/json
Date: Fri, 29 May 2015 07:13:16 GMT
Location: https://api.scanii.com/v2.0/auth/tokens/fdbce076ae2ad0b86f07fe3eccb6bbbc
X-Runtime: 1ms
X-Scanii-Host-Id: 613a7f69
X-Scanii-Request-Id: 37318898-b374-46f5-b006-4515d17f24de
Content-Length: 145
Connection: keep-alive

{
  "id" : "fdbce076ae2ad0b86f07fe3eccb6bbbc",
  "creation_date" : "2015-05-29T07:13:16.902Z",
  "expiration_date" : "2015-05-29T07:13:36.902Z"
} 

2. Deletes a temporary authentication token

DELETE https://api.scanii.com/v2.0/auth/tokens/{id}

Example:

$ curl -i -u 8eb05c68f386421db2dd4929fc4f77ad:12345678 -X DELETE  https://api.scanii.com/v2.0/auth/tokens/fdbce076ae2ad0b86f07fe3eccb6bbbc
HTTP/1.1 204 No Content
Access-Control-Allow-Headers: Authorization
Access-Control-Allow-Origin: *
Date: Fri, 29 May 2015 07:14:22 GMT
X-Runtime: 1ms
X-Scanii-Host-Id: 613a7f69
X-Scanii-Request-Id: 557d09b5-7c99-43c0-ad1c-efc67ed34141
Connection: keep-alive        

Ping

Test resource, you ping, we pong.

1.Hello world

GET https://api.scanii.com/v2.0/ping

Example:

$ curl -i -u 8eb05c68f386421db2dd4929fc4f77ad:12345678 https://api.scanii.com/v2.0/ping
HTTP/1.1 200 OK
Access-Control-Allow-Headers: Authorization
Access-Control-Allow-Origin: *
Content-Type: application/json
Date: Fri, 29 May 2015 07:14:53 GMT
X-Runtime: 0ms
X-Scanii-Host-Id: 613a7f69
X-Scanii-Request-Id: fac433f3-2514-4328-8dd1-1f43b7952605
Content-Length: 70
Connection: keep-alive

{
  "message" : "pong",
  "key" : "8eb05c68f386421db2dd4929fc4f77ad"
}

Last updated on 05/25/2015.