Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Pedro_Espindola
Advisor

Heads up about incorret schema in the Threat Prevention API on Swaggerhub

Hi everyone,

I just wanted to give a heads up to anyone starting to use the Threat Prevention API, since I lost a lot of time to understand this.

In the Upload API on Swaggerhub there is a form field named 'request' which should contain a JSON that also contains a field named 'request'.

The schema does not mention this additional request field. There is an example there, which will not work if you just replace the field values without changing the structure.

{ "file_name": "string", "md5": "Service calculates digests", "sha1": "Service calculates digests", "sha256": "Service calculates digests", "file_type": "string", "features": [ "te" ], "<feature>": { "images": [ { "id": "string", "revision": 0 } ], "reports": [   "pdf"    ]  }}

This should be:

{"request":{ "file_name": "string", "md5": "Service calculates digests", "sha1": "Service calculates digests", "sha256": "Service calculates digests", "file_type": "string", "features": [ "te" ], "<feature>": { "images": [ { "id": "string", "revision": 0 } ], "reports": [  "pdf"    ]  }}}

When sending curl, it will be:

--form 'request={"request":[{ "file_name": "string", "md5": "Service calculates digests", "sha1": "Service calculates digests", "sha256": "Service calculates digests", "file_type": "string", "features": [ "te" ], "<feature>": { "images": [ { "id": "string", "revision": 0 } ], "reports": [  "pdf"    ]  }}]}

I already reported this to TAC, so eventually the docs should be fixed.

The docs in support center have a better example:

Threat Prevention API 1.0 Reference Guide

 

(1)
0 Replies

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events