Skip to content
This repository has been archived by the owner on Feb 14, 2020. It is now read-only.

Internal API Documentation

Capuccino edited this page Dec 23, 2018 · 7 revisions

This Documentation is for the REST backend that is not exposed to the internet.

Keep in mind for security reasons, this backend SHOULD never be exposed on the public internet!

/sendmail Endpoint

Method: POST

The sendmail endpoint is capable of issuing a verification token and sends it to the target email provided by the POSTer.

JSON Properties

Property Description
email The email of the target user
username Username of the user

Returns

200 OK if it sent successfully.

400 Bad Response if Malformed JSON. Check JSON properties if its right.

500 Internal Server Error if Something went wrong.

/verify endpoint

Method: POST

This verifies the token from the token in the URL parameters on the link sent from /sendmail.

URL parameters has to be passed on POST from the public REST.

URL Encoded properties

Property Description
email The email from the URL in Parameters
token The token from the URL in Parameters

Returns

200 OK if the token is correct, public REST shall now verify user.

410 Gone if the token is valid but has expired.

403 Forbidden if invalid Token.

500 Internal Server Error if something has gone wrong. Check Error logs for this.

400 Bad Request if Malformed JSON. Check JSON properties for details.

/analyze Endpoint

Method: POST

This uses Virustotal from Alphabet Inc. to scan Download URLs for malware.

Be reminded this is supposed to be POSTed at, and REST is responsible for sending the payload to analyze.

JSON properties

Property Description
url URL of the download link.

Returns

200 OK if the it all went well.

  • However, REST should observe the is_bad boolean field from the JSON Response. if its true, inform to frontend immediately.

429 Ratelimited if responses exceeded Virustotal's per-minute ratelimit.

500 Internal Server Error if something has gone wrong. Check Error logs for this.

400 Bad Request if Malformed JSON. Check JSON properties for details.