NAV Navigation
Shell HTTP JavaScript Ruby Python PHP Java Go

Glasswall API Menlo Security Plug-in v1.1

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Authentication

Menlo

Glasswall API implementation for Menlo Security Platform Plug-in. This will allow Menlo to provide a file to an externally controlled API, in this case to Glasswall, implementing the following defined interface. The primary purpose of this integration is to submit a file to the Glasswall API for additional file processing. The Glasswall API can then process the file and make the outcome available to the Menlo Security Platform.

Processes the uploaded file in binary format using Glasswall Halo asynchronously.

Code samples

# You can also use wget
curl -X POST /api/v1/submit \
-H 'Content-Type: multipart/form-data' \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
POST /api/v1/submit HTTP/1.1

Content-Type: multipart/form-data
Accept: application/json
const inputBody = '{
"file": "string"
}';
const headers = {
'Content-Type':'multipart/form-data',
'Accept':'application/json',
'Authorization':'API_KEY'
};

fetch('/api/v1/submit',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'

headers = {
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}

result = RestClient.post '/api/v1/submit',
params: {
}, headers: headers

p JSON.parse(result)
import requests
headers = {
'Content-Type': 'multipart/form-data',
'Accept': 'application/json',
'Authorization': 'API_KEY'
}

r = requests.post('/api/v1/submit', headers = headers)

print(r.json())
<?php

require 'vendor/autoload.php';

$headers = array(
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
$response = $client->request('POST','/api/v1/submit', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}

// ...
URL obj = new URL("/api/v1/submit");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main

import (
"bytes"
"net/http"
)

func main() {

headers := map[string][]string{
"Content-Type": []string{"multipart/form-data"},
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}

data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/api/v1/submit", data)
req.Header = headers

client := &http.Client{}
resp, err := client.Do(req)
// ...
}

POST /api/v1/submit

The endpoint accepts requests to rebuild files asynchronously. The file is sent in the request body as a field in ‘multipart/form-data’.

Body parameter

file: string

Parameters

Name In Type Required Description
body body MenloRequestBodyForSubmit true none

Example responses

200 Response

{
"result": "accepted",
"uuid": "ee7b1c04-dade-4abf-b5db-5e3f13b06c2d"
}

Responses

Status Meaning Description Schema
200 OK The asynchronous Glasswall Halo request is accepted. MenloResponseBodyForSubmit
400 Bad Request Bad Request None
401 Unauthorized Unauthorized request None
500 Internal Server Error Internal Server Error None
503 Service Unavailable Service Unavailable None

Retrieves the status of the Glasswall Halo processing request submitted asynchronously by Menlo plugin.

Code samples

# You can also use wget
curl -X GET /api/v1/result?uuid=497f6eca-6276-4993-bfeb-53cbbbba6f08 \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
GET /api/v1/result?uuid=497f6eca-6276-4993-bfeb-53cbbbba6f08 HTTP/1.1

Accept: application/json

const headers = {
'Accept':'application/json',
'Authorization':'API_KEY'
};

fetch('/api/v1/result?uuid=497f6eca-6276-4993-bfeb-53cbbbba6f08',
{
method: 'GET',

headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'

headers = {
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}

result = RestClient.get '/api/v1/result',
params: {
'uuid' => '[MenloUuid](#schemamenlouuid)'
}, headers: headers

p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'API_KEY'
}

r = requests.get('/api/v1/result', params={
'uuid': '497f6eca-6276-4993-bfeb-53cbbbba6f08'
}, headers = headers)

print(r.json())
<?php

require 'vendor/autoload.php';

$headers = array(
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
$response = $client->request('GET','/api/v1/result', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}

// ...
URL obj = new URL("/api/v1/result?uuid=497f6eca-6276-4993-bfeb-53cbbbba6f08");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main

import (
"bytes"
"net/http"
)

func main() {

headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}

data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/result", data)
req.Header = headers

client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /api/v1/result

The endpoint retrieves the status of the Glasswall Halo processing request submitted asynchronously by Menlo plugin.

Parameters

Name In Type Required Description
uuid query MenloUuid true UUID that corresponds to an asynchronous request

Example responses

The request submitted by Menlo plugin is still in progress.

{
"result": "pending"
}

The request submitted by Menlo plugin is completed and the file is rebuilt successfully.

{
"result": "completed",
"outcome": "clean",
"modifications": [
"Original file rebuilt by Glasswall Halo"
],
"report_url": null
}

The request submitted by Menlo plugin is completed but the file could not be rebuilt by Glasswall Halo

{
"result": "completed",
"outcome": "error",
"modifications": [
"Original file contains issue items that prevent successful rebuild by Glasswall Halo"
],
"error_message": "Original file contains issue items that prevent successful rebuild by Glasswall Halo",
"report_url": null
}

404 Response

{
"errors": [
{
"errorCode": 44404,
"errorDescription": "Unable to find the transactionId"
}
]
}

Responses

Status Meaning Description Schema
200 OK Status of the Glasswall Halo async request for the given uuid MenloResponseBodyForResult
400 Bad Request Bad Request None
401 Unauthorized Unauthorized request None
404 Not Found Specified uuid not found None
500 Internal Server Error Internal Server Error None
503 Service Unavailable Service Unavailable None

Response Schema

Retrieves the rebuilt file once Glasswall Halo successfully completes processing.

Code samples

# You can also use wget
curl -X GET /api/v1/file?uuid=497f6eca-6276-4993-bfeb-53cbbbba6f08 \
-H 'Accept: application/octet-stream' \
-H 'Authorization: API_KEY'
GET /api/v1/file?uuid=497f6eca-6276-4993-bfeb-53cbbbba6f08 HTTP/1.1

Accept: application/octet-stream

const headers = {
'Accept':'application/octet-stream',
'Authorization':'API_KEY'
};

fetch('/api/v1/file?uuid=497f6eca-6276-4993-bfeb-53cbbbba6f08',
{
method: 'GET',

headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'

headers = {
'Accept' => 'application/octet-stream',
'Authorization' => 'API_KEY'
}

result = RestClient.get '/api/v1/file',
params: {
'uuid' => '[MenloUuid](#schemamenlouuid)'
}, headers: headers

p JSON.parse(result)
import requests
headers = {
'Accept': 'application/octet-stream',
'Authorization': 'API_KEY'
}

r = requests.get('/api/v1/file', params={
'uuid': '497f6eca-6276-4993-bfeb-53cbbbba6f08'
}, headers = headers)

print(r.json())
<?php

require 'vendor/autoload.php';

$headers = array(
'Accept' => 'application/octet-stream',
'Authorization' => 'API_KEY',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
$response = $client->request('GET','/api/v1/file', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}

// ...
URL obj = new URL("/api/v1/file?uuid=497f6eca-6276-4993-bfeb-53cbbbba6f08");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main

import (
"bytes"
"net/http"
)

func main() {

headers := map[string][]string{
"Accept": []string{"application/octet-stream"},
"Authorization": []string{"API_KEY"},
}

data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/file", data)
req.Header = headers

client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /api/v1/file

The endpoint retrieves the rebuilt file once Glasswall Halo successfully completes processing.

Parameters

Name In Type Required Description
uuid query MenloUuid true UUID that corresponds to a Glasswall Halo asynchronous request

Example responses

200 Response

Bad Request

[
{
"errorCode": 4003,
"errorDescription": "The file is still undergoing processing and cannot be downloaded yet"
}
]
[
{
"errorCode": 4004,
"errorDescription": "Original file contains issue items that prevent successful rebuild by Glasswall Halo"
}
]

404 Response

{
"errors": [
{
"errorCode": 44404,
"errorDescription": "Unable to find the transactionId"
}
]
}

Internal Server Error

[
{
"errorCode": 5001,
"errorDescription": "Unexpected errors while processing original file that prevent successful rebuild by Glasswall Halo"
}
]

Responses

Status Meaning Description Schema
200 OK Contains the rebuilt file produced by Glasswall Halo MenloResponseBodyForFile
400 Bad Request Bad Request None
401 Unauthorized Unauthorized request None
404 Not Found Specified uuid not found None
500 Internal Server Error Internal Server Error None
503 Service Unavailable Service Unavailable None

Response Schema

Schemas

Error

[
"string"
]

Properties

None

MenloRequestBodyForSubmit

{
"file": "string"
}

Properties

Name Type Required Restrictions Description
file string(binary) true none Contains the binary input file including the filename for Menlo request. The name of the file can be percent encoded in the “filename” parameter and can be presented through this field of this multipart form.

MenloResponseBodyForSubmit

{
"result": "accepted",
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f"
}

Contains the response from Menlo /api/v1/submit API

Properties

Name Type Required Restrictions Description
result string false none none
uuid string(uuid) false none none

Enumerated Values

Property Value
result accepted

MenloUuid

"497f6eca-6276-4993-bfeb-53cbbbba6f08"

UUID that corresponds to the asynchronous request

Properties

Name Type Required Restrictions Description
anonymous string(uuid) false none UUID that corresponds to the asynchronous request

MenloResponseBodyForResult

{
"result": "pending",
"outcome": "clean",
"modifications": [
"string"
],
"error_message": "string",
"report_url": "string"
}

Contains the status of the Glasswall Halo for Menlo request

Properties

Name Type Required Restrictions Description
result string false none none
outcome string false none none
modifications [string] false none none
error_message string¦null false none none
report_url string¦null false none none

Enumerated Values

Property Value
result pending
result completed
outcome clean
outcome error

MenloResponseBodyForFile

"string"

Contains the binary output file

Properties

Name Type Required Restrictions Description
anonymous string(binary) false none Contains the binary output file